qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Serge Hallyn <serge.hallyn@canonical.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [qemu-kvm PATCH 1/1]  don't try to hotplug a cpu
Date: Thu, 1 Dec 2011 11:14:19 -0600	[thread overview]
Message-ID: <20111201171419.GA13585@sergelap> (raw)

When you do "cpu_set <n> online" where <n> > current number of cpus,
qemu-kvm will end up crashing when qdev finds hotplug is not enabled.
Let's instead gracefully refuse.

See https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/878422 for
the related bug report.

Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com>
---
 hw/acpi_piix4.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 1b35707..5e95569 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -589,12 +589,17 @@ void qemu_system_cpu_hot_add(int cpu, int state)
     PIIX4PMState *s = global_piix4_pm_state;
 
     if (state && !qemu_get_cpu(cpu)) {
+#if 1
+        fprintf(stderr, "cpu hotplug not supported\n", cpu);
+        return;
+#else
         env = pc_new_cpu(global_cpu_model);
         if (!env) {
             fprintf(stderr, "cpu %d creation failed\n", cpu);
             return;
         }
         env->cpuid_apic_id = cpu;
+#endif
     }
 
     if (state)
-- 
1.7.5.4

                 reply	other threads:[~2011-12-01 17:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111201171419.GA13585@sergelap \
    --to=serge.hallyn@canonical.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).