diff options
author | Juan Quintela <quintela@redhat.com> | 2009-09-29 22:49:01 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-10-05 09:32:42 -0500 |
commit | 66e6d55b75c50f196d486fb3161b2432bd9afea1 (patch) | |
tree | c51962a43b4e60d8e5e7edf5b2fdcbb2d435e137 /target-i386/machine.c | |
parent | f89a8e4ede7519bdcc3a6f5a7e682f91afcd9b7a (diff) | |
download | qemu-66e6d55b75c50f196d486fb3161b2432bd9afea1.zip qemu-66e6d55b75c50f196d486fb3161b2432bd9afea1.tar.gz qemu-66e6d55b75c50f196d486fb3161b2432bd9afea1.tar.bz2 |
x86: port segments to vmstate
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'target-i386/machine.c')
-rw-r--r-- | target-i386/machine.c | 24 |
1 files changed, 16 insertions, 8 deletions
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) |