Skip to contentSkip to conversation

don't try to hotplug a cpu

PATCH New Serge Hallyn 1 participant 1 message Dec 1, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't try to hotplug a cpu

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.

---
 hw/acpi_piix4.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
hw/acpi_piix4.c +5 -0
index 1b35707..5e95569 100644
@@ -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)
Signature · 1 line
1.7.5.4