qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-1.5 3/4] scsi: add scsi_named_bus_new().


From: KONRAD Frédéric
Subject: Re: [Qemu-devel] [PATCH for-1.5 3/4] scsi: add scsi_named_bus_new().
Date: Mon, 29 Apr 2013 18:15:35 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 29/04/2013 17:40, Paolo Bonzini wrote:
Il 29/04/2013 17:12, address@hidden ha scritto:
From: KONRAD Frederic <address@hidden>

This add the possibility to create a scsi-bus with a specified name.

Signed-off-by: KONRAD Frederic <address@hidden>
---
  hw/scsi/scsi-bus.c     | 12 +++++++++---
  include/hw/scsi/scsi.h |  2 ++
  2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 6239ee1..0364749 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -71,15 +71,21 @@ static void scsi_device_unit_attention_reported(SCSIDevice 
*s)
      }
  }
-/* Create a scsi bus, and attach devices to it. */
-void scsi_bus_new(SCSIBus *bus, DeviceState *host, const SCSIBusInfo *info)
+void scsi_named_bus_new(SCSIBus *bus, DeviceState *host,
+                        const SCSIBusInfo *info, const char *bus_name)
  {
-    qbus_create_inplace(&bus->qbus, TYPE_SCSI_BUS, host, NULL);
+    qbus_create_inplace(&bus->qbus, TYPE_SCSI_BUS, host, bus_name);
      bus->busnr = next_scsi_bus++;
      bus->info = info;
      bus->qbus.allow_hotplug = 1;
  }
I'd prefer that you just add the argument to scsi_bus_new and change all
callers.

Paolo

Ok, will do.

+/* Create a scsi bus, and attach devices to it.  */
+void scsi_bus_new(SCSIBus *bus, DeviceState *host, const SCSIBusInfo *info)
+{
+    scsi_named_bus_new(bus, host, info, NULL);
+}
+
  static void scsi_dma_restart_bh(void *opaque)
  {
      SCSIDevice *s = opaque;
diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h
index 3bda1c4..ddcb07c 100644
--- a/include/hw/scsi/scsi.h
+++ b/include/hw/scsi/scsi.h
@@ -153,6 +153,8 @@ struct SCSIBus {
  };
void scsi_bus_new(SCSIBus *bus, DeviceState *host, const SCSIBusInfo *info);
+void scsi_named_bus_new(SCSIBus *bus, DeviceState *host,
+                        const SCSIBusInfo *info, const char *bus_name);
static inline SCSIBus *scsi_bus_from_device(SCSIDevice *d)
  {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]