|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH] hw/i386/xen/xen_platform: Convert to Resettable interface
Replace the deprecated device_class_set_legacy_reset() with the three-phase
ResettableClass interface by setting phases.hold directly, as TYPE_PCI_DEVICE
does not implement a parent reset method.
Signed-off-by: Oscar Alejandro Sánchez Lucero <aleszlucero@xxxxxxxxx>
---
hw/i386/xen/xen_platform.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c
index ec0084d..dd0ddc9 100644
--- a/hw/i386/xen/xen_platform.c
+++ b/hw/i386/xen/xen_platform.c
@@ -574,9 +574,9 @@ static void xen_platform_realize(PCIDevice *dev, Error
**errp)
platform_fixed_ioport_init(d);
}
-static void platform_reset(DeviceState *dev)
+static void platform_reset_hold(Object *obj, ResetType type)
{
- PCIXenPlatformState *s = XEN_PLATFORM(dev);
+ PCIXenPlatformState *s = XEN_PLATFORM(obj);
platform_fixed_ioport_reset(s);
}
@@ -585,6 +585,7 @@ static void xen_platform_class_init(ObjectClass *klass,
const void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+ ResettableClass *rc = RESETTABLE_CLASS(klass);
k->realize = xen_platform_realize;
k->vendor_id = PCI_VENDOR_ID_XEN;
@@ -595,7 +596,7 @@ static void xen_platform_class_init(ObjectClass *klass,
const void *data)
k->revision = 1;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
dc->desc = "XEN platform pci device";
- device_class_set_legacy_reset(dc, platform_reset);
+ rc->phases.hold = platform_reset_hold;
dc->vmsd = &vmstate_xen_platform;
}
---
base-commit: 9751c62358073580cbf330a4df22077a7c6a407c
change-id: 20261129-xen-platform-resettable-9e1fe1f3c25f
Best regards,
--
Oscar Alejandro Sánchez Lucero <aleszlucero@xxxxxxxxx>
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |