From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Gzl-0003tf-W7 for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9Gzc-0006br-51 for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:41 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:55078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9Gzc-0006b7-0d for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:32 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 12:35:31 -0500 From: Michael Roth Date: Thu, 8 Jan 2015 11:33:43 -0600 Message-Id: <1420738472-23267-40-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 39/88] virtio-9p: use aliases instead of duplicate qdev properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Gonglei virtio-9p-pci all duplicate the qdev properties of their V9fsState child. This approach does not work well with string or pointer properties since we must be careful about leaking or double-freeing them. Use the QOM alias property to forward property accesses to the V9fsState child. This way no duplication is necessary. Signed-off-by: Gonglei Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini (cherry picked from commit 48833071d955406ebeddc365a8df8b5cb12b035f) Signed-off-by: Michael Roth --- hw/virtio/virtio-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 6a355e7..50ef68c 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -924,7 +924,6 @@ static Property virtio_9p_pci_properties[] = { DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags, VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2), - DEFINE_VIRTIO_9P_PROPERTIES(V9fsPCIState, vdev.fsconf), DEFINE_PROP_END_OF_LIST(), }; @@ -948,6 +947,7 @@ static void virtio_9p_pci_instance_init(Object *obj) V9fsPCIState *dev = VIRTIO_9P_PCI(obj); object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_9P); object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL); + qdev_alias_all_properties(DEVICE(&dev->vdev), obj); } static const TypeInfo virtio_9p_pci_info = { -- 1.9.1