@@ -18,6 +18,20 @@
#include "migration/vmstate.h"
#include "hw/misc/vmcoreinfo.h"
+static const VMStateDescription vmstate_vmcoreinfo = {
+ .name = "vmcoreinfo",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .fields = (const VMStateField[]) {
+ VMSTATE_BOOL(has_vmcoreinfo, VMCoreInfoState),
+ VMSTATE_UINT16(vmcoreinfo.host_format, VMCoreInfoState),
+ VMSTATE_UINT16(vmcoreinfo.guest_format, VMCoreInfoState),
+ VMSTATE_UINT32(vmcoreinfo.size, VMCoreInfoState),
+ VMSTATE_UINT64(vmcoreinfo.paddr, VMCoreInfoState),
+ VMSTATE_END_OF_LIST()
+ },
+};
+
static void fw_cfg_vmci_write(void *opaque, off_t offset, size_t len)
{
VMCoreInfoState *s = opaque;
@@ -70,20 +84,6 @@ static void vmcoreinfo_realize(DeviceState *dev, Error **errp)
vmcoreinfo_state = s;
}
-static const VMStateDescription vmstate_vmcoreinfo = {
- .name = "vmcoreinfo",
- .version_id = 1,
- .minimum_version_id = 1,
- .fields = (const VMStateField[]) {
- VMSTATE_BOOL(has_vmcoreinfo, VMCoreInfoState),
- VMSTATE_UINT16(vmcoreinfo.host_format, VMCoreInfoState),
- VMSTATE_UINT16(vmcoreinfo.guest_format, VMCoreInfoState),
- VMSTATE_UINT32(vmcoreinfo.size, VMCoreInfoState),
- VMSTATE_UINT64(vmcoreinfo.paddr, VMCoreInfoState),
- VMSTATE_END_OF_LIST()
- },
-};
-
static void vmcoreinfo_device_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
In order to simplify the next commit, move vmstate_vmcoreinfo[] around. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/misc/vmcoreinfo.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)