Received: from eggs.gnu.org ([2001:4830:134:3::10]:46600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPyG0-0001N5-WB for qemu-devel@nongnu.org; Fri, 05 Sep 2014 14:29:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPyFt-0006RI-Hv for qemu-devel@nongnu.org; Fri, 05 Sep 2014 14:29:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPyFt-0006RE-Bd for qemu-devel@nongnu.org; Fri, 05 Sep 2014 14:29:05 -0400 Date: Fri, 5 Sep 2014 15:28:52 -0300 From: Eduardo Habkost Message-ID: <20140905182852.GL32084@thinpad.lan.raisama.net> References: <1409906256-11368-1-git-send-email-arei.gonglei@huawei.com> <1409906256-11368-9-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1409906256-11368-9-git-send-email-arei.gonglei@huawei.com> Subject: Re: [Qemu-devel] [PATCH v7 08/28] virtio-net: add bootindex to qom property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: arei.gonglei@huawei.com Cc: chenliang88@huawei.com, weidong.huang@huawei.com, mst@redhat.com, aik@ozlabs.ru, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, armbru@redhat.com, kraxel@redhat.com, akong@redhat.com, agraf@suse.de, aliguori@amazon.com, luonengjun@huawei.com, peter.huangpeng@huawei.com, hani@linux.com, stefanha@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com, kwolf@redhat.com, peter.crosthwaite@xilinx.com, imammedo@redhat.com, afaerber@suse.de On Fri, Sep 05, 2014 at 04:37:16PM +0800, arei.gonglei@huawei.com wrote: > From: Gonglei > > 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 > --- > 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", "/ethernet-phy@0", > + 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? Don't they have exactly the same fw dev path? -- Eduardo