diff options
author | Bharata B Rao <bharata@linux.vnet.ibm.com> | 2016-06-10 06:29:05 +0530 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2016-06-17 16:33:49 +1000 |
commit | 6f4b5c3ec590b04ba58fda753a81a93f316b77a4 (patch) | |
tree | b62d5182278c1a6fb95b9775a5deb416492f5522 /hw/ppc/spapr.c | |
parent | af81cf323c17083a3e016f9556c521357b46ab40 (diff) |
spapr: CPU hot unplug support
Remove the CPU core device by removing the underlying CPU thread devices.
Hot removal of CPU for sPAPR guests is achieved by sending the hot unplug
notification to the guest. Release the vCPU object after CPU hot unplug so
that vCPU fd can be parked and reused.
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r-- | hw/ppc/spapr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index c444a86a59..1dcb9f6922 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2313,8 +2313,16 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev, static void spapr_machine_device_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { + sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(qdev_get_machine()); + if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { error_setg(errp, "Memory hot unplug not supported by sPAPR"); + } else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE)) { + if (!smc->dr_cpu_enabled) { + error_setg(errp, "CPU hot unplug not supported on this machine"); + return; + } + spapr_core_unplug(hotplug_dev, dev, errp); } } |