From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud1Qz-0001ZC-S8 for qemu-devel@nongnu.org; Thu, 16 May 2013 12:53:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ud1Qy-0007CI-28 for qemu-devel@nongnu.org; Thu, 16 May 2013 12:53:41 -0400 Received: from [2001:41d0:8:2b42::1] (port=42157 helo=ns232118.ovh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ud1Qx-0007CD-Nm for qemu-devel@nongnu.org; Thu, 16 May 2013 12:53:39 -0400 Message-ID: <51950F0C.2090802@greensocs.com> Date: Thu, 16 May 2013 18:53:32 +0200 From: =?ISO-8859-1?Q?KONRAD_Fr=E9d=E9ric?= MIME-Version: 1.0 References: <1368662027-14213-1-git-send-email-aliguori@us.ibm.com> <20130516142151.GC23880@vm> <5194F279.30200@redhat.com> <51950139.5000209@greensocs.com> <51950430.9030107@redhat.com> <51950A81.8050703@greensocs.com> <20130516164932.GB2441@vm> In-Reply-To: <20130516164932.GB2441@vm> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [ANNOUNCE] QEMU 1.5.0-rc2 is now available List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mdroth Cc: Paolo Bonzini , Anthony Liguori , qemu-devel@nongnu.org On 16/05/2013 18:49, mdroth wrote: > On Thu, May 16, 2013 at 06:34:09PM +0200, KONRAD Fr=E9d=E9ric wrote: >> On 16/05/2013 18:07, Paolo Bonzini wrote: >>> Il 16/05/2013 17:54, KONRAD Fr=E9d=E9ric ha scritto: >>>> I think this can do the job, any better idea? >>>> >>>> diff --git a/hw/pci/pci.c b/hw/pci/pci.c >>>> index d5257ed..e033b53 100644 >>>> --- a/hw/pci/pci.c >>>> +++ b/hw/pci/pci.c >>>> @@ -43,7 +43,6 @@ >>>> #endif >>>> >>>> static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int i= ndent); >>>> -static char *pcibus_get_dev_path(DeviceState *dev); >>>> static char *pcibus_get_fw_dev_path(DeviceState *dev); >>>> static int pcibus_reset(BusState *qbus); >>>> >>>> @@ -2129,7 +2128,7 @@ static char *pcibus_get_fw_dev_path(DeviceStat= e *dev) >>>> return g_strdup(path); >>>> } >>>> >>>> -static char *pcibus_get_dev_path(DeviceState *dev) >>>> +char *pcibus_get_dev_path(DeviceState *dev) >>>> { >>>> PCIDevice *d =3D container_of(dev, PCIDevice, qdev); >>>> PCIDevice *t; >>>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c >>>> index 70d2c6b..0241223 100644 >>>> --- a/hw/virtio/virtio-pci.c >>>> +++ b/hw/virtio/virtio-pci.c >>>> @@ -1514,11 +1514,19 @@ static void virtio_pci_bus_new(VirtioBusStat= e >>>> *bus, VirtIOPCIProxy *dev) >>>> qbus->allow_hotplug =3D 1; >>>> } >>>> >>>> +static char *virtio_pci_bus_get_dev_path(DeviceState *dev) >>>> +{ >>>> + BusState *bus =3D qdev_get_parent_bus(dev); >>>> + DeviceState *proxy =3D DEVICE(bus->parent); >>>> + return g_strdup(pcibus_get_dev_path(proxy)); >>> You do not need to export pcibus_get_dev_path. This should just retu= rn >>> qdev_get_dev_path(proxy) and should be in TYPE_VIRTIO_BUS, not in the >>> PCI-specific subclass. >>> >>> (The g_strdup is not needed, either). >>> >>> Paolo >> True, I avoided it because of CCW and S390, but as they don't have >> there get_dev_path, it seems >> not to change anything for them. >> >> I think that's better and I get 0000:00:04.0/virtio-net for idstr. > Sorry, my email seems to be malfunctioning this morning and I didn't se= e > this before sending mine. Not sure which one is better but I'll be happ= y > to test whatever we decide on. Well, seems our patches are sent at the same moment. >> diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c >> index aab72ff..ea2e11a 100644 >> --- a/hw/virtio/virtio-bus.c >> +++ b/hw/virtio/virtio-bus.c >> @@ -154,12 +154,26 @@ void virtio_bus_set_vdev_config(VirtioBusState >> *bus, uint8_t *config) >> } >> } >> >> +static char *virtio_bus_get_dev_path(DeviceState *dev) >> +{ >> + BusState *bus =3D qdev_get_parent_bus(dev); >> + DeviceState *proxy =3D DEVICE(bus->parent); >> + return qdev_get_dev_path(proxy); >> +} >> + >> +static void virtio_bus_class_init(ObjectClass *klass, void *data) >> +{ >> + BusClass *bus_class =3D BUS_CLASS(klass); >> + bus_class->get_dev_path =3D virtio_bus_get_dev_path; >> +} >> + >> static const TypeInfo virtio_bus_info =3D { >> .name =3D TYPE_VIRTIO_BUS, >> .parent =3D TYPE_BUS, >> .instance_size =3D sizeof(VirtioBusState), >> .abstract =3D true, >> .class_size =3D sizeof(VirtioBusClass), >> + .class_init =3D virtio_bus_class_init >> }; >> >> static void virtio_register_types(void) >> --=20 >> 1.7.11.7 >>