Received: from eggs.gnu.org ([2001:4830:134:3::10]:39690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYXf0-0000B5-CA for qemu-devel@nongnu.org; Wed, 24 Feb 2016 06:31:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYXeu-0006ZR-HJ for qemu-devel@nongnu.org; Wed, 24 Feb 2016 06:31:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYXeu-0006Z7-9Z for qemu-devel@nongnu.org; Wed, 24 Feb 2016 06:31:08 -0500 Date: Wed, 24 Feb 2016 12:31:03 +0100 From: Igor Mammedov Message-ID: <20160224123103.6854f0f9@nial.brq.redhat.com> In-Reply-To: <87d1rm1oc2.fsf@blackfin.pond.sub.org> References: <1455556228-232720-1-git-send-email-imammedo@redhat.com> <878u2lhi8i.fsf@blackfin.pond.sub.org> <20160216113655.2bbb9988@nial.brq.redhat.com> <20160218033952.GG15224@voom.fritz.box> <20160218113739.64b02461@nial.brq.redhat.com> <20160219043848.GZ15224@voom.fritz.box> <20160219164911.091b4351@nial.brq.redhat.com> <20160222025432.GD2808@voom.fritz.box> <20160223104645.6b64f60c@nial.brq.redhat.com> <87d1rm1oc2.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] QMP: add query-hotpluggable-cpus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: lvivier@redhat.com, thuth@redhat.com, Peter Krempa , ehabkost@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, abologna@redhat.com, bharata@linux.vnet.ibm.com, pbonzini@redhat.com, afaerber@suse.de, David Gibson On Wed, 24 Feb 2016 09:53:33 +0100 Markus Armbruster wrote: > Igor Mammedov writes: > > > On Mon, 22 Feb 2016 13:54:32 +1100 > > David Gibson wrote: > [...] > >> This is why Eduardo suggested - and I agreed - that it's probably > >> better to implement the "1st layer" as an internal structure/interface > >> only, and implement the 2nd layer on top of that. When/if we need to > >> we can revisit a user-accessible interface to the 1st layer. > > We are going around QOM based CPU introspecting interface for > > years now and that's exactly what 2nd layer is, just another > > implementation. I've just lost hope in this approach. > > > > What I'm suggesting in this RFC is to forget controversial > > QOM approach for now and use -device/device_add + QMP introspection, > > i.e. completely split interface from how boards internally implement > > CPU hotplug. > > QMP introspection doesn't tell you anything about device_add now. > Covering device_add is hard, because introspection data is fixed at > compile-time, but device models are collected only at run time. Worse, > non-qdev QOM properties are buried in code, which you have to run to > find them. See also my slide 39 of my KVM Form 2015 presentation > http://events.linuxfoundation.org/sites/events/files/slides/armbru-qemu-introspection.pdf > > But perhaps you means something else. It seems we are talking about different problems here. Goal of query-hotpluggable-cpus QMP command is not about -device cpu-foo introspection, but rather about providing a board specific runtime information about: - which CPU objects are present/possible and where - what[which CPU types] + with which properties values a new CPU[socket|core|thread] could be hotplugged For example query-hotpluggable-cpus could return: QEMU -cpu cpu_model_X -smp 2,threads=2,cores=3,maxcpus=6 -> { "execute": "query-hotpluggable-cpus" } <- {"return": [ {"core": 0, "type": "qemu64-power-core", "link" = "/machine/unattendended/device[X]"}, {"core": 1, "type": "qemu64-power-core"}, {"core": 2, "type": "qemu64-power-core"}, then to hotplug a CPU one could execute: device_add qemu64-power-core,core=2; then when it comes to migrating it's typical routine, target started like this: qemu-power -cpu cpu_model_X -smp 2,threads=2,cores=3,maxcpus=6 \ -device qemu64-power-core,core=2