diff options
author | Igor Mammedov <imammedo@redhat.com> | 2016-07-18 10:31:22 +0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2016-07-20 12:02:19 -0300 |
commit | 73360e27850b213327011f7e22e03865b8c0dd5b (patch) | |
tree | ff91a4446ee4faab1004f909a272941cfbb70c5a | |
parent | a44a49dbf2eb8b9b430711b152663678c15f689c (diff) |
pc: Forbid BSP removal
Boot CPU is assumed to always present in QEMU code, so
untile that assumptions are gone, deny removal request,
In another words QEMU won't support BSP hot-unplug.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r-- | hw/i386/pc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f4c6a27508..dd5661a72d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1803,10 +1803,18 @@ out: static void pc_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { + int idx = -1; HotplugHandlerClass *hhc; Error *local_err = NULL; PCMachineState *pcms = PC_MACHINE(hotplug_dev); + pc_find_cpu_slot(pcms, CPU(dev), &idx); + assert(idx != -1); + if (idx == 0) { + error_setg(&local_err, "Boot CPU is unpluggable"); + goto out; + } + hhc = HOTPLUG_HANDLER_GET_CLASS(pcms->acpi_dev); hhc->unplug_request(HOTPLUG_HANDLER(pcms->acpi_dev), dev, &local_err); |