qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: anthony@codemonkey.ws
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 07/16] scsi: Increase the number of possible devices
Date: Tue, 30 Nov 2010 18:58:11 +0100	[thread overview]
Message-ID: <1291139900-20329-8-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1291139900-20329-1-git-send-email-kwolf@redhat.com>

From: Hannes Reinecke <hare@suse.de>

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 <hare@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockdev.h    |    2 +-
 hw/scsi-bus.c |    2 +-
 hw/scsi.h     |    3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/blockdev.h b/blockdev.h
index 2a0559e..4cb8ca9 100644
--- a/blockdev.h
+++ b/blockdev.h
@@ -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);
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 5a3fd4b..74a08b7 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -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;
diff --git a/hw/scsi.h b/hw/scsi.h
index cb06d6d..9c798ae 100644
--- 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,
-- 
1.7.2.3

  parent reply	other threads:[~2010-12-01  4:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-30 17:58 [Qemu-devel] [PULL 00/16] Block patches Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 01/16] scsi-disk: Move active request asserts Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 02/16] Implement drive_del to decouple block removal from device removal Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 03/16] block migration: do not submit multiple AIOs for same sector (v2) Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 04/16] ide: convert bmdma address ioport to ioport_register() Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 05/16] qemu and qemu-xen: support empty write barriers in xen_disk Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 06/16] block: Remove unused s->hd in various drivers Kevin Wolf
2010-11-30 17:58 ` Kevin Wolf [this message]
2010-11-30 17:58 ` [Qemu-devel] [PATCH 08/16] scsi: Return SAM status codes Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 09/16] scsi: INQUIRY VPD fixes Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 10/16] scsi: Move sense handling into the driver Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 11/16] scsi-disk: Remove duplicate cdb parsing Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 12/16] raw-posix: raw_pwrite comment fixup Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 13/16] ide: Factor ide_dma_set_inactive out Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 14/16] ide: Set bus master inactive on error Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 15/16] ide: Ignore double DMA transfer starts/stops Kevin Wolf
2010-11-30 17:58 ` [Qemu-devel] [PATCH 16/16] ide: Reset current_addr after stopping DMA Kevin Wolf
2010-12-06 13:32 ` [Qemu-devel] [PULL 00/16] Block patches Anthony Liguori
2010-12-06 13:41   ` Kevin Wolf
2010-12-06 14:09     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291139900-20329-8-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).