[RFC PATCH 06/10] hw/misc/vmcoreinfo: Move vmstate_vmcoreinfo[] around

Philippe Mathieu-Daudé posted 10 patches 2 days, 10 hours ago
There is a newer version of this series
[RFC PATCH 06/10] hw/misc/vmcoreinfo: Move vmstate_vmcoreinfo[] around
Posted by Philippe Mathieu-Daudé 2 days, 10 hours ago
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(-)

diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c
index 093bede655e..55f9d437a94 100644
--- a/hw/misc/vmcoreinfo.c
+++ b/hw/misc/vmcoreinfo.c
@@ -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);
-- 
2.47.1