[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/15] add option to remove scsi support
From: |
quintela |
Subject: |
[Qemu-devel] [PATCH 07/15] add option to remove scsi support |
Date: |
Tue, 23 Jun 2009 16:14:05 +0200 |
From: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
Makefile | 6 ++++--
Makefile.hw | 3 ++-
configure | 9 +++++++++
hw/pc.c | 2 ++
hw/pci-hotplug.c | 9 ++++++++-
hw/pci.h | 2 ++
vl.c | 2 ++
7 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index c4b41c4..3fd0ef5 100644
--- a/Makefile
+++ b/Makefile
@@ -100,8 +100,10 @@ OBJS+=irq.o ptimer.o
OBJS+=i2c.o smbus.o smbus_eeprom.o max7310.o max111x.o wm8750.o
OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o twl92230.o
OBJS+=tmp105.o lm832x.o eeprom93xx.o tsc2005.o
-OBJS+=scsi-disk.o cdrom.o
-OBJS+=scsi-generic.o
+OBJS+=cdrom.o
+ifdef CONFIG_SCSI
+OBJS+=scsi-disk.o scsi-generic.o
+endif
ifdef CONFIG_USB
OBJS+=usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-msd.o usb-wacom.o
OBJS+=usb-serial.o usb-net.o
diff --git a/Makefile.hw b/Makefile.hw
index 6accb3b..57a0ed6 100644
--- a/Makefile.hw
+++ b/Makefile.hw
@@ -23,8 +23,9 @@ OBJS+= nand.o ecc.o
OBJS+= m48t59.o escc.o
-# SCSI layer
+ifdef CONFIG_SCSI
OBJS+= lsi53c895a.o esp.o
+endif
OBJS+= dma-helpers.o sysbus.o
diff --git a/configure b/configure
index 93823cb..4a1fb45 100755
--- a/configure
+++ b/configure
@@ -193,6 +193,7 @@ bluez="yes"
kvm="no"
usb="yes"
smb="yes"
+scsi="yes"
kerneldir=""
aix="no"
blobs="yes"
@@ -442,6 +443,8 @@ for opt do
;;
--disable-smb) smb="no"
;;
+ --disable-scsi) scsi="no"
+ ;;
--disable-kvm) kvm="no"
;;
--enable-profiler) profiler="yes"
@@ -635,6 +638,7 @@ echo " --disable-curl disable curl connectivity"
echo " --disable-bluez disable bluez stack connectivity"
echo " --disable-usb disable usb stack connectivity"
echo " --disable-smb disable smb directories support"
+echo " --disable-scsi disable scsi support"
echo " --disable-kvm disable KVM acceleration support"
echo " --disable-nptl disable usermode NPTL support"
echo " --enable-system enable all system emulation targets"
@@ -1460,6 +1464,7 @@ echo "preadv support $preadv"
echo "bluetooth support $bluez"
echo "usb support $usb"
echo "smb directories $smb"
+echo "scsi support $scsi"
if test $sdl_too_old = "yes"; then
echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1785,6 +1790,10 @@ fi
if test "$smb" = "yes" ; then
echo "#define CONFIG_SMB 1" >> $config_h
fi
+if test "$scsi" = "yes" ; then
+ echo "#define CONFIG_SCSI 1" >> $config_h
+ echo "CONFIG_SCSI=yes" >> $config_mak
+fi
if test "$aio" = "yes" ; then
echo "#define CONFIG_AIO 1" >> $config_h
echo "CONFIG_AIO=yes" >> $config_mak
diff --git a/hw/pc.c b/hw/pc.c
index 7e2ff41..ee0e07f 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1144,6 +1144,7 @@ static void pc_init1(ram_addr_t ram_size,
i440fx_init_memory_mappings(i440fx_state);
}
+#ifdef CONFIG_SCSI
if (pci_enabled) {
int max_bus;
int bus;
@@ -1153,6 +1154,7 @@ static void pc_init1(ram_addr_t ram_size,
pci_create_simple(pci_bus, -1, "lsi53c895a");
}
}
+#endif
/* Add virtio block devices */
if (pci_enabled) {
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index 952e27a..677f494 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -78,11 +78,13 @@ void drive_hot_add(Monitor *mon, const char *pci_addr,
const char *opts)
bus = drive_get_max_bus (type);
switch (type) {
+#ifdef CONFIG_SCSI
case IF_SCSI:
success = 1;
lsi_scsi_attach(&dev->qdev, drives_table[drive_idx].bdrv,
drives_table[drive_idx].unit);
break;
+#endif
default:
monitor_printf(mon, "Can't hot-add drive to type %d\n", type);
}
@@ -103,9 +105,12 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
char buf[128];
if (get_param_value(buf, sizeof(buf), "if", opts)) {
+#ifdef CONFIG_SCSI
if (!strcmp(buf, "scsi"))
type = IF_SCSI;
- else if (!strcmp(buf, "virtio")) {
+ else
+#endif
+ if (!strcmp(buf, "virtio")) {
type = IF_VIRTIO;
} else {
monitor_printf(mon, "type %s not a hotpluggable PCI device.\n",
buf);
@@ -130,9 +135,11 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
}
switch (type) {
+#ifdef CONFIG_SCSI
case IF_SCSI:
dev = pci_create("lsi53c895a", devaddr);
break;
+#endif
case IF_VIRTIO:
dev = pci_create("virtio-blk-pci", devaddr);
break;
diff --git a/hw/pci.h b/hw/pci.h
index c8625de..317dc70 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -222,9 +222,11 @@ void pci_qdev_register(const char *name, int size,
pci_qdev_initfn init);
PCIDevice *pci_create(const char *name, const char *devaddr);
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name);
+#ifdef CONFIG_SCSI
/* lsi53c895a.c */
#define LSI_MAX_DEVS 7
void lsi_scsi_attach(DeviceState *host, BlockDriverState *bd, int id);
+#endif
/* vmware_vga.c */
void pci_vmsvga_init(PCIBus *bus);
diff --git a/vl.c b/vl.c
index 830ffa3..b3cd8d9 100644
--- a/vl.c
+++ b/vl.c
@@ -2271,9 +2271,11 @@ int drive_init(struct drive_opt *arg, int snapshot, void
*opaque)
if (!strcmp(buf, "ide")) {
type = IF_IDE;
max_devs = MAX_IDE_DEVS;
+#ifdef CONFIG_SCSI
} else if (!strcmp(buf, "scsi")) {
type = IF_SCSI;
max_devs = MAX_SCSI_DEVS;
+#endif
} else if (!strcmp(buf, "floppy")) {
type = IF_FLOPPY;
max_devs = 0;
--
1.6.2.2
- [Qemu-devel] [RFC PATCH 00/15] Be able to compile out not needed options, quintela, 2009/06/23
- [Qemu-devel] [PATCH 01/15] Only compile-in selected audio drivers, quintela, 2009/06/23
- [Qemu-devel] [PATCH 03/15] rename usb variable to usb host, quintela, 2009/06/23
- [Qemu-devel] [PATCH 04/15] protect with CONFIG_BRLAPI, quintela, 2009/06/23
- [Qemu-devel] [PATCH 02/15] Make --disable-bluez to really remove bluetooth support, quintela, 2009/06/23
- [Qemu-devel] [PATCH 05/15] Make --disable-usb to really remove usb support, quintela, 2009/06/23
- [Qemu-devel] [PATCH 07/15] add option to remove scsi support,
quintela <=
- [Qemu-devel] [PATCH 06/15] Add --disable-smb to remove smb directories support, quintela, 2009/06/23
- [Qemu-devel] [PATCH 08/15] add option to disable wmware devices, quintela, 2009/06/23
- [Qemu-devel] [PATCH 09/15] ssi bus is only used on the arm platform, quintela, 2009/06/23
- [Qemu-devel] [PATCH 11/15] sd flash is only used in arm devices, quintela, 2009/06/23
- [Qemu-devel] [PATCH 10/15] move i2c devices only used in arm devices to arm target, quintela, 2009/06/23