diff options
author | Gonglei <arei.gonglei@huawei.com> | 2014-09-30 14:10:31 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-09-30 11:09:03 +0200 |
commit | 4f456d8025c7259c66b2b2bcec99d5c6c94d99be (patch) | |
tree | 9c6deeb0a271016d4e2d0391622b16f0ad455d2f /hw/s390x/s390-virtio-bus.c | |
parent | 1312f12bcc8911ed99b67227fb9d1607295f71ed (diff) |
virtio-serial: use aliases instead of duplicate qdev properties
virtio-serial-{pci, s390, ccw} all duplicate the
qdev properties of their VirtIOSerial 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
VirtIOSerial child. This way no duplication is necessary.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/s390x/s390-virtio-bus.c')
-rw-r--r-- | hw/s390x/s390-virtio-bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 42760340f4..31f5286e3c 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -226,6 +226,7 @@ static void s390_virtio_serial_instance_init(Object *obj) VirtIOSerialS390 *dev = VIRTIO_SERIAL_S390(obj); object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SERIAL); object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL); + qdev_alias_all_properties(DEVICE(&dev->vdev), obj); } static int s390_virtio_scsi_init(VirtIOS390Device *s390_dev) @@ -537,7 +538,6 @@ static const TypeInfo s390_virtio_blk = { }; static Property s390_virtio_serial_properties[] = { - DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtIOSerialS390, vdev.serial), DEFINE_PROP_END_OF_LIST(), }; |