diff mbox

[1/1] spapr: Prevent boot CPU core removal

Message ID 1469596482-4048-1-git-send-email-bharata@linux.vnet.ibm.com
State New
Headers show

Commit Message

Bharata B Rao July 27, 2016, 5:14 a.m. UTC
Boot CPU is assumed to be always present in QEMU code. So
until that assumptions are gone, deny removal request.
In another words, QEMU won't support boot CPU core hot-unplug.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
---
 hw/ppc/spapr_cpu_core.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

David Gibson July 27, 2016, 6:11 a.m. UTC | #1
On Wed, Jul 27, 2016 at 10:44:42AM +0530, Bharata B Rao wrote:
> Boot CPU is assumed to be always present in QEMU code. So
> until that assumptions are gone, deny removal request.
> In another words, QEMU won't support boot CPU core hot-unplug.
> 
> Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>

Applied to ppc-for-2.7, but I've changed the message slightly to avoid
the ambiguity between:
	un-pluggable - "may not be plugged (or unplugged)"
	unplug-able  - "may be unplugged"

> ---
>  hw/ppc/spapr_cpu_core.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
> index 5a132bf..0dadf48 100644
> --- a/hw/ppc/spapr_cpu_core.c
> +++ b/hw/ppc/spapr_cpu_core.c
> @@ -133,6 +133,11 @@ void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *dev,
>      sPAPRDRConnectorClass *drck;
>      Error *local_err = NULL;
>  
> +    if (index == 0) {
> +        error_setg(errp, "Boot CPU core is unpluggable");
> +        return;
> +    }
> +
>      g_assert(drc);
>  
>      drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
diff mbox

Patch

diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 5a132bf..0dadf48 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -133,6 +133,11 @@  void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *dev,
     sPAPRDRConnectorClass *drck;
     Error *local_err = NULL;
 
+    if (index == 0) {
+        error_setg(errp, "Boot CPU core is unpluggable");
+        return;
+    }
+
     g_assert(drc);
 
     drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);