diff -ruN xen-unstable.hg/tools/ioemu/hw/pc.c use-scsi/tools/ioemu/hw/pc.c --- xen-unstable.hg/tools/ioemu/hw/pc.c 2007-03-13 09:41:39.000000000 -0500 +++ use-scsi/tools/ioemu/hw/pc.c 2007-04-10 08:20:41.000000000 -0500 @@ -902,7 +902,6 @@ if (pci_enabled && acpi_enabled) { piix4_pm_init(pci_bus, piix3_devfn + 3); } -#endif /* !CONFIG_DM */ #if 0 /* ??? Need to figure out some way for the user to @@ -921,6 +920,17 @@ lsi_scsi_attach(scsi, bdrv, -1); } #endif +#else + if (pci_enabled) { + void *scsi; + + scsi = lsi_scsi_init(pci_bus, -1); + for (i = 0; i < MAX_SCSI_DISKS ; i++) { + if (bs_table[i + MAX_DISKS]) + lsi_scsi_attach(scsi, bs_table[i + MAX_DISKS], -1); + } + } +#endif /* !CONFIG_DM */ /* must be done after all PCI devices are instanciated */ /* XXX: should be done in the Bochs BIOS */ if (pci_enabled) { diff -ruN xen-unstable.hg/tools/ioemu/vl.c use-scsi/tools/ioemu/vl.c --- xen-unstable.hg/tools/ioemu/vl.c 2007-04-10 08:19:42.000000000 -0500 +++ use-scsi/tools/ioemu/vl.c 2007-04-10 08:20:41.000000000 -0500 @@ -116,7 +116,7 @@ void *ioport_opaque[MAX_IOPORTS]; IOPortReadFunc *ioport_read_table[3][MAX_IOPORTS]; IOPortWriteFunc *ioport_write_table[3][MAX_IOPORTS]; -BlockDriverState *bs_table[MAX_DISKS], *fd_table[MAX_FD]; +BlockDriverState *bs_table[MAX_DISKS+MAX_SCSI_DISKS], *fd_table[MAX_FD]; int vga_ram_size; int bios_size; static DisplayState display_state; diff -ruN xen-unstable.hg/tools/ioemu/vl.h use-scsi/tools/ioemu/vl.h --- xen-unstable.hg/tools/ioemu/vl.h 2007-04-10 08:19:42.000000000 -0500 +++ use-scsi/tools/ioemu/vl.h 2007-04-10 08:20:41.000000000 -0500 @@ -818,8 +818,9 @@ /* ide.c */ #define MAX_DISKS 4 +#define MAX_SCSI_DISKS 7 -extern BlockDriverState *bs_table[MAX_DISKS]; +extern BlockDriverState *bs_table[MAX_DISKS+MAX_SCSI_DISKS]; void isa_ide_init(int iobase, int iobase2, int irq, BlockDriverState *hd0, BlockDriverState *hd1); diff -ruN xen-unstable.hg/tools/ioemu/xenstore.c use-scsi/tools/ioemu/xenstore.c --- xen-unstable.hg/tools/ioemu/xenstore.c 2007-04-10 08:19:42.000000000 -0500 +++ use-scsi/tools/ioemu/xenstore.c 2007-04-10 10:46:40.000000000 -0500 @@ -83,7 +83,7 @@ char *buf = NULL, *path; char *fpath = NULL, *bpath = NULL, *dev = NULL, *params = NULL, *type = NULL; - int i; + int i, is_scsi; unsigned int len, num, hd_index; for(i = 0; i < MAX_DISKS; i++) @@ -123,10 +123,15 @@ dev = xs_read(xsh, XBT_NULL, buf, &len); if (dev == NULL) continue; - if (strncmp(dev, "hd", 2) || strlen(dev) != 3) + if (strncmp(dev, "sd", 2)) + is_scsi = 0; + else + is_scsi = 1; + if ((strncmp(dev, "hd", 2) && (is_scsi == 0)) || strlen(dev) != 3 ) continue; hd_index = dev[2] - 'a'; - if (hd_index >= MAX_DISKS) + if ((hd_index >= MAX_DISKS && (is_scsi == 0)) || + (hd_index >= MAX_SCSI_DISKS && (is_scsi == 1))) continue; /* read the type of the device */ if (pasprintf(&buf, "%s/device/vbd/%s/device-type", path, e[i]) == -1) @@ -163,7 +168,10 @@ } } - bs_table[hd_index] = bdrv_new(dev); + if (is_scsi == 0) + bs_table[hd_index] = bdrv_new(dev); + else + bs_table[hd_index + MAX_DISKS] = bdrv_new(dev); /* check if it is a cdrom */ if (type && !strcmp(type, "cdrom")) { bdrv_set_type_hint(bs_table[hd_index], BDRV_TYPE_CDROM); @@ -172,9 +180,16 @@ } /* open device now if media present */ if (params[0]) { - if (bdrv_open(bs_table[hd_index], params, 0 /* snapshot */) < 0) + if ((is_scsi == 0) && + (bdrv_open(bs_table[hd_index], params, 0 /* snapshot */) < 0)) fprintf(stderr, "qemu: could not open hard disk image '%s'\n", params); + else + if ((is_scsi == 1) && + (bdrv_open(bs_table[hd_index + MAX_DISKS], params, + 0 /* snapshot */) < 0)) + fprintf(stderr, "qemu: could not open hard disk image " + "'%s'\n", params); } }