summary refs log tree commit diff stats
path: root/hw/misc/vmcoreinfo.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-12-19 16:19:35 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-13 17:16:04 +0100
commitb7700c9fb1c052e3f2c503c535bccdb6dd70dd97 (patch)
tree289fbe33c0a4652f8225f41a7a34d4babc768792 /hw/misc/vmcoreinfo.c
parentb2d4e9f3b8437359e063431d991d4d4eb1ef7d6c (diff)
downloadfocaccia-qemu-b7700c9fb1c052e3f2c503c535bccdb6dd70dd97.tar.gz
focaccia-qemu-b7700c9fb1c052e3f2c503c535bccdb6dd70dd97.zip
hw/misc/vmcoreinfo: Convert to three-phase reset interface
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20241219153857.57450-6-philmd@linaro.org>
Diffstat (limited to 'hw/misc/vmcoreinfo.c')
-rw-r--r--hw/misc/vmcoreinfo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c
index 145f13a65c..b0145fa504 100644
--- a/hw/misc/vmcoreinfo.c
+++ b/hw/misc/vmcoreinfo.c
@@ -26,9 +26,9 @@ static void fw_cfg_vmci_write(void *opaque, off_t offset, size_t len)
         && s->vmcoreinfo.guest_format != FW_CFG_VMCOREINFO_FORMAT_NONE;
 }
 
-static void vmcoreinfo_reset(void *opaque)
+static void vmcoreinfo_reset_hold(Object *obj, ResetType type)
 {
-    VMCoreInfoState *s = opaque;
+    VMCoreInfoState *s = VMCOREINFO(obj);
 
     s->has_vmcoreinfo = false;
     memset(&s->vmcoreinfo, 0, sizeof(s->vmcoreinfo));
@@ -65,7 +65,7 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp)
      * This device requires to register a global reset because it is
      * not plugged to a bus (which, as its QOM parent, would reset it).
      */
-    qemu_register_reset(vmcoreinfo_reset, s);
+    qemu_register_resettable(OBJECT(s));
     vmcoreinfo_state = s;
 }
 
@@ -86,11 +86,13 @@ static const VMStateDescription vmstate_vmcoreinfo = {
 static void vmcoreinfo_device_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    ResettableClass *rc = RESETTABLE_CLASS(klass);
 
     dc->vmsd = &vmstate_vmcoreinfo;
     dc->realize = vmcoreinfo_realize;
     dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    rc->phases.hold = vmcoreinfo_reset_hold;
 }
 
 static const TypeInfo vmcoreinfo_types[] = {