summaryrefslogtreecommitdiffstats
path: root/qemu/migration/vmstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu/migration/vmstate.c')
-rw-r--r--qemu/migration/vmstate.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/qemu/migration/vmstate.c b/qemu/migration/vmstate.c
index e8ccf22f6..bf3d5db30 100644
--- a/qemu/migration/vmstate.c
+++ b/qemu/migration/vmstate.c
@@ -1,3 +1,4 @@
+#include "qemu/osdep.h"
#include "qemu-common.h"
#include "migration/migration.h"
#include "migration/qemu-file.h"
@@ -28,6 +29,10 @@ static int vmstate_n_elems(void *opaque, VMStateField *field)
n_elems = *(uint8_t *)(opaque+field->num_offset);
}
+ if (field->flags & VMS_MULTIPLY_ELEMENTS) {
+ n_elems *= field->num;
+ }
+
return n_elems;
}
@@ -794,6 +799,29 @@ const VMStateInfo vmstate_info_float64 = {
.put = put_float64,
};
+/* CPU_DoubleU type */
+
+static int get_cpudouble(QEMUFile *f, void *pv, size_t size)
+{
+ CPU_DoubleU *v = pv;
+ qemu_get_be32s(f, &v->l.upper);
+ qemu_get_be32s(f, &v->l.lower);
+ return 0;
+}
+
+static void put_cpudouble(QEMUFile *f, void *pv, size_t size)
+{
+ CPU_DoubleU *v = pv;
+ qemu_put_be32s(f, &v->l.upper);
+ qemu_put_be32s(f, &v->l.lower);
+}
+
+const VMStateInfo vmstate_info_cpudouble = {
+ .name = "CPU_Double_U",
+ .get = get_cpudouble,
+ .put = put_cpudouble,
+};
+
/* uint8_t buffers */
static int get_buffer(QEMUFile *f, void *pv, size_t size)