]> Git Repo - qemu.git/commitdiff
scsi: Increase the number of possible devices
authorHannes Reinecke <[email protected]>
Wed, 24 Nov 2010 11:15:56 +0000 (12:15 +0100)
committerKevin Wolf <[email protected]>
Thu, 25 Nov 2010 10:57:32 +0000 (11:57 +0100)
The SCSI parallel interface has a limit of 8 devices, but
not the SCSI stack in general. So we should be removing the
hard-coded limit and use MAX_SCSI_DEVS instead.
And we only need to scan those devices which are allocated
by the bus.

Signed-off-by: Hannes Reinecke <[email protected]>
Acked-by: Christoph Hellwig <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
blockdev.h
hw/scsi-bus.c
hw/scsi.h

index 2a0559ef6516585f2383863cce1c8131cbbb53d8..4cb8ca93d419709175648e4e765b84d4c8957c89 100644 (file)
@@ -32,7 +32,7 @@ struct DriveInfo {
 };
 
 #define MAX_IDE_DEVS   2
-#define MAX_SCSI_DEVS  7
+#define MAX_SCSI_DEVS  255
 
 DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
 int drive_get_max_bus(BlockInterfaceType type);
index 5a3fd4b7acd615895fede26b447bef5a5365be81..74a08b7da648efaa8e088ab6d2acce5d47b8f8fc 100644 (file)
@@ -108,7 +108,7 @@ int scsi_bus_legacy_handle_cmdline(SCSIBus *bus)
     int res = 0, unit;
 
     loc_push_none(&loc);
-    for (unit = 0; unit < MAX_SCSI_DEVS; unit++) {
+    for (unit = 0; unit < bus->ndev; unit++) {
         dinfo = drive_get(IF_SCSI, bus->busnr, unit);
         if (dinfo == NULL) {
             continue;
index cb06d6d8246f1cb26434143802c915d767f2a9fc..9c798ae795912773700f3ac15062c817c465e54b 100644 (file)
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -3,6 +3,7 @@
 
 #include "qdev.h"
 #include "block.h"
+#include "blockdev.h"
 #include "block_int.h"
 
 #define SCSI_CMD_BUF_SIZE     16
@@ -86,7 +87,7 @@ struct SCSIBus {
     int tcq, ndev;
     scsi_completionfn complete;
 
-    SCSIDevice *devs[8];
+    SCSIDevice *devs[MAX_SCSI_DEVS];
 };
 
 void scsi_bus_new(SCSIBus *bus, DeviceState *host, int tcq, int ndev,
This page took 0.02835 seconds and 4 git commands to generate.