qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices


From: Philippe Mathieu-Daudé
Subject: [PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices
Date: Fri, 16 Feb 2024 12:03:02 +0100

QDev objects created with qdev_*new() need to manually add
their parent relationship with object_property_add_child().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/usb/bus.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index a599e2552b..baad04f466 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -439,6 +439,7 @@ void usb_claim_port(USBDevice *dev, Error **errp)
             /* Create a new hub and chain it on */
             hub = USB_DEVICE(qdev_try_new("usb-hub"));
             if (hub) {
+                object_property_add_child(OBJECT(dev), "hub", OBJECT(hub));
                 usb_realize_and_unref(hub, bus, NULL);
             }
         }
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]