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>
This commit is contained in:
Stefan Hajnoczi 2014-06-18 17:58:33 +08:00
parent 67cc7e0aac
commit caffdac363
6 changed files with 3 additions and 15 deletions

View file

@ -131,7 +131,6 @@ struct VHostSCSIPCI {
struct VirtIOBlkPCI {
VirtIOPCIProxy parent_obj;
VirtIOBlock vdev;
VirtIOBlkConf blk;
};
/*