Move igvm file processing from machine init to reset callbacks. With
that the igvm file is properly re-loaded on reset. Also the loading
happens later in the init process now. This will simplify future
support for some IGVM parameters which depend on initialization steps
which happen after machine init.
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <
20260126123755.357378-6-kraxel@redhat.com>
#include "system/igvm-internal.h"
#include "system/reset.h"
#include "qom/object_interfaces.h"
+#include "hw/core/qdev.h"
+#include "hw/core/boards.h"
#include "trace.h"
static void igvm_reset_hold(Object *obj, ResetType type)
{
+ MachineState *ms = MACHINE(qdev_get_machine());
+ IgvmCfg *igvm = IGVM_CFG(obj);
+
trace_igvm_reset_hold(type);
+
+ qigvm_process_file(igvm, ms->cgs, false, &error_fatal);
}
static void igvm_reset_exit(Object *obj, ResetType type)
x86_nvdimm_acpi_dsmio,
x86ms->fw_cfg, OBJECT(pcms));
}
-
-#if defined(CONFIG_IGVM)
- /* Apply guest state from IGVM if supplied */
- if (x86ms->igvm) {
- if (IGVM_CFG_GET_CLASS(x86ms->igvm)
- ->process(x86ms->igvm, machine->cgs, false, &error_fatal) < 0) {
- g_assert_not_reached();
- }
- }
-#endif
}
typedef enum PCSouthBridgeOption {
x86_nvdimm_acpi_dsmio,
x86ms->fw_cfg, OBJECT(pcms));
}
-
-#if defined(CONFIG_IGVM)
- /* Apply guest state from IGVM if supplied */
- if (x86ms->igvm) {
- if (IGVM_CFG_GET_CLASS(x86ms->igvm)
- ->process(x86ms->igvm, machine->cgs, false, &error_fatal) < 0) {
- g_assert_not_reached();
- }
- }
-#endif
}
#define DEFINE_Q35_MACHINE(major, minor) \