Gentoo Archives: gentoo-commits

From: "Micheal Marineau (marineam)" <marineam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/libvirt/files: libvirtd.init libvirt-0.4.6-parallel-build-fix.patch libvirt-0.4.6-qemu-img-name.patch
Date: Sun, 23 Nov 2008 21:53:56
Message-Id: E1L4Mtu-0002SA-IW@stork.gentoo.org
1 marineam 08/11/23 21:53:54
2
3 Modified: libvirtd.init
4 Added: libvirt-0.4.6-parallel-build-fix.patch
5 libvirt-0.4.6-qemu-img-name.patch
6 Log:
7 Bump libvirt to 0.4.6 and fix a couple bugs.
8 (Portage version: 2.1.4.5)
9
10 Revision Changes Path
11 1.5 app-emulation/libvirt/files/libvirtd.init
12
13 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/libvirt/files/libvirtd.init?rev=1.5&view=markup
14 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/libvirt/files/libvirtd.init?rev=1.5&content-type=text/plain
15 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/libvirt/files/libvirtd.init?r1=1.4&r2=1.5
16
17 Index: libvirtd.init
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/libvirt/files/libvirtd.init,v
20 retrieving revision 1.4
21 retrieving revision 1.5
22 diff -u -r1.4 -r1.5
23 --- libvirtd.init 11 Aug 2008 13:52:03 -0000 1.4
24 +++ libvirtd.init 23 Nov 2008 21:53:54 -0000 1.5
25 @@ -7,34 +7,38 @@
26 before sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
27 }
28
29 -hypervisor_type() {
30 - virsh version | grep "Running hypervisor" | grep QEMU | wc -l
31 +libvirtd_virsh() {
32 + # Silence errors because virsh always throws an error about
33 + # not finding the hypervisor version when connecting to libvirtd
34 + LC_ALL=C virsh -c qemu:///system "$@" 2>/dev/null
35 }
36
37 -libvirtd_domains() {
38 - virsh list | grep running | wc -l
39 +libvirtd_dom_list() {
40 + libvirtd_virsh list | grep running | awk '{ print $1 }'
41 +}
42 +
43 +libvirtd_dom_count() {
44 + libvirtd_dom_list | wc -l
45 }
46
47 start() {
48 - ebegin "Starting libvirtd"
49 - start-stop-daemon --start --quiet --exec /usr/sbin/libvirtd -- -d ${LIBVIRTD_OPTS}
50 - eend $?
51 + ebegin "Starting libvirtd"
52 + start-stop-daemon --start --quiet --exec /usr/sbin/libvirtd -- -d ${LIBVIRTD_OPTS}
53 + eend $?
54 }
55
56 stop() {
57 - ebegin "Stopping libvirtd"
58 - # try to shutdown all (KVM) domains
59 - DOM_COUNT="$(libvirtd_domains)"
60 - HYPERVISOR_KVM="$(hypervisor_type)"
61 - if [ ${HYPERVISOR_KVM} ] \
62 - && [ "${LIBVIRTD_KVM_SHUTDOWN}" = "yes" ] \
63 + ebegin "Stopping libvirtd"
64 + # try to shutdown all (KVM/Qemu) domains
65 + DOM_COUNT="$(libvirtd_dom_count)"
66 + if [ "${LIBVIRTD_KVM_SHUTDOWN}" = "yes" ] \
67 && [ "${DOM_COUNT}" != "0" ] ; then
68
69 einfo " Shutting down domain(s):"
70 - for DOM_ID in $(virsh list | grep running | awk '{ print $1 }') ; do
71 - NAME="$(virsh domname ${DOM_ID} | head -n 1)"
72 + for DOM_ID in $(libvirtd_dom_list) ; do
73 + NAME="$(libvirtd_virsh domname ${DOM_ID} | head -n 1)"
74 einfo " ${NAME}"
75 - virsh shutdown ${DOM_ID} > /dev/null
76 + libvirtd_virsh shutdown ${DOM_ID} > /dev/null
77 done
78
79 if [ -n "${LIBVIRTD_KVM_SHUTDOWN_MAXWAIT}" ] ; then
80 @@ -44,26 +48,26 @@
81 fi
82
83 einfo " Waiting ${COUNTER} seconds while domains shutdown ..."
84 - DOM_COUNT="$(libvirtd_domains)"
85 + DOM_COUNT="$(libvirtd_dom_count)"
86 while [ ${DOM_COUNT} -gt 0 ] && [ ${COUNTER} -gt 0 ] ; do
87 - DOM_COUNT="$(libvirtd_domains)"
88 + DOM_COUNT="$(libvirtd_dom_count)"
89 sleep 1
90 COUNTER=$((${COUNTER} - 1))
91 echo -n "."
92 done
93
94 - DOM_COUNT="$(libvirtd_domains)"
95 + DOM_COUNT="$(libvirtd_dom_count)"
96 if [ "${DOM_COUNT}" != "0" ] ; then
97 eerror " !!! Some guests are still running, stopping anyways"
98 fi
99
100 fi
101 - start-stop-daemon --stop --quiet --exec /usr/sbin/libvirtd --pidfile=/var/run/libvirtd.pid
102 - eend $?
103 + start-stop-daemon --stop --quiet --exec /usr/sbin/libvirtd --pidfile=/var/run/libvirtd.pid
104 + eend $?
105 }
106
107 reload() {
108 - ebegin "Reloading libvirtd"
109 - start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/libvirtd.pid --oknodo
110 - eend $?
111 + ebegin "Reloading libvirtd"
112 + start-stop-daemon --stop --signal HUP --quiet --pidfile /var/run/libvirtd.pid --oknodo
113 + eend $?
114 }
115
116
117
118 1.1 app-emulation/libvirt/files/libvirt-0.4.6-parallel-build-fix.patch
119
120 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/libvirt/files/libvirt-0.4.6-parallel-build-fix.patch?rev=1.1&view=markup
121 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/libvirt/files/libvirt-0.4.6-parallel-build-fix.patch?rev=1.1&content-type=text/plain
122
123 Index: libvirt-0.4.6-parallel-build-fix.patch
124 ===================================================================
125 --- libvirt-0.4.6/python/Makefile.am.orig 2008-11-23 15:32:03.000000000 -0500
126 +++ libvirt-0.4.6/python/Makefile.am 2008-11-23 15:36:51.000000000 -0500
127 @@ -47,8 +47,11 @@
128 libvirt-py.h \
129 libvirtclass.py
130
131 -$(GENERATED): $(srcdir)/$(GENERATE) $(API_DESC)
132 +generated.stamp: $(srcdir)/$(GENERATE) $(API_DESC)
133 $(PYTHON) $(srcdir)/$(GENERATE) $(srcdir)
134 + touch $@
135 +
136 +$(GENERATED): generated.stamp
137
138 libvirt.py: $(srcdir)/libvir.py libvirtclass.py
139 cat $(srcdir)/libvir.py libvirtclass.py > $@-t
140 @@ -66,7 +69,7 @@
141 uninstall-local:
142 rm -f $(DESTDIR)$(pythondir)/libvirt.py
143
144 -CLEANFILES= $(GENERATED) libvirt.py
145 +CLEANFILES= $(GENERATED) generated.stamp libvirt.py
146
147 else
148 all:
149
150
151
152 1.1 app-emulation/libvirt/files/libvirt-0.4.6-qemu-img-name.patch
153
154 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/libvirt/files/libvirt-0.4.6-qemu-img-name.patch?rev=1.1&view=markup
155 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/libvirt/files/libvirt-0.4.6-qemu-img-name.patch?rev=1.1&content-type=text/plain
156
157 Index: libvirt-0.4.6-qemu-img-name.patch
158 ===================================================================
159 --- libvirt-0.4.6/configure.in.orig 2008-11-20 22:44:26.000000000 -0500
160 +++ libvirt-0.4.6/configure.in 2008-11-20 23:06:29.000000000 -0500
161 @@ -698,7 +698,14 @@
162 [Location or name of the showmount program])
163 fi
164
165 -AC_PATH_PROG([QEMU_IMG], [qemu-img], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
166 +AC_ARG_WITH([qemu-img-name], [AC_HELP_STRING([--with-qemu-img-name=[name of binary|qemu-img]], [Name of the qemu-img binary])])
167 +if test "x$with_qemu_img_name" == "x" ; then
168 + QEMU_IMG_BIN="qemu-img"
169 +else
170 + QEMU_IMG_BIN="$with_qemu_img_name"
171 +fi
172 +
173 +AC_PATH_PROG([QEMU_IMG], [$QEMU_IMG_BIN], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
174 if test -n "$QEMU_IMG" ; then
175 AC_DEFINE_UNQUOTED([HAVE_QEMU_IMG], 1, [whether qemu-img is available for non-raw files])
176 AC_DEFINE_UNQUOTED([QEMU_IMG],["$QEMU_IMG"],