diff options
author | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2010-11-02 16:29:19 +0000 |
---|---|---|
committer | Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> | 2010-11-02 16:29:19 +0000 |
commit | 3e5359a48bf442c86b4f88d26d1a6a104d46132d (patch) | |
tree | efdf685b12964aad2ea13cf92af969c581d45668 /app-emulation | |
parent | Remove mescalinum from metadata.xml (diff) | |
download | gentoo-2-3e5359a48bf442c86b4f88d26d1a6a104d46132d.tar.gz gentoo-2-3e5359a48bf442c86b4f88d26d1a6a104d46132d.tar.bz2 gentoo-2-3e5359a48bf442c86b4f88d26d1a6a104d46132d.zip |
Synced the qemu-kvm-0.13.0-r1 ebuild with qemu-kvm-9999 ebuild.
Added missing jpeg and png use flags. Dropped the non-existent kvm-trace use flag - fixes bug 343317.
Moved some checks from pkg_setup to src_configure. Applied the fix to the $(prefix)/etc issue.
Dropped unused qemu-kvm-0.12.1-kvm_save_mpstate-workaround.patch file - fixes bug 340727.
Included patch file to fix issues with usb, bug 337988 , but won't use it until upstream commits it to the git tree or gives an ok.
Dropped old version.
(Portage version: 2.2.0_alpha3/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation')
-rw-r--r-- | app-emulation/qemu-kvm/ChangeLog | 19 | ||||
-rw-r--r-- | app-emulation/qemu-kvm/files/qemu-kvm-0.12.1-kvm_save_mpstate-workaround.patch | 20 | ||||
-rw-r--r-- | app-emulation/qemu-kvm/files/qemu-kvm-guest-hang-on-usb-add.patch | 100 | ||||
-rw-r--r-- | app-emulation/qemu-kvm/qemu-kvm-0.13.0-r1.ebuild (renamed from app-emulation/qemu-kvm/qemu-kvm-0.12.5.ebuild) | 131 | ||||
-rw-r--r-- | app-emulation/qemu-kvm/qemu-kvm-9999.ebuild | 13 |
5 files changed, 194 insertions, 89 deletions
diff --git a/app-emulation/qemu-kvm/ChangeLog b/app-emulation/qemu-kvm/ChangeLog index 8705b2d9dd3f..1c465b2ba17f 100644 --- a/app-emulation/qemu-kvm/ChangeLog +++ b/app-emulation/qemu-kvm/ChangeLog @@ -1,6 +1,23 @@ # ChangeLog for app-emulation/qemu-kvm # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.44 2010/10/28 09:54:24 lu_zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/ChangeLog,v 1.45 2010/11/02 16:29:19 jmbsvicetto Exp $ + +*qemu-kvm-0.13.0-r1 (02 Nov 2010) + + 02 Nov 2010; Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> + -files/qemu-kvm-0.12.1-kvm_save_mpstate-workaround.patch, + -qemu-kvm-0.12.5.ebuild, +qemu-kvm-0.13.0-r1.ebuild, qemu-kvm-9999.ebuild, + +files/qemu-kvm-guest-hang-on-usb-add.patch: + Synced the qemu-kvm-0.13.0-r1 ebuild with qemu-kvm-9999 ebuild. + Added missing jpeg and png use flags. Dropped the non-existent kvm-trace + use flag - fixes bug 343317. + Moved some checks from pkg_setup to src_configure. Applied the fix to the + $(prefix)/etc issue. + Dropped unused qemu-kvm-0.12.1-kvm_save_mpstate-workaround.patch file - + fixes bug 340727. + Included patch file to fix issues with usb, bug 337988 , but won't use it + until upstream commits it to the git tree or gives an ok. + Dropped old version. *qemu-kvm-0.13.0 (28 Oct 2010) diff --git a/app-emulation/qemu-kvm/files/qemu-kvm-0.12.1-kvm_save_mpstate-workaround.patch b/app-emulation/qemu-kvm/files/qemu-kvm-0.12.1-kvm_save_mpstate-workaround.patch deleted file mode 100644 index 3fb87f3ddac0..000000000000 --- a/app-emulation/qemu-kvm/files/qemu-kvm-0.12.1-kvm_save_mpstate-workaround.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- monitor.c 2009-12-20 17:21:40.000000000 +0100 -+++ monitor.c.new 2009-12-21 11:47:30.000000000 +0100 -@@ -677,7 +677,7 @@ - mon_set_cpu(0); - } - cpu_synchronize_state(cur_mon->mon_cpu); -- kvm_save_mpstate(cur_mon->mon_cpu); -+// kvm_save_mpstate(cur_mon->mon_cpu); - return cur_mon->mon_cpu; - } - -@@ -780,7 +780,7 @@ - QObject *obj; - - cpu_synchronize_state(env); -- kvm_save_mpstate(env); -+// kvm_save_mpstate(env); - - obj = qobject_from_jsonf("{ 'CPU': %d, 'current': %i, 'halted': %i }", - env->cpu_index, env == mon->mon_cpu, diff --git a/app-emulation/qemu-kvm/files/qemu-kvm-guest-hang-on-usb-add.patch b/app-emulation/qemu-kvm/files/qemu-kvm-guest-hang-on-usb-add.patch new file mode 100644 index 000000000000..3f2abefe879c --- /dev/null +++ b/app-emulation/qemu-kvm/files/qemu-kvm-guest-hang-on-usb-add.patch @@ -0,0 +1,100 @@ +From 485b75728884a052b74d5458199ad45f0acbf190 Mon Sep 17 00:00:00 2001 +From: Timothy Jones <one.timothy.jones@gmail.com> +Date: Mon, 28 Jun 2010 10:38:18 -0400 +Subject: [PATCH v2] Guest OS hangs on usb_add + +This is a small patch to sligtly "intelligentify" usb device and +config descriptor parsing and to handle bug with certain usb +device (URC MX-950) reporting device desriptor length as 0x18 +instead of 18 with added vendor_id/product_id check +--- + hw/usb.h | 5 +++++ + usb-linux.c | 37 ++++++++++++++++++++++--------------- + 2 files changed, 27 insertions(+), 15 deletions(-) + +diff --git a/hw/usb.h b/hw/usb.h +index 00d2802..5c3528f 100644 +--- a/hw/usb.h ++++ b/hw/usb.h +@@ -117,6 +117,11 @@ + #define USB_DT_INTERFACE 0x04 + #define USB_DT_ENDPOINT 0x05 + ++#define USB_DT_DEVICE_LEN 18 ++#define USB_DT_CONFIG_LEN 9 ++#define USB_DT_INTERFACE_LEN 9 ++#define USB_DT_ENDPOINT_LEN 7 ++ + #define USB_ENDPOINT_XFER_CONTROL 0 + #define USB_ENDPOINT_XFER_ISOC 1 + #define USB_ENDPOINT_XFER_BULK 2 +diff --git a/usb-linux.c b/usb-linux.c +index 88273ff..2ac6562 100644 +--- a/usb-linux.c ++++ b/usb-linux.c +@@ -288,7 +288,7 @@ static void async_cancel(USBPacket *unused, void *opaque) + + static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration) + { +- int dev_descr_len, config_descr_len; ++ int dev_descr_len, config_descr_total_len; + int interface, nb_interfaces; + int ret, i; + +@@ -297,32 +297,39 @@ static int usb_host_claim_interfaces(USBHostDevice *dev, int configuration) + + DPRINTF("husb: claiming interfaces. config %d\n", configuration); + +- i = 0; + dev_descr_len = dev->descr[0]; +- if (dev_descr_len > dev->descr_len) { ++ if (dev_descr_len == 0x18 && dev->descr[ 8] == 0x47 && dev->descr[ 9] == 0x46 ++ && dev->descr[10] == 0x00 && dev->descr[11] == 0x30) ++ dev_descr_len = USB_DT_DEVICE_LEN; /* for buggy MX-950 remote reporting len in hex */ ++ ++ if (dev_descr_len > dev->descr_len || dev_descr_len < USB_DT_DEVICE_LEN || dev->descr[1] != USB_DT_DEVICE) { ++ fprintf(stderr, "husb: invalid device descriptor\n"); + goto fail; + } + +- i += dev_descr_len; +- while (i < dev->descr_len) { ++ for (i = dev_descr_len; i < dev->descr_len; ) { + DPRINTF("husb: i is %d, descr_len is %d, dl %d, dt %d\n", + i, dev->descr_len, + dev->descr[i], dev->descr[i+1]); + +- if (dev->descr[i+1] != USB_DT_CONFIG) { +- i += dev->descr[i]; +- continue; ++ if (dev->descr[i] < 2) { ++ fprintf(stderr, "husb: invalid descriptor\n"); ++ goto fail; + } +- config_descr_len = dev->descr[i]; ++ if (dev->descr[i+1] == USB_DT_CONFIG) { ++ config_descr_total_len = dev->descr[i+2] + (dev->descr[i+3] << 8); + +- printf("husb: config #%d need %d\n", dev->descr[i + 5], configuration); ++ printf("husb: config #%d need %d\n", dev->descr[i + 5], configuration); + +- if (configuration < 0 || configuration == dev->descr[i + 5]) { +- configuration = dev->descr[i + 5]; +- break; +- } ++ if (configuration < 0 || configuration == dev->descr[i + 5]) { ++ configuration = dev->descr[i + 5]; ++ break; ++ } + +- i += config_descr_len; ++ i += config_descr_total_len; ++ } ++ else ++ i += dev->descr[i]; + } + + if (i >= dev->descr_len) { +-- +1.7.1 + diff --git a/app-emulation/qemu-kvm/qemu-kvm-0.12.5.ebuild b/app-emulation/qemu-kvm/qemu-kvm-0.13.0-r1.ebuild index ee9092d85e04..8c16dd7f526c 100644 --- a/app-emulation/qemu-kvm/qemu-kvm-0.12.5.ebuild +++ b/app-emulation/qemu-kvm/qemu-kvm-0.13.0-r1.ebuild @@ -1,8 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.12.5.ebuild,v 1.3 2010/08/12 08:49:51 dev-zero Exp $ - -#BACKPORTS=2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.13.0-r1.ebuild,v 1.1 2010/11/02 16:29:19 jmbsvicetto Exp $ EAPI="2" @@ -17,8 +15,7 @@ if [[ ${PV} = *9999* ]]; then SRC_URI="" KEYWORDS="" else - SRC_URI="mirror://sourceforge/kvm/${PN}/${P}.tar.gz - ${BACKPORTS:+mirror://gentoo/${P}-backports-${BACKPORTS}.tar.bz2}" + SRC_URI="mirror://sourceforge/kvm/${PN}/${P}.tar.gz" KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" fi @@ -28,8 +25,8 @@ HOMEPAGE="http://www.linux-kvm.org" LICENSE="GPL-2" SLOT="0" # xen is disabled until the deps are fixed -IUSE="+aio alsa bluetooth curl esd gnutls fdt hardened kvm-trace ncurses \ -pulseaudio qemu-ifup sasl sdl static vde" +IUSE="+aio alsa bluetooth brltty curl esd fdt hardened jpeg ncurses \ +png pulseaudio qemu-ifup sasl sdl ssl static vde" COMMON_TARGETS="i386 x86_64 arm cris m68k microblaze mips mipsel ppc ppc64 sh4 sh4eb sparc sparc64" IUSE_SOFTMMU_TARGETS="${COMMON_TARGETS} mips64 mips64el ppcemb" @@ -57,22 +54,26 @@ RDEPEND=" aio? ( dev-libs/libaio ) alsa? ( >=media-libs/alsa-lib-1.0.13 ) bluetooth? ( net-wireless/bluez ) + brltty? ( app-accessibility/brltty ) curl? ( net-misc/curl ) esd? ( media-sound/esound ) fdt? ( sys-apps/dtc ) - gnutls? ( net-libs/gnutls ) + jpeg? ( media-libs/jpeg ) ncurses? ( sys-libs/ncurses ) + png? ( media-libs/libpng ) pulseaudio? ( media-sound/pulseaudio ) qemu-ifup? ( sys-apps/iproute2 net-misc/bridge-utils ) sasl? ( dev-libs/cyrus-sasl ) sdl? ( >=media-libs/libsdl-1.2.11[X] ) + ssl? ( net-libs/gnutls ) vde? ( net-misc/vde ) " DEPEND="${RDEPEND} app-text/texi2html >=sys-kernel/linux-headers-2.6.29 - gnutls? ( dev-util/pkgconfig )" + ssl? ( dev-util/pkgconfig ) +" kvm_kern_warn() { eerror "Please enable KVM support in your kernel, found at:" @@ -83,13 +84,7 @@ kvm_kern_warn() { } pkg_setup() { - - local counter="0" check use qemu_softmmu_targets_x86_64 || ewarn "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64" - for check in ${IUSE_SOFTMMU_TARGETS} ; do - use "qemu_softmmu_targets_${check}" && counter="1" - done - [[ ${counter} == 0 ]] && die "You need to set at least 1 target in QEMU_SOFTMMU_TARGETS" if kernel_is lt 2 6 25; then eerror "This version of KVM requres a host kernel of 2.6.25 or higher." @@ -118,13 +113,11 @@ src_prepare() { # remove part to make udev happy sed -e 's~NAME="%k", ~~' -i kvm/scripts/65-kvm.rules || die - epatch "${FILESDIR}"/qemu-0.11.0-mips64-user-fix.patch \ - "${FILESDIR}"/${PN}-0.12.3-fix-crash-with-sdl.patch \ - "${FILESDIR}"/${PN}-0.12.3-include-madvise-defines.patch - - [[ -n ${BACKPORTS} ]] && \ - EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \ - epatch + # ${PN}-guest-hang-on-usb-add.patch was sent by Timothy Jones + # to the qemu-devel ml - bug 337988 + epatch "${FILESDIR}/qemu-0.11.0-mips64-user-fix.patch" \ + "${FILESDIR}/${PN}-0.12.3-include-madvise-defines.patch" +# "${FILESDIR}/${PN}-guest-hang-on-usb-add.patch" } src_configure() { @@ -140,7 +133,9 @@ src_configure() { user_targets="${user_targets} ${target}-linux-user" done - if [ ! -z "${softmmu_targets}" ]; then + if [ -z "${softmmu_targets}" ]; then + conf_opts="${conf_opts} --disable-system" + else einfo "Building the following softmmu targets: ${softmmu_targets}" fi @@ -157,18 +152,23 @@ src_configure() { # Add support for static builds use static && conf_opts="${conf_opts} --static" + # Fix the $(prefix)/etc issue + conf_opts="${conf_opts} --sysconfdir=/etc" + #config options conf_opts="${conf_opts} $(use_enable aio linux-aio)" - use bluetooth || conf_opts="${conf_opts} --disable-bluez" + conf_opts="${conf_opts} $(use_enable bluetooth bluez)" + conf_opts="${conf_opts} $(use_enable brltty brlapi)" conf_opts="${conf_opts} $(use_enable curl)" - use gnutls || conf_opts="${conf_opts} --disable-vnc-tls" conf_opts="${conf_opts} $(use_enable fdt)" - use hardened && conf_opts="${conf_opts} --enable-user-pie" - use kvm-trace && conf_opts="${conf_opts} --with-kvm-trace" - use ncurses || conf_opts="${conf_opts} --disable-curses" - use sasl || conf_opts="${conf_opts} --disable-vnc-sasl" - use sdl || conf_opts="${conf_opts} --disable-sdl" - use vde || conf_opts="${conf_opts} --disable-vde" + conf_opts="${conf_opts} $(use_enable hardened user-pie)" + conf_opts="${conf_opts} $(use_enable jpeg vnc-jpeg)" + conf_opts="${conf_opts} $(use_enable ncurses curses)" + conf_opts="${conf_opts} $(use_enable png vnc-png)" + conf_opts="${conf_opts} $(use_enable sasl vnc-sasl)" + conf_opts="${conf_opts} $(use_enable sdl)" + conf_opts="${conf_opts} $(use_enable ssl vnc-tls)" + conf_opts="${conf_opts} $(use_enable vde)" # conf_opts="${conf_opts} $(use_enable xen)" conf_opts="${conf_opts} --disable-xen" conf_opts="${conf_opts} --disable-darwin-user --disable-bsd-user" @@ -181,6 +181,7 @@ src_configure() { use sdl && audio_opts="sdl ${audio_opts}" ./configure --prefix=/usr \ --disable-strip \ + --disable-werror \ --enable-kvm \ --enable-nptl \ --enable-uuid \ @@ -195,49 +196,55 @@ src_configure() { # in development and broken # the kvm project has its own support for threaded IO # which is always on and works -# --enable-io-thread \ + # --enable-io-thread \ } src_install() { emake DESTDIR="${D}" install || die "make install failed" - insinto /etc/udev/rules.d/ - doins kvm/scripts/65-kvm.rules || die + if [ ! -z "${softmmu_targets}" ]; then + insinto /etc/udev/rules.d/ + doins kvm/scripts/65-kvm.rules || die + + if use qemu-ifup; then + insinto /etc/qemu/ + insopts -m0755 + doins kvm/scripts/qemu-ifup || die + fi - if use qemu-ifup; then - insinto /etc/qemu/ - insopts -m0755 - doins kvm/scripts/qemu-ifup || die + if use qemu_softmmu_targets_x86_64 ; then + dobin "${FILESDIR}"/qemu-kvm + dosym /usr/bin/qemu-kvm /usr/bin/kvm + else + elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install" + elog "of /usr/bin/qemu-kvm and /usr/bin/kvm" + fi fi dodoc Changelog MAINTAINERS TODO pci-ids.txt || die newdoc pc-bios/README README.pc-bios || die dohtml qemu-doc.html qemu-tech.html || die - - if use qemu_softmmu_targets_x86_64 ; then - dobin "${FILESDIR}"/qemu-kvm - dosym /usr/bin/qemu-kvm /usr/bin/kvm - else - elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install" - elog "of /usr/bin/qemu-kvm and /usr/bin/kvm" - fi } pkg_postinst() { - elog "If you don't have kvm compiled into the kernel, make sure you have" - elog "the kernel module loaded before running kvm. The easiest way to" - elog "ensure that the kernel module is loaded is to load it on boot." - elog "For AMD CPUs the module is called 'kvm-amd'" - elog "For Intel CPUs the module is called 'kvm-intel'" - elog "Please review /etc/conf.d/modules for how to load these" - elog - elog "Make sure your user is in the 'kvm' group" - elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login." - elog - elog "You will need the Universal TUN/TAP driver compiled into your" - elog "kernel or loaded as a module to use the virtual network device" - elog "if using -net tap. You will also need support for 802.1d" - elog "Ethernet Bridging and a configured bridge if using the provided" - elog "kvm-ifup script from /etc/kvm." - echo + + if [ ! -z "${softmmu_targets}" ]; then + elog "If you don't have kvm compiled into the kernel, make sure you have" + elog "the kernel module loaded before running kvm. The easiest way to" + elog "ensure that the kernel module is loaded is to load it on boot." + elog "For AMD CPUs the module is called 'kvm-amd'" + elog "For Intel CPUs the module is called 'kvm-intel'" + elog "Please review /etc/conf.d/modules for how to load these" + elog + elog "Make sure your user is in the 'kvm' group" + elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login." + elog + elog "You will need the Universal TUN/TAP driver compiled into your" + elog "kernel or loaded as a module to use the virtual network device" + elog "if using -net tap. You will also need support for 802.1d" + elog "Ethernet Bridging and a configured bridge if using the provided" + elog "kvm-ifup script from /etc/kvm." + elog + elog "The gnutls use flag was renamed to ssl, so adjust your use flags." + fi } diff --git a/app-emulation/qemu-kvm/qemu-kvm-9999.ebuild b/app-emulation/qemu-kvm/qemu-kvm-9999.ebuild index 82d981713c66..91cb06e1f1f9 100644 --- a/app-emulation/qemu-kvm/qemu-kvm-9999.ebuild +++ b/app-emulation/qemu-kvm/qemu-kvm-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-9999.ebuild,v 1.12 2010/09/06 11:07:09 jmbsvicetto Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-9999.ebuild,v 1.13 2010/11/02 16:29:19 jmbsvicetto Exp $ EAPI="2" @@ -90,8 +90,8 @@ kvm_kern_warn() { } pkg_setup() { - local counter="0" check + use qemu_softmmu_targets_x86_64 || ewarn "You disabled default target QEMU_SOFTMMU_TARGETS=x86_64" for check in ${IUSE_SOFTMMU_TARGETS} ; do use "qemu_softmmu_targets_${check}" && counter="1" @@ -188,6 +188,7 @@ src_configure() { use sdl && audio_opts="sdl ${audio_opts}" ./configure --prefix=/usr \ --disable-strip \ + --disable-werror \ --enable-kvm \ --enable-nptl \ --enable-uuid \ @@ -217,10 +218,6 @@ src_install() { doins kvm/scripts/qemu-ifup || die fi - dodoc Changelog MAINTAINERS TODO pci-ids.txt || die - newdoc pc-bios/README README.pc-bios || die - dohtml qemu-doc.html qemu-tech.html || die - if use qemu_softmmu_targets_x86_64 ; then dobin "${FILESDIR}"/qemu-kvm dosym /usr/bin/qemu-kvm /usr/bin/kvm @@ -228,6 +225,10 @@ src_install() { elog "You disabled QEMU_SOFTMMU_TARGETS=x86_64, this disables install" elog "of /usr/bin/qemu-kvm and /usr/bin/kvm" fi + + dodoc Changelog MAINTAINERS TODO pci-ids.txt || die + newdoc pc-bios/README README.pc-bios || die + dohtml qemu-doc.html qemu-tech.html || die } pkg_postinst() { |