Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > aadbe78a25743146bb784eee19f007c5 > files > 216

kvm-83-164.el5_5.9.src.rpm

From 80c905ca92360ab83f74d5ee41fe2078cba4781a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Tue, 28 Jul 2009 17:29:47 -0300
Subject: [PATCH 12/16] add option to disable vmware drivers

On Mon, Jul 20, 2009 at 03:33:15PM +0200, quintela@redhat.com wrote:
> From: Juan Quintela <quintela@redhat.com>
>
>
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
<snip>
> @@ -1343,6 +1347,7 @@ echo "USB serial        $usb_serial"
>  echo "USB net           $usb_net"
>  echo "USB bluez         $usb_bluez"
>  echo "USB host          $usb_host"
> +echo "VMware drivers    $vmware"
>  echo "Only generic cpus $x86_only_generic_cpus"
>
>  if test $sdl_too_old = "yes"; then
> @@ -1670,6 +1675,10 @@ if test "$usb_host" = "yes" ; then
>    echo "CONFIG_USB_HOST=yes" >> $config_mak
>    echo "#define CONFIG_USB_HOST 1" >> $config_h
>  fi
> +if test "$usb_host" = "yes" ; then

$usb_host?  :)

Updated patch below. Please ACK.

***NOTE: ACKing this patch implies ACKing the addition of
--disable-vmware to the configure line on the kvm package.

>From 07f497d105f71abdcc82ee897679816b4056b727 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Tue, 21 Jul 2009 22:27:17 +0200
Subject: [PATCH] add option to disable vmware drivers

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Obsoletes: <0818eefafd05b722d813bb56adb6f8d94188f166.1248207932.git.quintela@redhat.com>
Obsoletes: <1df390ae2bab8b5447a4d02068afa6b4c9971850.1248095798.git.quintela@redhat.com>
Bugzilla: 512837
RH-Upstream-status: pending
Message-ID: <20090728202947.GR18848@blackpad.lan.raisama.net>
Acked-by: Juan Quintela <quintela@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Acked-by: "Daniel P. Berrange" <berrange@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
---
 qemu/Makefile.target |    5 ++++-
 qemu/configure       |    9 +++++++++
 qemu/hw/pc.c         |    4 ++++
 qemu/hw/pckbd.c      |    4 ++--
 qemu/vl.c            |    2 ++
 5 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/qemu/Makefile.target b/qemu/Makefile.target
index f517023..bdc989c 100644
--- a/qemu/Makefile.target
+++ b/qemu/Makefile.target
@@ -717,7 +717,10 @@ ifeq ($(TARGET_BASE_ARCH), i386)
 OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o
 OBJS+= fdc.o mc146818rtc.o serial.o i8259.o i8254.o pcspk.o pc.o
 OBJS+= cirrus_vga.o apic.o parallel.o acpi.o piix_pci.o
-OBJS+= usb-uhci.o vmmouse.o vmport.o vmware_vga.o hpet.o smbios.o
+OBJS+= usb-uhci.o hpet.o smbios.o
+ifdef CONFIG_VMWARE
+OBJS+= vmmouse.o vmport.o vmware_vga.o
+endif
 OBJS+= extboot.o
 # virtio support
 OBJS+= virtio.o virtio-blk.o virtio-balloon.o
diff --git a/qemu/configure b/qemu/configure
index a980871..1a66745 100755
--- a/qemu/configure
+++ b/qemu/configure
@@ -182,6 +182,7 @@ usb_wacom="yes"
 usb_serial="yes"
 usb_net="yes"
 usb_bluez="yes"
+vmware="yes"
 x86_only_generic_cpus="no"
 kvm="yes"
 kvm_nested="no"
@@ -435,6 +436,8 @@ for opt do
   ;;
   --disable-usb-bluez) usb_bluez="no"
   ;;
+  --disable-vmware) vmware="no"
+  ;;
   --disable-x86-non-generic-cpus) x86_only_generic_cpus="yes"
   ;;
   --disable-kvm) kvm="no"
