From b9484c255a1252e56b1a8332a1c6572635cca393 Mon Sep 17 00:00:00 2001 From: Juan Quintela <quintela@redhat.com> Date: Tue, 21 Jul 2009 22:27:12 +0200 Subject: [PATCH 08/16] add option to disable usb net Signed-off-by: Juan Quintela <quintela@redhat.com> Message-Id: <16a6da09d336f7e74039a87e5fcaf6b0dbcea80b.1248207932.git.quintela@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Bugzilla: 512837 Message-Id: <a42c9417d705ba051ebfa907a8c7a6311300c9dd.1248095798.git.quintela@redhat.com> Acked-by: "Daniel P. Berrange" <berrange@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> RH-Upstream-status: pending Acked-by: Luiz Capitulino <lcapitulino@redhat.com> (conditional on feature unwanted) --- qemu/Makefile | 2 ++ qemu/configure | 8 ++++++++ qemu/vl.c | 5 ++++- 3 files changed, 14 insertions(+), 1 deletions(-) diff --git a/qemu/Makefile b/qemu/Makefile index 9edf461..acf0914 100644 --- a/qemu/Makefile +++ b/qemu/Makefile @@ -93,7 +93,9 @@ endif ifdef CONFIG_USB_SERIAL OBJS+=usb-serial.o endif +ifdef CONFIG_USB_NET OBJS+=usb-net.o +endif 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 169ffea..353a3e7 100755 --- a/qemu/configure +++ b/qemu/configure @@ -180,6 +180,7 @@ isapc="yes" usb_msd="yes" usb_wacom="yes" usb_serial="yes" +usb_net="yes" kvm="yes" kvm_nested="no" kvm_cap_pit="no" @@ -428,6 +429,8 @@ for opt do ;; --disable-usb-serial) usb_serial="no" ;; + --disable-usb-net) usb_net="no" + ;; --disable-kvm) kvm="no" ;; --enable-profiler) profiler="yes" @@ -1322,6 +1325,7 @@ echo "KVM nested $kvm_nested" echo "USB storage $usb_msd" echo "USB wacom $usb_wacom" echo "USB serial $usb_serial" +echo "USB net $usb_net" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -1633,6 +1637,10 @@ if test "$usb_serial" = "yes" ; then echo "CONFIG_USB_SERIAL=yes" >> $config_mak echo "#define CONFIG_USB_SERIAL 1" >> $config_h fi +if test "$usb_net" = "yes" ; then + echo "CONFIG_USB_NET=yes" >> $config_mak + echo "#define CONFIG_USB_NET 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 53f35a3..6107066 100644 --- a/qemu/vl.c +++ b/qemu/vl.c @@ -2822,6 +2822,7 @@ static int usb_device_add(const char *devname) dev = usb_baum_init(); } else #endif +#ifdef CONFIG_USB_NET if (strstart(devname, "net:", &p)) { int nic = nb_nics; @@ -2829,7 +2830,9 @@ static int usb_device_add(const char *devname) return -1; nd_table[nic].model = "usb"; dev = usb_net_init(&nd_table[nic]); - } else if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) { + } else +#endif + if (!strcmp(devname, "bt") || strstart(devname, "bt:", &p)) { dev = usb_bt_init(devname[2] ? hci_init(p) : bt_new_hci(qemu_find_bt_vlan(0))); } else { -- 1.6.3.rc4.29.g8146