Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 340e01248478ba8b78a6d4d1809b1eff > files > 312

kvm-83-270.el5_11.src.rpm

From 4e1cf5b1e885c2cef5df9d315004d650585a8ac7 Mon Sep 17 00:00:00 2001
From: Juan Quintela <quintela@redhat.com>
Date: Wed, 27 Jan 2010 17:11:14 -0200
Subject: [PATCH 5/5] cpu: CPU_SAVE_VERSION is 9 know

RH-Author: Juan Quintela <quintela@redhat.com>
Message-id: <17e28ba6a7ba792be21fb09ecc1c33a81b765138.1264610524.git.quintela@redhat.com>
Patchwork-id: 6721
O-Subject: [PATCH 2/2] cpu: CPU_SAVE_VERSION is 9 know
Bugzilla: 559163
RH-Acked-by: Gleb Natapov <gleb@redhat.com>
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>

Fix the problem once forever.  As we are supporting all the formats from 3,
just compare for a range using CPU_SAVE_VERSION as the limit.

bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=559163

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 qemu/target-i386/machine.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 qemu/target-i386/machine.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/qemu/target-i386/machine.c b/qemu/target-i386/machine.c
index 36e4cc6..a65b55d 100644
--- a/qemu/target-i386/machine.c
+++ b/qemu/target-i386/machine.c
@@ -197,8 +197,7 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
     uint16_t fpus, fpuc, fptag, fpregs_format;
     int32_t a20_mask;
 
-    if (version_id != 3 && version_id != 4 && version_id != 5
-        && version_id != 6 && version_id != 7 && version_id != 8)
+    if (version_id < 3 || version_id > CPU_SAVE_VERSION)
         return -EINVAL;
     for(i = 0; i < CPU_NB_REGS; i++)
         qemu_get_betls(f, &env->regs[i]);
-- 
1.6.3.rc4.29.g8146