Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 3160499aacb81f6735941eb4c372d87a > files > 217

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

From de9495191a1b554425307cae41e013f410a850fb Mon Sep 17 00:00:00 2001
From: Juan Quintela <quintela@redhat.com>
Date: Tue, 21 Jul 2009 22:27:11 +0200
Subject: [PATCH 07/16] add option to disable usb serial

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <d5f2fb3889878133354dd78019be3998830e109e.1248207932.git.quintela@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Bugzilla: 512837
Obsoletes: <a542be03f85a8a9432c653c36cfe973b1608763b.1248095797.git.quintela@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
Acked-by: Luiz Capitulino <lcapitulino@redhat.com> (conditional on feature unwanted)
RH-Upstream-status: pending
Acked-by: "Daniel P. Berrange" <berrange@redhat.com>
---
 qemu/Makefile  |    5 ++++-
 qemu/configure |    9 +++++++++
 qemu/vl.c      |   10 +++++++---
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/qemu/Makefile b/qemu/Makefile
index 8fd84ad..9edf461 100644
--- a/qemu/Makefile
+++ b/qemu/Makefile
@@ -90,7 +90,10 @@ endif
 ifdef CONFIG_USB_WACOM
 OBJS+=usb-wacom.o
 endif
-OBJS+=usb-serial.o usb-net.o
+ifdef CONFIG_USB_SERIAL
+OBJS+=usb-serial.o
+endif
+OBJS+=usb-net.o
 OBJS+=sd.o ssi-sd.o
 OBJS+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o
 OBJS+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o
diff --git a/qemu/configure b/qemu/configure
index 9a19a53..169ffea 100755
--- a/qemu/configure
+++ b/qemu/configure
@@ -179,6 +179,7 @@ scsi="yes"
 isapc="yes"
 usb_msd="yes"
 usb_wacom="yes"
+usb_serial="yes"
 kvm="yes"
 kvm_nested="no"
 kvm_cap_pit="no"
@@ -425,6 +426,8 @@ for opt do
   ;;
   --disable-usb-wacom) usb_wacom="no"
   ;;
+  --disable-usb-serial) usb_serial="no"
+  ;;
   --disable-kvm) kvm="no"
   ;;
   --enable-profiler) profiler="yes"
@@ -582,6 +585,7 @@ echo "  --disable-scsi           disable scsi devices"
 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-kvm            disable KVM acceleration support"
 echo "  --disable-nptl           disable usermode NPTL support"
 echo "  --enable-system          enable all system emulation targets"
@@ -1317,6 +1321,7 @@ echo "ISAPC support     $isapc"
 echo "KVM nested        $kvm_nested"
 echo "USB storage       $usb_msd"
 echo "USB wacom         $usb_wacom"
+echo "USB serial        $usb_serial"
 
 if test $sdl_too_old = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1624,6 +1629,10 @@ if test "$usb_wacom" = "yes" ; then
   echo "CONFIG_USB_WACOM=yes" >> $config_mak
   echo "#define CONFIG_USB_WACOM 1" >> $config_h
 fi
+if test "$usb_serial" = "yes" ; then
+  echo "CONFIG_USB_SERIAL=yes" >> $config_mak
+  echo "#define CONFIG_USB_SERIAL 1" >> $config_h
+fi
 if test "$aio" = "yes" ; then
   echo "#define CONFIG_AIO 1" >> $config_h
   echo "CONFIG_AIO=yes" >> $config_mak
diff --git a/qemu/vl.c b/qemu/vl.c
index 90e0856..53f35a3 100644
--- a/qemu/vl.c
+++ b/qemu/vl.c
@@ -2812,13 +2812,17 @@ static int usb_device_add(const char *devname)
         dev = usb_wacom_init();
     } else
 #endif
-   if (strstart(devname, "serial:", &p)) {
+#ifdef CONFIG_USB_SERIAL
+    if (strstart(devname, "serial:", &p)) {
         dev = usb_serial_init(p);
+    } else
+#endif
 #ifdef CONFIG_BRLAPI
-    } else if (!strcmp(devname, "braille")) {
+    if (!strcmp(devname, "braille")) {
         dev = usb_baum_init();
+    } else
 #endif
-    } else if (strstart(devname, "net:", &p)) {
+    if (strstart(devname, "net:", &p)) {
         int nic = nb_nics;
 
         if (net_client_init("nic", p) < 0)
-- 
1.6.3.rc4.29.g8146