From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxxiZ-00063a-64 for qemu-devel@nongnu.org; Thu, 16 Feb 2012 04:33:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxxiT-0003tj-5g for qemu-devel@nongnu.org; Thu, 16 Feb 2012 04:33:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxxiS-0003tI-TY for qemu-devel@nongnu.org; Thu, 16 Feb 2012 04:33:29 -0500 Message-ID: <4F3CCD64.3070305@redhat.com> Date: Thu, 16 Feb 2012 10:33:24 +0100 From: Igor Mammedov MIME-Version: 1.0 References: <1329347774-23262-1-git-send-email-imammedo@redhat.com> <1329347774-23262-8-git-send-email-imammedo@redhat.com> <4F3C4146.1000905@codemonkey.ws> In-Reply-To: <4F3C4146.1000905@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 7/7] Implement cpu hot-add using device_add monitor command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: jan.kiszka@siemens.com, qemu-devel@nongnu.org, gleb@redhat.com On 02/16/2012 12:35 AM, Anthony Liguori wrote: > On 02/15/2012 05:16 PM, Igor Mammedov wrote: >> Adds ability to hot-add cpus if guest was started with options >> -smp X,maxcpus=Y >> where X< Y. >> For simplicity sake this implementation doesn't allow to add specific >> cpu but rather it adds the next not yet plugged cpu. >> >> For adding cpu just execute following command in monitor: >> device_add cpu-pc >> If guest was started with a specific cpu model, then add option model >> to cmonitor command. for example: >> device_add cpu-pc,model="host" >> >> Signed-off-by: Igor Mammedov > > I don't see how the code matches this description, but unless you've got qdev-ification patches in the earlier ones (haven't made the list yet), > device_add is not the right place for this. Indeed, I've attempted qdev-ify cpu first (patch 2/7) > > There's no such thing as "cpu-pc" either. You should start with a cpu_add command. "cpu-pc" is coming from 2/7 where cpu was qdev-ifed and I needed to call it somehow. Looking at other attempts to qdev-ify cpus i.e. "cpu-ppc", "cpu-mips", I've just followed trend. Is there any suggestions on how it should be called? As for cpu_add command, v1 had patch that introduced somewhat similar cpu_set qmp command. And Jan's opinion on it was that it's not upstream-able, so device_add was used instead. > > Regards, > > Anthony Liguori > >> --- >> hw/pc.c | 11 +++++++++++ >> 1 files changed, 11 insertions(+), 0 deletions(-) >> >> diff --git a/hw/pc.c b/hw/pc.c >> index ec50f16..5923549 100644 >> --- a/hw/pc.c >> +++ b/hw/pc.c >> @@ -44,6 +44,8 @@ >> #include "ui/qemu-spice.h" >> #include "memory.h" >> #include "exec-memory.h" >> +#include "cpus.h" >> +#include "kvm.h" >> >> /* output Bochs bios info messages */ >> //#define DEBUG_BIOS >> @@ -941,6 +943,10 @@ static int cpu_device_init(ICCBusDevice *dev) >> #endif >> } >> >> + if (runstate_is_running()) { >> + pause_all_vcpus(); >> + } >> + >> if (cpu_x86_init_inplace(env, cpu->model)< 0) { >> return -1; >> } >> @@ -949,6 +955,11 @@ static int cpu_device_init(ICCBusDevice *dev) >> env->apic_state = apic_init(env, env->cpuid_apic_id); >> } >> >> + cpu_synchronize_post_init(env); >> + if (runstate_is_running()) { >> + resume_all_vcpus(); >> + acpi_cpu_hot_plug(env->cpuid_apic_id, 1); >> + } >> return 0; >> } >> > -- Thanks, Igor