@@ -595,6 +598,7 @@ echo "  --disable-isapc          disable isapc machine"
 echo "  --disable-usb-msd        disable usb storage devices"
 echo "  --disable-usb-wacom      disable usb wacom tablets"
 echo "  --disable-usb-serial     disable usb serial"
+echo "  --disable-vmware         disable vmware drivers"
 echo "  --disable-kvm            disable KVM acceleration support"
 echo "  --disable-nptl           disable usermode NPTL support"
 echo "  --enable-system          enable all system emulation targets"
@@ -1333,6 +1337,7 @@ echo "USB wacom         $usb_wacom"
 echo "USB serial        $usb_serial"
 echo "USB net           $usb_net"
 echo "USB bluez         $usb_bluez"
+echo "VMware drivers    $vmware"
 echo "Only generic cpus $x86_only_generic_cpus"
 
 if test $sdl_too_old = "yes"; then
@@ -1653,6 +1658,10 @@ if test "$usb_bluez" = "yes" ; then
   echo "CONFIG_USB_BLUEZ=yes" >> $config_mak
   echo "#define CONFIG_USB_BLUEZ 1" >> $config_h
 fi
+if test "$vmware" = "yes" ; then
+  echo "CONFIG_VMWARE=yes" >> $config_mak
+  echo "#define CONFIG_VMWARE 1" >> $config_h
+fi
 if test "$x86_only_generic_cpus" = "yes" ; then
   echo "#define CONFIG_X86_ONLY_GENERIC_CPUS 1" >> $config_h
 fi
diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c
index d901527..f87fa22 100644
--- a/qemu/hw/pc.c
+++ b/qemu/hw/pc.c
@@ -862,7 +862,9 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
 	env = pc_new_cpu(i, cpu_model, pci_enabled);
     }
 
+#ifdef CONFIG_VMWARE
     vmport_init();
+#endif
 
     /* allocate RAM */
     ram_addr = qemu_ram_alloc(0xa0000);
@@ -1040,12 +1042,14 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
             qxl_init(pci_bus, phys_ram_base + qxl_ram, qxl_ram, qxl_total_mem_size, qxl_ram_size);
         }
 #endif
+#ifdef CONFIG_VMWARE
     } else if (vmsvga_enabled) {
         if (pci_enabled)
             pci_vmsvga_init(pci_bus, ds, phys_ram_base + vga_ram_addr,
                             vga_ram_addr, vga_ram_size);
         else
             fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
+#endif
     } else {
         if (pci_enabled) {
             pci_vga_init(pci_bus, ds, phys_ram_base + vga_ram_addr,
diff --git a/qemu/hw/pckbd.c b/qemu/hw/pckbd.c
index 3a004f7..a8a0a3b 100644
--- a/qemu/hw/pckbd.c
+++ b/qemu/hw/pckbd.c
@@ -380,7 +380,7 @@ void i8042_init(qemu_irq kbd_irq, qemu_irq mouse_irq, uint32_t io_base)
 
     s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
     s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);
-#ifdef TARGET_I386
+#if defined(TARGET_I386) && defined(CONFIG_VMWARE)
     vmmouse_init(s->mouse);
 #endif
     qemu_register_reset(kbd_reset, s);
@@ -437,7 +437,7 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
 
     s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
     s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);
-#ifdef TARGET_I386
+#if defined(TARGET_I386) && defined(CONFIG_VMWARE)
     vmmouse_init(s->mouse);
 #endif
     qemu_register_reset(kbd_reset, s);
diff --git a/qemu/vl.c b/qemu/vl.c
index d3733f6..00e58ff 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -4831,9 +4831,11 @@ static void select_vgahw (const char *p)
     } else if (strstart(p, "cirrus", &opts)) {
         cirrus_vga_enabled = 1;
         vmsvga_enabled = 0;
+#ifdef CONFIG_VMWARE
     } else if (strstart(p, "vmware", &opts)) {
         cirrus_vga_enabled = 0;
         vmsvga_enabled = 1;
+#endif
     } else {
     invalid_vga:
         fprintf(stderr, "Unknown vga type: %s\n", p);
-- 
1.6.3.rc4.29.g8146