diff options
author | Bernhard Beschow <shentey@gmail.com> | 2025-01-27 10:41:29 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-02-16 14:25:08 +0100 |
commit | 83f0f363e4a24b40142079ab1b328ed653f7d14b (patch) | |
tree | 8ba675c67c70fd020f84c49ea4cb8fd4fbc4a003 /hw/xen | |
parent | c10f4c744a7cac8be38158b0793ccf8d754cecd1 (diff) | |
download | qemu-83f0f363e4a24b40142079ab1b328ed653f7d14b.zip qemu-83f0f363e4a24b40142079ab1b328ed653f7d14b.tar.gz qemu-83f0f363e4a24b40142079ab1b328ed653f7d14b.tar.bz2 |
hw/xen: Prefer QOM cast for XenLegacyDevice
Makes the code less sensitive regarding changes in the class hierarchy which
will be performed in the next patch.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250127094129.15941-1-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw/xen')
-rw-r--r-- | hw/xen/xen-legacy-backend.c | 2 | ||||
-rw-r--r-- | hw/xen/xen_pvdev.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 118c571..ca2fe0e 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -163,7 +163,7 @@ static struct XenLegacyDevice *xen_be_get_xendev(const char *type, int dom, /* init new xendev */ xendev = g_malloc0(ops->size); - object_initialize(&xendev->qdev, ops->size, TYPE_XENBACKEND); + object_initialize(xendev, ops->size, TYPE_XENBACKEND); OBJECT(xendev)->free = g_free; qdev_set_id(DEVICE(xendev), g_strdup_printf("xen-%s-%d", type, dev), &error_fatal); diff --git a/hw/xen/xen_pvdev.c b/hw/xen/xen_pvdev.c index c9143ba..fe95b62 100644 --- a/hw/xen/xen_pvdev.c +++ b/hw/xen/xen_pvdev.c @@ -273,7 +273,7 @@ void xen_pv_del_xendev(struct XenLegacyDevice *xendev) QTAILQ_REMOVE(&xendevs, xendev, next); - qdev_unplug(&xendev->qdev, NULL); + qdev_unplug(DEVICE(xendev), NULL); } void xen_pv_insert_xendev(struct XenLegacyDevice *xendev) |