Skip to contentSkip to conversation

SCSI disks in FullVirt Domains

PATCH In review Natasha Jarymowycz 2 participants 2 messages Mar 14, 2007 – Apr 5, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SCSI disks in FullVirt Domains

This patch provides the use of SCSI disks in HVM domains. Currently there is a maximum of 7 scsi disks and an ide disk must still be used to boot.

tools/ioemu/hw/pc.c +11 -1
diff -ruN xen-unstable.hg/tools/ioemu/hw/pc.c patched/tools/ioemu/hw/pc.c
@@ -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) {
tools/ioemu/vl.c +1 -1
diff -ruN xen-unstable.hg/tools/ioemu/vl.c patched/tools/ioemu/vl.c
@@ -115,7 +115,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;
tools/ioemu/vl.h +2 -1
diff -ruN xen-unstable.hg/tools/ioemu/vl.h patched/tools/ioemu/vl.h
@@ -833,8 +833,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);
tools/ioemu/xenstore.c +45 -8

111 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Natasha Jarymowycz

This patch provides the use of SCSI disks in HVM domains. Currently there is a maximum of 7 scsi disks and an ide disk must still be used to boot.

Sorry for sitting on this one so long. It now doesn't apply (other big-ish changes to xenstore.c have happened). Could you re-base and re-test?

Thanks,
Keir