Sophie

Sophie

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

kvm-83-270.el5_11.src.rpm

From 4494d4ff356f7fcacd4f48f65f515006a1631306 Mon Sep 17 00:00:00 2001
From: Juan Quintela <quintela@redhat.com>
Date: Wed, 22 Jul 2009 11:13:43 +0200
Subject: [PATCH 11/16] add option to disable all cpu's model different from qemu32/64 and pentium3

VDSM uses pentium3 for 32bits

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <3dd56806555ed552e17a03d4f668d332633ca847.1248252585.git.quintela@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Bugzilla: 512837
Obsoletes: <3c9ce0b0d6fb42901696bb74128665490edb7a1c.1248207932.git.quintela@redhat.com>
Obsoletes: <d87544c978b2a85175ccf55f8e0d1bb6058a51bb.1248095798.git.quintela@redhat.com>
Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Upstream-status: pending
Acked-by: Dor Laor <dlaor@redhat.com>
Acked-by: Kevin Wolf <kwolf@redhat.com>
---
 qemu/configure            |    7 +++++++
 qemu/target-i386/helper.c |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/qemu/configure b/qemu/configure
index a69a04b..a980871 100755
--- a/qemu/configure
+++ b/qemu/configure
@@ -182,6 +182,7 @@ usb_wacom="yes"
 usb_serial="yes"
 usb_net="yes"
 usb_bluez="yes"
+x86_only_generic_cpus="no"
 kvm="yes"
 kvm_nested="no"
 kvm_cap_pit="no"
@@ -434,6 +435,8 @@ for opt do
   ;;
   --disable-usb-bluez) usb_bluez="no"
   ;;
+  --disable-x86-non-generic-cpus) x86_only_generic_cpus="yes"
+  ;;
   --disable-kvm) kvm="no"
   ;;
   --enable-profiler) profiler="yes"
@@ -1330,6 +1333,7 @@ echo "USB wacom         $usb_wacom"
 echo "USB serial        $usb_serial"
 echo "USB net           $usb_net"
 echo "USB bluez         $usb_bluez"
+echo "Only generic cpus $x86_only_generic_cpus"
 
 if test $sdl_too_old = "yes"; then
 echo "-> Your SDL version is too old - please upgrade to have SDL support"
@@ -1649,6 +1653,9 @@ if test "$usb_bluez" = "yes" ; then
   echo "CONFIG_USB_BLUEZ=yes" >> $config_mak
   echo "#define CONFIG_USB_BLUEZ 1" >> $config_h
 fi
+if test "$x86_only_generic_cpus" = "yes" ; then
+  echo "#define CONFIG_X86_ONLY_GENERIC_CPUS 1" >> $config_h
+fi
 if test "$aio" = "yes" ; then
   echo "#define CONFIG_AIO 1" >> $config_h
   echo "CONFIG_AIO=yes" >> $config_mak
diff --git a/qemu/target-i386/helper.c b/qemu/target-i386/helper.c
index c8321c4..f09bf13 100644
--- a/qemu/target-i386/helper.c
+++ b/qemu/target-i386/helper.c
@@ -141,6 +141,7 @@ static x86_def_t x86_defs[] = {
         .xlevel = 0x8000000A,
         .model_id = "QEMU Virtual CPU version " QEMU_VERSION,
     },
+#ifndef CONFIG_X86_ONLY_GENERIC_CPUS
     {
         .name = "core2duo",
         .level = 10,
@@ -163,6 +164,8 @@ static x86_def_t x86_defs[] = {
         .model_id = "Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz",
     },
 #endif
+
+#endif
     {
         .name = "qemu32",
         .level = 2,
@@ -174,6 +177,7 @@ static x86_def_t x86_defs[] = {
         .xlevel = 0,
         .model_id = "QEMU Virtual CPU version " QEMU_VERSION,
     },
+#ifndef CONFIG_X86_ONLY_GENERIC_CPUS
     {
         .name = "coreduo",
         .level = 10,
@@ -220,6 +224,7 @@ static x86_def_t x86_defs[] = {
         .features = PENTIUM2_FEATURES,
         .xlevel = 0,
     },
+#endif /* CONFIG_X86_ONLY_GENERIC_CPUS */
     {
         .name = "pentium3",
         .level = 2,
@@ -229,6 +234,7 @@ static x86_def_t x86_defs[] = {
         .features = PENTIUM3_FEATURES,
         .xlevel = 0,
     },
+#ifndef CONFIG_X86_ONLY_GENERIC_CPUS
     {
         .name = "athlon",
         .level = 2,
@@ -265,6 +271,7 @@ static x86_def_t x86_defs[] = {
         .xlevel = 0x8000000A,
         .model_id = "Intel(R) Atom(TM) CPU N270   @ 1.60GHz",
     },
+#endif
 };
 
 static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *cpu_model)
-- 
1.6.3.rc4.29.g8146