diff options
author | Eduardo Habkost | 2020-12-11 23:05:06 +0100 |
---|---|---|
committer | Eduardo Habkost | 2020-12-15 16:02:07 +0100 |
commit | 828ade86ee925c132496113e7f88b22162d92ec5 (patch) | |
tree | 47bc5ecbf809d27330a09555c21bea5d605ddf46 /hw/block | |
parent | qdev: Make bit_prop_set() get Object* argument (diff) | |
download | qemu-828ade86ee925c132496113e7f88b22162d92ec5.tar.gz qemu-828ade86ee925c132496113e7f88b22162d92ec5.tar.xz qemu-828ade86ee925c132496113e7f88b22162d92ec5.zip |
qdev: Make qdev_get_prop_ptr() get Object* arg
Make the code more generic and not specific to TYPE_DEVICE.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com> #s390 parts
Acked-by: Paul Durrant <paul@xen.org>
Message-Id: <20201211220529.2290218-10-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/block')
-rw-r--r-- | hw/block/xen-block.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c index 8a7a3f5452..905e4acd97 100644 --- a/hw/block/xen-block.c +++ b/hw/block/xen-block.c @@ -335,9 +335,8 @@ static char *disk_to_vbd_name(unsigned int disk) static void xen_block_get_vdev(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - DeviceState *dev = DEVICE(obj); Property *prop = opaque; - XenBlockVdev *vdev = qdev_get_prop_ptr(dev, prop); + XenBlockVdev *vdev = qdev_get_prop_ptr(obj, prop); char *str; switch (vdev->type) { @@ -398,7 +397,7 @@ static void xen_block_set_vdev(Object *obj, Visitor *v, const char *name, { DeviceState *dev = DEVICE(obj); Property *prop = opaque; - XenBlockVdev *vdev = qdev_get_prop_ptr(dev, prop); + XenBlockVdev *vdev = qdev_get_prop_ptr(obj, prop); char *str, *p; const char *end; |