提交 622b520f 编写于 作者: H Hannes Reinecke 提交者: Kevin Wolf

scsi: Increase the number of possible devices

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: NHannes Reinecke <hare@suse.de>
Acked-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 80465c50
...@@ -32,7 +32,7 @@ struct DriveInfo { ...@@ -32,7 +32,7 @@ struct DriveInfo {
}; };
#define MAX_IDE_DEVS 2 #define MAX_IDE_DEVS 2
#define MAX_SCSI_DEVS 7 #define MAX_SCSI_DEVS 255
DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit); DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
int drive_get_max_bus(BlockInterfaceType type); int drive_get_max_bus(BlockInterfaceType type);
......
...@@ -108,7 +108,7 @@ int scsi_bus_legacy_handle_cmdline(SCSIBus *bus) ...@@ -108,7 +108,7 @@ int scsi_bus_legacy_handle_cmdline(SCSIBus *bus)
int res = 0, unit; int res = 0, unit;
loc_push_none(&loc); 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); dinfo = drive_get(IF_SCSI, bus->busnr, unit);
if (dinfo == NULL) { if (dinfo == NULL) {
continue; continue;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "qdev.h" #include "qdev.h"
#include "block.h" #include "block.h"
#include "blockdev.h"
#include "block_int.h" #include "block_int.h"
#define SCSI_CMD_BUF_SIZE 16 #define SCSI_CMD_BUF_SIZE 16
...@@ -86,7 +87,7 @@ struct SCSIBus { ...@@ -86,7 +87,7 @@ struct SCSIBus {
int tcq, ndev; int tcq, ndev;
scsi_completionfn complete; scsi_completionfn complete;
SCSIDevice *devs[8]; SCSIDevice *devs[MAX_SCSI_DEVS];
}; };
void scsi_bus_new(SCSIBus *bus, DeviceState *host, int tcq, int ndev, void scsi_bus_new(SCSIBus *bus, DeviceState *host, int tcq, int ndev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册