qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 66e6d55] x86: port segments to vmstate


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 66e6d55] x86: port segments to vmstate
Date: Mon, 05 Oct 2009 14:53:15 -0000

From: Juan Quintela <address@hidden>

Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>

diff --git a/target-i386/machine.c b/target-i386/machine.c
index 78794dd..15a8c25 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -7,20 +7,28 @@
 #include "exec-all.h"
 #include "kvm.h"
 
+static const VMStateDescription vmstate_segment = {
+    .name = "segment",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields      = (VMStateField []) {
+        VMSTATE_UINT32(selector, SegmentCache),
+        VMSTATE_UINTTL(base, SegmentCache),
+        VMSTATE_UINT32(limit, SegmentCache),
+        VMSTATE_UINT32(flags, SegmentCache),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static void cpu_put_seg(QEMUFile *f, SegmentCache *dt)
 {
-    qemu_put_be32(f, dt->selector);
-    qemu_put_betl(f, dt->base);
-    qemu_put_be32(f, dt->limit);
-    qemu_put_be32(f, dt->flags);
+    vmstate_save_state(f, &vmstate_segment, dt);
 }
 
 static void cpu_get_seg(QEMUFile *f, SegmentCache *dt)
 {
-    dt->selector = qemu_get_be32(f);
-    dt->base = qemu_get_betl(f);
-    dt->limit = qemu_get_be32(f);
-    dt->flags = qemu_get_be32(f);
+    vmstate_load_state(f, &vmstate_segment, dt, vmstate_segment.version_id);
 }
 
 void cpu_save(QEMUFile *f, void *opaque)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]