From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWqCS-0000bF-O1 for qemu-devel@nongnu.org; Mon, 29 Apr 2013 11:41:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWqCR-0001r7-Dl for qemu-devel@nongnu.org; Mon, 29 Apr 2013 11:41:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWqCR-0001qx-3n for qemu-devel@nongnu.org; Mon, 29 Apr 2013 11:41:07 -0400 Message-ID: <517E947C.1010001@redhat.com> Date: Mon, 29 Apr 2013 17:40:44 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1367248365-27260-1-git-send-email-fred.konrad@greensocs.com> <1367248365-27260-4-git-send-email-fred.konrad@greensocs.com> In-Reply-To: <1367248365-27260-4-git-send-email-fred.konrad@greensocs.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-1.5 3/4] scsi: add scsi_named_bus_new(). List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fred.konrad@greensocs.com Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, agraf@suse.de, amit.shah@redhat.com, cornelia.huck@de.ibm.com, afaerber@suse.de Il 29/04/2013 17:12, fred.konrad@greensocs.com ha scritto: > From: KONRAD Frederic > > This add the possibility to create a scsi-bus with a specified name. > > Signed-off-by: KONRAD Frederic > --- > 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 > +/* 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) > { >