aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-09-30 14:10:36 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-30 11:09:56 +0200
commit48833071d955406ebeddc365a8df8b5cb12b035f (patch)
tree6fd2b5fd75c726168d06b036fded07929890c143 /hw
parent91ba21208839643603e7f7fa5864723c3f371ebe (diff)
downloadqemu-48833071d955406ebeddc365a8df8b5cb12b035f.zip
qemu-48833071d955406ebeddc365a8df8b5cb12b035f.tar.gz
qemu-48833071d955406ebeddc365a8df8b5cb12b035f.tar.bz2
virtio-9p: use aliases instead of duplicate qdev properties
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 <arei.gonglei@huawei.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/virtio-pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 62f84c4..714286d 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -926,7 +926,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(),
};
@@ -950,6 +949,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 = {