|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] hw/xen: Mark legacy Xen backends as hotpluggable
From: Peng Fan <peng.fan@xxxxxxx>
Commit 250e797ceada ("hw/xen: Have legacy Xen backend inherit from
DYNAMIC_SYS_BUS_DEVICE") changed TYPE_XENBACKEND to inherit from
TYPE_DYNAMIC_SYS_BUS_DEVICE, whose class sets hotpluggable = false.
Legacy Xen backends are created from xenstore at runtime, after the
machine is ready, so device_initfn() marks them as hotplugged. The new
class setting makes device_set_realized() reject them with:
Device 'xen-backend' does not support hotplugging
Since xen_be_get_xendev() realizes the device with &error_fatal, QEMU
then exits. For example, "xl usbdev-attach" triggers this when the qusb
backend is created dynamically, killing the guest. The same flag also
causes qdev_unplug() to ignore these devices.
Override hotpluggable in xendev_class_init() to restore the behavior
before the offending commit.
Fixes: 250e797ceada ("hw/xen: Have legacy Xen backend inherit from
DYNAMIC_SYS_BUS_DEVICE")
Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
hw/xen/xen-legacy-backend.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c
index 7977b527127..bf4396c9460 100644
--- a/hw/xen/xen-legacy-backend.c
+++ b/hw/xen/xen-legacy-backend.c
@@ -640,6 +640,13 @@ static void xendev_class_init(ObjectClass *klass, const
void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+ /*
+ * Legacy Xen backends are created and destroyed dynamically from
+ * xenstore at runtime, after the machine has been initialized.
+ * TYPE_DYNAMIC_SYS_BUS_DEVICE marks devices as not hotpluggable,
+ * so override that here.
+ */
+ dc->hotpluggable = true;
dc->bus_type = TYPE_XENSYSBUS;
}
---
base-commit: e9fa1f66f0d47c74b6766e1b8b87ad7c2a9394d5
change-id: 20261116-qemu-xen-usb-1a36b002a561
Best regards,
--
Peng Fan <peng.fan@xxxxxxx>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |