]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
virtio-blk: use aliases instead of duplicate qdev properties
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 18 Jun 2014 09:58:33 +0000 (17:58 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 1 Jul 2014 07:15:02 +0000 (09:15 +0200)
commitcaffdac363801cd2cf2bf01ad013a8c1e1e43800
treea3d5038dd85dd265ea553454804b115b176362b2
parent67cc7e0aaca835ed68cf3bd34f4d51a21232792f
virtio-blk: use aliases instead of duplicate qdev properties

virtio-blk-pci, virtio-blk-s390, and virtio-blk-ccw all duplicate the
qdev properties of their VirtIOBlock 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
VirtIOBlock child.  This way no duplication is necessary.

Remember to stop calling virtio_blk_set_conf() so that we don't clobber
the values already set on the VirtIOBlock instance.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
hw/s390x/s390-virtio-bus.c
hw/s390x/s390-virtio-bus.h
hw/s390x/virtio-ccw.c
hw/s390x/virtio-ccw.h
hw/virtio/virtio-pci.c
hw/virtio/virtio-pci.h