From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWr0y-00022d-6i for qemu-devel@nongnu.org; Mon, 29 Apr 2013 12:33:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWr0w-0003BK-8e for qemu-devel@nongnu.org; Mon, 29 Apr 2013 12:33:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19378) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWr0v-0003B7-VM for qemu-devel@nongnu.org; Mon, 29 Apr 2013 12:33:18 -0400 Message-ID: <517EA0B7.4050503@redhat.com> Date: Mon, 29 Apr 2013 18:32:55 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1367248365-27260-1-git-send-email-fred.konrad@greensocs.com> <1367248365-27260-5-git-send-email-fred.konrad@greensocs.com> <517E9552.5020303@redhat.com> <517E9F94.4010302@greensocs.com> In-Reply-To: <517E9F94.4010302@greensocs.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-1.5 4/4] virtio-scsi: fix the command line compatibility. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?KONRAD_Fr=E9d=E9ric?= 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 18:28, KONRAD Fr=E9d=E9ric ha scritto: >>> >> Could this be simply a qdev property? >=20 > Yes, that can be a good idea. >=20 > What about adding a qdev property bus_name and using it in qbus_realize= ? >=20 > Like this: >=20 > diff --git a/hw/core/qdev.c b/hw/core/qdev.c > index 4eb0134..c5d5407 100644 > --- a/hw/core/qdev.c > +++ b/hw/core/qdev.c > @@ -421,6 +421,13 @@ static void qbus_realize(BusState *bus, DeviceStat= e > *parent, const char *name) >=20 > if (name) { > bus->name =3D g_strdup(name); > + } else if (bus->parent && bus->parent->bus_name) { > + /* parent device has bus_name -> use it for bus name */ > + len =3D strlen(bus->parent->bus_name) + 16; > + buf =3D g_malloc(len); > + snprintf(buf, len, "%s.%d", bus->parent->bus_name, > + bus->parent->num_child_bus); > + bus->name =3D buf; > } else if (bus->parent && bus->parent->id) { > /* parent device has id -> use it for bus name */ > len =3D strlen(bus->parent->id) + 16; >=20 > If so, change to scsi_bus_new is not needed and the two new functions a= re > not needed. >=20 > Is that making sense? Ah, that's a bit more extreme. :) I think I like it, but I need more input. Paolo