From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFZ1E-0001a6-K7 for qemu-devel@nongnu.org; Sun, 25 Jan 2015 21:03:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFZ19-0003mC-JL for qemu-devel@nongnu.org; Sun, 25 Jan 2015 21:03:12 -0500 Received: from [59.151.112.132] (port=30409 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFZ19-0003lY-84 for qemu-devel@nongnu.org; Sun, 25 Jan 2015 21:03:07 -0500 Message-ID: <1422237708.23881.5.camel@G08FNSTD140041> From: Zhu Guihua Date: Mon, 26 Jan 2015 10:01:48 +0800 In-Reply-To: <884906902.4955995.1422008657285.JavaMail.zimbra@oxygem.tv> References: <884906902.4955995.1422008657285.JavaMail.zimbra@oxygem.tv> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexandre DERUMIER Cc: qemu-devel , tangchen@cn.fujitsu.com, chen fan fnst , isimatu yasuaki , Igor Mammedov , guz fnst , Anshul Makkar , afaerber On Fri, 2015-01-23 at 11:24 +0100, Alexandre DERUMIER wrote: > Hello, > > I'm currently testing the new cpu unplug features, > Works fine here with debian guests and kernel 3.14. > Thanks for your test. > But I have notice some small potential bugs, but I'm not sure I'm doing it right. > > 1)first, to unplug cpu, we need an id for cpu > Yes, if you want to unplug cpu, you must have an id for cpu. > The problem is that the current qemu command line > -smp 1,sockets=2,cores=1,maxcpus=2 > > for example, will create 1 cpu on apic-id 0 without any id, so we can't unplug it. > > > So, I have tried with > > -smp 1,sockets=2,cores=1,maxcpus=2 -device kvm64-x86_64-cpu,apic-id=0,id=cpu0 > > But this give me an error: > "-device kvm64-x86_64-cpu,apic-id=0,id=cpu0: CPU with APIC ID 0 exists" > APIC ID 0 was used by the cpu of '-smp 1'. So you should use apic-id=1 > (also try to set -smp 0, but it's not working). > > > > 2) second problem, if I start with > -smp 1,sockets=2,cores=1,maxcpus=2 > > then hmp: > device_add kvm64-x86_64-cpu,apic-id=1,id=cpu1 > > then hmp : device_del cpu1 > > Got an error:" > This is the last cpu, should not be removed!" > > Oh, it's our problem, thanks for your pointing out. I will fix it in next version. Regards, Zhu > > This is coming from > [PATCH 06/12] pc: add cpu hot unplug request callback support > + if (smp_cpus == 1) { > + error_setg(&local_err, > + "This is the last cpu, should not be removed!"); > + goto out; > + } > > > > So, the only way unplug is working for me, is to start with -smp 2 minimum > -smp 2,sockets=2,cores=1,maxcpus=4 > > Then I can hotplug|unplug cpuid >= 2 > > > > Regards, > > Alexandre Derumier [...]