cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Blob Blame History Raw
From 5090ba1ce35fa1d2157de83a4539d993826da82d Mon Sep 17 00:00:00 2001
From: Marcelo Tosatti <mtosatti@redhat.com>
Date: Mon, 27 Jun 2016 20:21:25 +0200
Subject: Fix qemu-kvm does not quit when booting guest w/ 241 vcpus and
 "-no-kvm"

RH-Author: Marcelo Tosatti <mtosatti@redhat.com>
Message-id: <20160627202124.GA26255@amt.cnet>
Patchwork-id: 70796
O-Subject: [RHEV-7.3 qemu-kvm-rhev PATCH v3] Fix qemu-kvm does not quit when booting guest w/ 161 vcpus and "-no-kvm" (BZ 1126666)
Bugzilla: 1126666
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Andrew Jones <drjones@redhat.com>

Boot a guest with /usr/libexec/qemu-kvm -no-kvm -smp 241
and it does not fail.

Fix QEMU to match KVM's number of maximum supported CPUs.

Backport commit #: not applicable.

Note: this change was lost during the last rebase.
The RHEL-7.1 commit number for that change is:
commit ce72a826c4882e62d8b897efc2183c39d9c21906
Author: Markus Armbruster <armbru@redhat.com>
Date:   Mon Aug 11 07:54:35 2014 +0200

    exit when -no-kvm and vcpu count > 160

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
(cherry picked from commit ff9e7316daa93ddfc0b11466128bf03540afcf74)
(cherry picked from commit 13a605ab2f26363751d2b6c72b081d2fd39e6f45)
---
 hw/i386/pc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 2764b77..6ed4d23 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2332,7 +2332,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
     mc->default_boot_order = "cad";
     mc->hot_add_cpu = pc_hot_add_cpu;
     mc->block_default_type = IF_IDE;
-    mc->max_cpus = 255;
+    /* 240: max CPU count for RHEL */
+    mc->max_cpus = 240;
     mc->reset = pc_machine_reset;
     hc->pre_plug = pc_machine_device_pre_plug_cb;
     hc->plug = pc_machine_device_plug_cb;
-- 
1.8.3.1