From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzQr5-0005Cb-T7 for qemu-devel@nongnu.org; Thu, 19 Nov 2015 10:10:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzQr1-00068a-RQ for qemu-devel@nongnu.org; Thu, 19 Nov 2015 10:10:35 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:33500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzQr1-00068T-Bd for qemu-devel@nongnu.org; Thu, 19 Nov 2015 10:10:31 -0500 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 19 Nov 2015 08:10:30 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id F2F5B19D8041 for ; Thu, 19 Nov 2015 07:58:32 -0700 (MST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tAJFAOOq27197564 for ; Thu, 19 Nov 2015 08:10:24 -0700 Received: from d03av05.boulder.ibm.com (localhost [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tAJFAMQ2017386 for ; Thu, 19 Nov 2015 08:10:22 -0700 From: Matthew Rosato Date: Thu, 19 Nov 2015 10:10:14 -0500 Message-Id: <1447945814-15765-10-git-send-email-mjrosato@linux.vnet.ibm.com> In-Reply-To: <1447945814-15765-1-git-send-email-mjrosato@linux.vnet.ibm.com> References: <1447945814-15765-1-git-send-email-mjrosato@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2 9/9] s390x/cpu: Allow hot plug/unplug of CPUs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: agraf@suse.de, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, afaerber@suse.de, rth@twiddle.net Allow hotplug of s390-cpu devices via device_add, and unplug via device_del. Signed-off-by: Matthew Rosato --- target-s390x/cpu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 4b83a09..a4be7b7 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -31,6 +31,7 @@ #include "trace.h" #ifndef CONFIG_USER_ONLY #include "sysemu/arch_init.h" +#include "hw/s390x/sclp.h" #include "sysemu/sysemu.h" #endif @@ -225,6 +226,12 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp) #endif scc->parent_realize(dev, errp); + +#if !defined(CONFIG_USER_ONLY) + if (dev->hotplugged) { + raise_irq_cpu_hotplug(); + } +#endif } static void s390_cpu_initfn(Object *obj) @@ -398,6 +405,10 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) scc->parent_realize = dc->realize; dc->realize = s390_cpu_realizefn; + /* Necessary prep-work for s390-cpu is handled in + * instance_init() and realize(), so allow device_add */ + dc->cannot_instantiate_with_device_add_yet = false; + scc->parent_reset = cc->reset; #if !defined(CONFIG_USER_ONLY) scc->load_normal = s390_cpu_load_normal; -- 1.9.1