Received: from eggs.gnu.org ([2001:4830:134:3::10]:60363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOTLs-0006mj-3z for qemu-devel@nongnu.org; Wed, 27 Jan 2016 11:53:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOTLn-0003gY-MI for qemu-devel@nongnu.org; Wed, 27 Jan 2016 11:53:52 -0500 Received: from e17.ny.us.ibm.com ([129.33.205.207]:41482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOTLn-0003gM-Hb for qemu-devel@nongnu.org; Wed, 27 Jan 2016 11:53:47 -0500 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Jan 2016 11:53:47 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 8391838C8056 for ; Wed, 27 Jan 2016 11:53:45 -0500 (EST) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u0RGrjXJ30933022 for ; Wed, 27 Jan 2016 16:53:45 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u0RGriBa003371 for ; Wed, 27 Jan 2016 11:53:45 -0500 From: Matthew Rosato Date: Wed, 27 Jan 2016 11:53:41 -0500 Message-Id: <1453913621-20961-11-git-send-email-mjrosato@linux.vnet.ibm.com> In-Reply-To: <1453913621-20961-1-git-send-email-mjrosato@linux.vnet.ibm.com> References: <1453913621-20961-1-git-send-email-mjrosato@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v3 10/10] 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, bharata@linux.vnet.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 46b1115..7160f33 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) @@ -385,6 +392,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