mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-22 09:32:40 -06:00
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>
This commit is contained in:
parent
c10f4c744a
commit
83f0f363e4
3 changed files with 5 additions and 5 deletions
|
@ -755,10 +755,10 @@ static void usbback_portid_add(struct usbback_info *usbif, unsigned port,
|
||||||
|
|
||||||
qdict = qdict_new();
|
qdict = qdict_new();
|
||||||
qdict_put_str(qdict, "driver", "usb-host");
|
qdict_put_str(qdict, "driver", "usb-host");
|
||||||
tmp = g_strdup_printf("%s.0", usbif->xendev.qdev.id);
|
tmp = g_strdup_printf("%s.0", DEVICE(&usbif->xendev)->id);
|
||||||
qdict_put_str(qdict, "bus", tmp);
|
qdict_put_str(qdict, "bus", tmp);
|
||||||
g_free(tmp);
|
g_free(tmp);
|
||||||
tmp = g_strdup_printf("%s-%u", usbif->xendev.qdev.id, port);
|
tmp = g_strdup_printf("%s-%u", DEVICE(&usbif->xendev)->id, port);
|
||||||
qdict_put_str(qdict, "id", tmp);
|
qdict_put_str(qdict, "id", tmp);
|
||||||
g_free(tmp);
|
g_free(tmp);
|
||||||
qdict_put_int(qdict, "port", port);
|
qdict_put_int(qdict, "port", port);
|
||||||
|
@ -1022,7 +1022,7 @@ static void usbback_alloc(struct XenLegacyDevice *xendev)
|
||||||
usbif = container_of(xendev, struct usbback_info, xendev);
|
usbif = container_of(xendev, struct usbback_info, xendev);
|
||||||
|
|
||||||
usb_bus_new(&usbif->bus, sizeof(usbif->bus), &xen_usb_bus_ops,
|
usb_bus_new(&usbif->bus, sizeof(usbif->bus), &xen_usb_bus_ops,
|
||||||
DEVICE(&xendev->qdev));
|
DEVICE(xendev));
|
||||||
for (i = 0; i < USBBACK_MAXPORTS; i++) {
|
for (i = 0; i < USBBACK_MAXPORTS; i++) {
|
||||||
p = &(usbif->ports[i].port);
|
p = &(usbif->ports[i].port);
|
||||||
usb_register_port(&usbif->bus, p, usbif, i, &xen_usb_port_ops,
|
usb_register_port(&usbif->bus, p, usbif, i, &xen_usb_port_ops,
|
||||||
|
|
|
@ -163,7 +163,7 @@ static struct XenLegacyDevice *xen_be_get_xendev(const char *type, int dom,
|
||||||
|
|
||||||
/* init new xendev */
|
/* init new xendev */
|
||||||
xendev = g_malloc0(ops->size);
|
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;
|
OBJECT(xendev)->free = g_free;
|
||||||
qdev_set_id(DEVICE(xendev), g_strdup_printf("xen-%s-%d", type, dev),
|
qdev_set_id(DEVICE(xendev), g_strdup_printf("xen-%s-%d", type, dev),
|
||||||
&error_fatal);
|
&error_fatal);
|
||||||
|
|
|
@ -273,7 +273,7 @@ void xen_pv_del_xendev(struct XenLegacyDevice *xendev)
|
||||||
|
|
||||||
QTAILQ_REMOVE(&xendevs, xendev, next);
|
QTAILQ_REMOVE(&xendevs, xendev, next);
|
||||||
|
|
||||||
qdev_unplug(&xendev->qdev, NULL);
|
qdev_unplug(DEVICE(xendev), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void xen_pv_insert_xendev(struct XenLegacyDevice *xendev)
|
void xen_pv_insert_xendev(struct XenLegacyDevice *xendev)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue