[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 08/28] virtio-net: add bootindex to qom prope
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH v7 08/28] virtio-net: add bootindex to qom property |
Date: |
Tue, 9 Sep 2014 08:03:09 +0000 |
Hi,
> > Subject: Re: [Qemu-devel] [PATCH v7 08/28] virtio-net: add bootindex to qom
> > property
> >
> > On Fri, Sep 05, 2014 at 04:37:16PM +0800, address@hidden wrote:
> > > From: Gonglei <address@hidden>
> > >
> > > Add a qom property with the same name 'bootindex',
> > > when we remove it form qdev property, things will
> > > continue to work just fine, and we can use qom features
> > > which are not supported by qdev property.
> > >
> > > Signed-off-by: Gonglei <address@hidden>
> > > ---
> > > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
> > > index 78dcd68..0779d28 100644
> > > --- a/hw/virtio/virtio-pci.c
> > > +++ b/hw/virtio/virtio-pci.c
> > > @@ -1454,9 +1454,14 @@ static void
> virtio_net_pci_class_init(ObjectClass
> > *klass, void *data)
> > > static void virtio_net_pci_instance_init(Object *obj)
> > > {
> > > VirtIONetPCI *dev = VIRTIO_NET_PCI(obj);
> > > - object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET);
> > > - object_property_add_child(obj, "virtio-backend",
> OBJECT(&dev->vdev),
> > NULL);
> > > - object_unref(OBJECT(&dev->vdev));
> > > + VirtIONet *n = &dev->vdev;
> > > +
> > > + object_initialize(n, sizeof(dev->vdev), TYPE_VIRTIO_NET);
> > > + object_property_add_child(obj, "virtio-backend", OBJECT(n), NULL);
> > > + object_unref(OBJECT(n));
> > > + device_add_bootindex_property(obj, &n->nic_conf.bootindex,
> > > + "bootindex",
> "/address@hidden",
> > > + DEVICE(n), NULL);
> >
> > Is anybody able to explain what would be the user-visible effects of
> > simply using dev as the parameter to device_add_bootindex_property() and
> > add_boot_device_path(), instead of dev->vdev?
>
> AFAICT, using dev instead of dev->vdev will cause that one virtio-net device
> have two bootindex entries in the global fw_boot_order list.
>
> > Don't they have exactly the same fw dev path?
> >
> No, they have the same fw dev path.
>
After my patch series:
[PATCH v2 0/9] virtio: fix virtio child recount in transports
This would not be a question in my next version, I will drop it. :)
Best regards,
-Gonglei
- Re: [Qemu-devel] [PATCH v7 24/28] ide: add bootindex to qom property, (continued)
[Qemu-devel] [PATCH v7 25/28] virtio-blk: add bootindex to qom property, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 28/28] bootindex: delete bootindex when device is removed, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 02/28] bootindex: add check bootindex function, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 04/28] fw_cfg: add fw_cfg_machine_reset function, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 08/28] virtio-net: add bootindex to qom property, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 06/28] bootindex: support to set a existent device's bootindex to -1, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 01/28] bootdevice: move bootdevice related code to new file bootdevice.c, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 10/28] eepro100: add bootindex to qom property, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 12/28] pcnet: add bootindex to qom property, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 27/28] bootindex: move calling add_boot_device_patch to bootindex setter function, arei.gonglei, 2014/09/05
[Qemu-devel] [PATCH v7 05/28] bootindex: rework add_boot_device_path function, arei.gonglei, 2014/09/05