Gentoo Archives: gentoo-commits

From: "Doug Goldstein (cardoe)" <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/qemu-kvm: ChangeLog qemu-kvm-0.12.2-r1.ebuild
Date: Wed, 03 Feb 2010 05:41:19
Message-Id: E1NcXzI-0006Yh-C2@stork.gentoo.org
1 cardoe 10/02/03 05:41:16
2
3 Modified: ChangeLog
4 Added: qemu-kvm-0.12.2-r1.ebuild
5 Log:
6 upstream fix for virtio and certain use cases. Fixes issues people have seen with Ubuntu 10.04 guests and other distros
7 (Portage version: 2.1.7.16/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.16 app-emulation/qemu-kvm/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?rev=1.16&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?rev=1.16&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/qemu-kvm/ChangeLog?r1=1.15&r2=1.16
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v
19 retrieving revision 1.15
20 retrieving revision 1.16
21 diff -u -r1.15 -r1.16
22 --- ChangeLog 21 Jan 2010 00:33:52 -0000 1.15
23 +++ ChangeLog 3 Feb 2010 05:41:15 -0000 1.16
24 @@ -1,6 +1,14 @@
25 # ChangeLog for app-emulation/qemu-kvm
26 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.15 2010/01/21 00:33:52 cardoe Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.16 2010/02/03 05:41:15 cardoe Exp $
29 +
30 +*qemu-kvm-0.12.2-r1 (03 Feb 2010)
31 +
32 + 03 Feb 2010; Doug Goldstein <cardoe@g.o>
33 + +qemu-kvm-0.12.2-r1.ebuild,
34 + +files/qemu-kvm-0.12.2-virtio-large-iovecs.patch:
35 + upstream fix for virtio and certain use cases. Fixes issues people have
36 + seen with Ubuntu 10.04 guests and other distros
37
38 *qemu-kvm-0.12.2 (21 Jan 2010)
39
40
41
42
43 1.1 app-emulation/qemu-kvm/qemu-kvm-0.12.2-r1.ebuild
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.12.2-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.12.2-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: qemu-kvm-0.12.2-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2010 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.12.2-r1.ebuild,v 1.1 2010/02/03 05:41:15 cardoe Exp $
53
54 EAPI="2"
55
56 if [[ ${PV} = *9999* ]]; then
57 EGIT_REPO_URI="git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git"
58 GIT_ECLASS="git"
59 fi
60
61 inherit eutils flag-o-matic ${GIT_ECLASS} linux-info toolchain-funcs
62
63 if [[ ${PV} = *9999* ]]; then
64 SRC_URI=""
65 KEYWORDS=""
66 else
67 SRC_URI="mirror://sourceforge/kvm/${PN}/${P}.tar.gz"
68 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
69 fi
70
71 DESCRIPTION="QEMU + Kernel-based Virtual Machine userland tools"
72 HOMEPAGE="http://www.linux-kvm.org"
73
74 LICENSE="GPL-2"
75 SLOT="0"
76 # xen is disabled until the deps are fixed
77 IUSE="+aio alsa bluetooth curl esd gnutls fdt hardened kvm-trace ncurses \
78 pulseaudio sasl +sdl vde"
79
80 COMMON_TARGETS="i386 x86_64 arm cris m68k microblaze mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64"
81 IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} mips64 mips64el ppcemb"
82 IUSE_USER_TARGETS="${COMMON_TARGETS} alpha armeb ppc64abi32 sparc32plus"
83
84 for target in ${IUSE_SOFTMMU_TARGETS}; do
85 IUSE="${IUSE} +qemu_softmmu_targets_${target}"
86 done
87
88 for target in ${IUSE_USER_TARGETS}; do
89 IUSE="${IUSE} +qemu_user_targets_${target}"
90 done
91
92 RESTRICT="test"
93
94 RDEPEND="
95 !app-emulation/kqemu
96 !app-emulation/qemu
97 !app-emulation/qemu-softmmu
98 !app-emulation/qemu-user
99 sys-apps/pciutils
100 >=sys-apps/util-linux-2.16.0
101 sys-libs/zlib
102 aio? ( dev-libs/libaio )
103 alsa? ( >=media-libs/alsa-lib-1.0.13 )
104 bluetooth? ( net-wireless/bluez )
105 curl? ( net-misc/curl )
106 esd? ( media-sound/esound )
107 fdt? ( sys-apps/dtc )
108 gnutls? ( net-libs/gnutls )
109 ncurses? ( sys-libs/ncurses )
110 pulseaudio? ( media-sound/pulseaudio )
111 sasl? ( dev-libs/cyrus-sasl )
112 sdl? ( >=media-libs/libsdl-1.2.11[X] )
113 vde? ( net-misc/vde )
114 "
115
116 DEPEND="${RDEPEND}
117 app-text/texi2html
118 >=sys-kernel/linux-headers-2.6.29
119 gnutls? ( dev-util/pkgconfig )"
120
121 kvm_kern_war() {
122 eerror "Please enable KVM support in your kernel, found at:"
123 eerror
124 eerror " Virtualization"
125 eerror " Kernel-based Virtual Machine (KVM) support"
126 eerror
127 }
128
129 pkg_setup() {
130 if kernel_is lt 2 6 25; then
131 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
132 eerror "Either upgrade your kernel"
133 die "qemu-kvm version not compatible"
134 else
135 if ! linux_config_exists; then
136 eerror "Unable to check your kernel for KVM support"
137 kvm_kern_warn
138 elif ! linux_chkconfig_present KVM; then
139 kvm_kern_warn
140 fi
141 fi
142
143 enewgroup kvm
144 }
145
146 src_prepare() {
147 # avoid fdt till an updated release appears
148 sed -i -e 's:fdt="yes":fdt="no":' configure || die
149 # prevent docs to get automatically installed
150 sed -i '/$(DESTDIR)$(docdir)/d' Makefile || die
151 # Alter target makefiles to accept CFLAGS set via flag-o
152 sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
153 Makefile Makefile.target || die
154 # append CFLAGS while linking
155 sed -i 's/$(LDFLAGS)/$(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS)/' rules.mak || die
156
157 # remove part to make udev happy
158 sed -e 's~NAME="%k", ~~' -i kvm/scripts/65-kvm.rules || die
159
160 epatch "${FILESDIR}/qemu-0.11.0-mips64-user-fix.patch"
161
162 epatch "${FILESDIR}"/${P}-virtio-large-iovecs.patch
163 }
164
165 src_configure() {
166 local conf_opts audio_opts softmmu_targets user_targets
167
168 for target in ${IUSE_SOFTMMU_TARGETS} ; do
169 use "qemu_softmmu_targets_${target}" && \
170 softmmu_targets="${softmmu_targets} ${target}-softmmu"
171 done
172
173 for target in ${IUSE_USER_TARGETS} ; do
174 use "qemu_user_targets_${target}" && \
175 user_targets="${user_targets} ${target}-linux-user"
176 done
177
178 if [ ! -z "${softmmu_targets}" ]; then
179 einfo "Building the following softmmu targets: ${softmmu_targets}"
180 fi
181
182 if [ ! -z "${user_targets}" ]; then
183 einfo "Building the following user targets: ${user_targets}"
184 conf_opts="${conf_opts} --enable-linux-user"
185 else
186 conf_opts="${conf_opts} --disable-linux-user"
187 fi
188
189 #config options
190 conf_opts="${conf_opts} $(use_enable aio linux-aio)"
191 use bluetooth || conf_opts="${conf_opts} --disable-bluez"
192 conf_opts="${conf_opts} $(use_enable curl)"
193 use gnutls || conf_opts="${conf_opts} --disable-vnc-tls"
194 conf_opts="${conf_opts} $(use_enable fdt)"
195 use hardened && conf_opts="${conf_opts} --enable-user-pie"
196 use kvm-trace && conf_opts="${conf_opts} --with-kvm-trace"
197 use ncurses || conf_opts="${conf_opts} --disable-curses"
198 use sasl || conf_opts="${conf_opts} --disable-vnc-sasl"
199 use sdl || conf_opts="${conf_opts} --disable-sdl"
200 use vde || conf_opts="${conf_opts} --disable-vde"
201 # conf_opts="${conf_opts} $(use_enable xen)"
202 conf_opts="${conf_opts} --disable-xen"
203 conf_opts="${conf_opts} --disable-darwin-user --disable-bsd-user"
204
205 # audio options
206 audio_opts="oss"
207 use alsa && audio_opts="alsa ${audio_opts}"
208 use esd && audio_opts="esd ${audio_opts}"
209 use pulseaudio && audio_opts="pa ${audio_opts}"
210 use sdl && audio_opts="sdl ${audio_opts}"
211 ./configure --prefix=/usr \
212 --disable-strip \
213 --enable-kvm \
214 --enable-nptl \
215 --enable-uuid \
216 ${conf_opts} \
217 --audio-drv-list="${audio_opts}" \
218 --target-list="${softmmu_targets} ${user_targets}" \
219 --cc=$(tc-getCC) \
220 --host-cc=$(tc-getCC) \
221 || die "configure failed"
222
223 # this is for qemu upstream's threaded support which is
224 # in development and broken
225 # the kvm project has its own support for threaded IO
226 # which is always on and works
227 # --enable-io-thread \
228 }
229
230 src_install() {
231 emake DESTDIR="${D}" install || die "make install failed"
232
233 insinto /etc/udev/rules.d/
234 doins kvm/scripts/65-kvm.rules || die
235
236 insinto /etc/qemu/
237 insopts -m0755
238 doins kvm/scripts/qemu-ifup || die
239
240 dodoc Changelog MAINTAINERS TODO pci-ids.txt || die
241 newdoc pc-bios/README README.pc-bios || die
242 dohtml qemu-doc.html qemu-tech.html || die
243
244 dobin "${FILESDIR}"/qemu-kvm
245 dosym /usr/bin/qemu-kvm /usr/bin/kvm
246 }
247
248 pkg_postinst() {
249 elog "If you don't have kvm compiled into the kernel, make sure you have"
250 elog "the kernel module loaded before running kvm. The easiest way to"
251 elog "ensure that the kernel module is loaded is to load it on boot."
252 elog "For AMD CPUs the module is called 'kvm-amd'"
253 elog "For Intel CPUs the module is called 'kvm-intel'"
254 elog "Please review /etc/conf.d/modules for how to load these"
255 elog
256 elog "Make sure your user is in the 'kvm' group"
257 elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
258 elog
259 elog "You will need the Universal TUN/TAP driver compiled into your"
260 elog "kernel or loaded as a module to use the virtual network device"
261 elog "if using -net tap. You will also need support for 802.1d"
262 elog "Ethernet Bridging and a configured bridge if using the provided"
263 elog "kvm-ifup script from /etc/kvm."
264 echo
265 }