Patchwork [qom-next,49/59] target-i386: Drop version 5 CPU VMState support

login
register
mail settings
Submitter Andreas Färber
Date May 23, 2012, 3:08 a.m.
Message ID <1337742502-28565-50-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/160825/
State New
Headers show

Comments

Andreas Färber - May 23, 2012, 3:08 a.m.
Version 5 contained the halted field, that we are about to move from
CPUX86State to CPUState. To avoid inventing new VMSTATE macros for
calculating a negative offset from CPUX86State to the field in CPUState,
rather bump the minimum version from 3 to 6. We're at 12 currently.

Suggested-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Juan Quintela <quintela@redhat.com>
---
 target-i386/machine.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
Juan Quintela - May 24, 2012, 11:32 a.m.
Andreas Färber <afaerber@suse.de> wrote:
> Version 5 contained the halted field, that we are about to move from
> CPUX86State to CPUState. To avoid inventing new VMSTATE macros for
> calculating a negative offset from CPUX86State to the field in CPUState,
> rather bump the minimum version from 3 to 6. We're at 12 currently.
>
> Suggested-by: Juan Quintela <quintela@redhat.com>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> Cc: Juan Quintela <quintela@redhat.com>

Reviewed-by: Juan Quintela <quintela@redhat.com>

Patch

diff --git a/target-i386/machine.c b/target-i386/machine.c
index a8be058..e6e150b 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -201,11 +201,6 @@  static bool fpregs_is_1_no_mmx(void *opaque, int version_id)
     VMSTATE_ARRAY_TEST(_field, _state, _n, fpregs_is_1_mmx, vmstate_fpreg_1_mmx, FPReg), \
     VMSTATE_ARRAY_TEST(_field, _state, _n, fpregs_is_1_no_mmx, vmstate_fpreg_1_no_mmx, FPReg)
 
-static bool version_is_5(void *opaque, int version_id)
-{
-    return version_id == 5;
-}
-
 #ifdef TARGET_X86_64
 static bool less_than_7(void *opaque, int version_id)
 {
@@ -349,8 +344,8 @@  static const VMStateDescription vmstate_msr_ia32_misc_enable = {
 static const VMStateDescription vmstate_cpu = {
     .name = "cpu",
     .version_id = CPU_SAVE_VERSION,
-    .minimum_version_id = 3,
-    .minimum_version_id_old = 3,
+    .minimum_version_id = 6,
+    .minimum_version_id_old = 6,
     .pre_save = cpu_pre_save,
     .post_load = cpu_post_load,
     .fields      = (VMStateField []) {
@@ -407,7 +402,6 @@  static const VMStateDescription vmstate_cpu = {
         VMSTATE_UINT64_V(pat, CPUX86State, 5),
         VMSTATE_UINT32_V(hflags2, CPUX86State, 5),
 
-        VMSTATE_UINT32_TEST(halted, CPUX86State, version_is_5),
         VMSTATE_UINT64_V(vm_hsave, CPUX86State, 5),
         VMSTATE_UINT64_V(vm_vmcb, CPUX86State, 5),
         VMSTATE_UINT64_V(tsc_offset, CPUX86State, 5),