cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
958e1b
From bc949bc00c11f49ba6be7be5b4f1bfc7df93aad5 Mon Sep 17 00:00:00 2001
958e1b
From: Marcelo Tosatti <mtosatti@redhat.com>
958e1b
Date: Wed, 9 Jul 2014 13:17:15 +0200
958e1b
Subject: [PATCH 04/13] exit when -no-kvm and vcpu count > 160
958e1b
958e1b
Message-id: <20140506072044.GA25261@amt.cnet>
958e1b
Patchwork-id: 58695
958e1b
O-Subject: [RHEL7 qemu-kvm PATCH] exit when -no-kvm and vcpu count > 160
958e1b
Bugzilla: 1076326
958e1b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
958e1b
RH-Acked-by: Andrew Jones <drjones@redhat.com>
958e1b
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
958e1b
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
958e1b
958e1b
Exit when booting with -no-kvm and number of vcpus is
958e1b
larger than 160.
958e1b
958e1b
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
958e1b
BZ: 1076326
958e1b
---
958e1b
 hw/i386/pc_piix.c    |   14 +++++++-------
958e1b
 hw/i386/pc_q35.c     |    2 +-
958e1b
 include/hw/i386/pc.h |    2 ++
958e1b
 3 files changed, 10 insertions(+), 8 deletions(-)
958e1b
958e1b
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
958e1b
index aeec6f2..550acd8 100644
958e1b
--- a/hw/i386/pc_piix.c
958e1b
+++ b/hw/i386/pc_piix.c
958e1b
@@ -788,7 +788,7 @@ static QEMUMachine pc_machine_rhel700 = {
958e1b
     .desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)",
958e1b
     .init = pc_init_rhel700,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .is_default = 1,
958e1b
     .default_machine_opts = "firmware=bios-256k.bin",
958e1b
     DEFAULT_MACHINE_OPTIONS,
958e1b
@@ -969,7 +969,7 @@ static QEMUMachine pc_machine_rhel650 = {
958e1b
     .desc = "RHEL 6.5.0 PC",
958e1b
     .init = pc_init_rhel650,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .compat_props = (GlobalProperty[]) {
958e1b
         PC_RHEL6_5_COMPAT,
958e1b
         { /* end of list */ }
958e1b
@@ -1018,7 +1018,7 @@ static QEMUMachine pc_machine_rhel640 = {
958e1b
     .desc = "RHEL 6.4.0 PC",
958e1b
     .init = pc_init_rhel640,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .compat_props = (GlobalProperty[]) {
958e1b
         PC_RHEL6_4_COMPAT,
958e1b
         { /* end of list */ }
958e1b
@@ -1094,7 +1094,7 @@ static QEMUMachine pc_machine_rhel630 = {
958e1b
     .desc = "RHEL 6.3.0 PC",
958e1b
     .init = pc_init_rhel630,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .compat_props = (GlobalProperty[]) {
958e1b
         PC_RHEL6_3_COMPAT,
958e1b
         { /* end of list */ }
958e1b
@@ -1126,7 +1126,7 @@ static QEMUMachine pc_machine_rhel620 = {
958e1b
     .desc = "RHEL 6.2.0 PC",
958e1b
     .init = pc_init_rhel620,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .compat_props = (GlobalProperty[]) {
958e1b
         PC_RHEL6_2_COMPAT,
958e1b
         { /* end of list */ }
958e1b
@@ -1199,7 +1199,7 @@ static QEMUMachine pc_machine_rhel610 = {
958e1b
     .desc = "RHEL 6.1.0 PC",
958e1b
     .init = pc_init_rhel610,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .compat_props = (GlobalProperty[]) {
958e1b
         PC_RHEL6_1_COMPAT,
958e1b
         { /* end of list */ }
958e1b
@@ -1239,7 +1239,7 @@ static QEMUMachine pc_machine_rhel600 = {
958e1b
     .desc = "RHEL 6.0.0 PC",
958e1b
     .init = pc_init_rhel600,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .compat_props = (GlobalProperty[]) {
958e1b
         PC_RHEL6_0_COMPAT,
958e1b
         { /* end of list */ }
958e1b
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
958e1b
index 1aa8bde..4534539 100644
958e1b
--- a/hw/i386/pc_q35.c
958e1b
+++ b/hw/i386/pc_q35.c
958e1b
@@ -311,7 +311,7 @@ static QEMUMachine pc_q35_machine_rhel700 = {
958e1b
     .desc = "RHEL-7.0.0 PC (Q35 + ICH9, 2009)",
958e1b
     .init = pc_q35_init_rhel700,
958e1b
     .hot_add_cpu = pc_hot_add_cpu,
958e1b
-    .max_cpus = 255,
958e1b
+    .max_cpus = RHEL_MAX_CPUS,
958e1b
     .default_machine_opts = "firmware=bios-256k.bin",
958e1b
     DEFAULT_MACHINE_OPTIONS,
958e1b
 };
958e1b
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
958e1b
index 8a69347..57e2f93 100644
958e1b
--- a/include/hw/i386/pc.h
958e1b
+++ b/include/hw/i386/pc.h
958e1b
@@ -15,6 +15,8 @@
958e1b
 #include "sysemu/sysemu.h"
958e1b
 #include "hw/pci/pci.h"
958e1b
 
958e1b
+#define RHEL_MAX_CPUS 160
958e1b
+
958e1b
 /* PC-style peripherals (also used by other machines).  */
958e1b
 
958e1b
 typedef struct PcPciInfo {
958e1b
-- 
958e1b
1.7.1
958e1b