On 03/26/2016 12:56 PM, Igor Mammedov wrote: > it will allow mgmt to query present and hotpluggable > CPU objects, it is required from a target platform that > wish to support command to implement and set > MachineClass.query_hotpluggable_cpus > callback, which will return a list of possible CPU objects > with options that would be needed for hotplugging possible > CPU objects. > > There are: > 'type': 'str' - QOM CPU object type for usage with device_add > 'vcpus-count': 'int' - number of logical VCPU threads per > CPU object (mgmt needs to know) > > and a set of optional fields that are to used for hotplugging > a CPU objects and would allows mgmt tools to know what/where > it could be hotplugged; > [node],[socket],[core],[thread] > > For present CPUs there is a 'qom-path' field which > would allow mgmt to inspect whatever object/abstraction > the target platform considers as CPU object. > > Signed-off-by: Igor Mammedov <imamm...@redhat.com> > ---
> +++ b/qapi-schema.json > @@ -4126,3 +4126,44 @@ > ## > { 'enum': 'ReplayMode', > 'data': [ 'none', 'record', 'play' ] } > + > +## > +# CpuInstanceProperties > +# > +# @node: NUMA node ID the CPU belongs to, optional Mark this with '#optional', like you do in the other members. > +# @socket: #optional socket number within node/board the CPU belongs to > +# @core: #optional core number within socket the CPU belongs to > +# @thread: #optional thread number within core the CPU belongs to > +# > +# Since: 2.7 > +{ 'struct': 'CpuInstanceProperties', Missing ## trailing doc marker. Doesn't matter quite yet, but will once Marc-Andre's patches for automated doc generation land. > + 'data': { '*node': 'int', > + '*socket': 'int', > + '*core': 'int', > + '*thread': 'int' > + } > +} > + > +## > +# @HotpluggableCPU > +# > +# @type: CPU object type for usage with device_add command > +# @props: list of properties to be used for hotplugging CPU > +# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides > +# @qom-path: #optional link to existing CPU object if CPU is present or > +# omitted if CPU is not present. > +# > +# Since: 2.7 > +{ 'struct': 'HotpluggableCPU', Another missing ## > + 'data': { 'type': 'str', > + 'vcpus-count': 'int', > + 'props': 'CpuInstanceProperties', > + '*qom-path': 'str' > + } > +} > + > +## > +# @query-hotpluggable-cpus > +# > +# Since: 2.7 > +{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] } Looks okay. > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 9e05365..85ffba3 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -4853,3 +4853,46 @@ Example: > {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840, > "pop-vlan": 1, "id": 251658240} > ]} > + > +EQMP > + > + { > + .name = "query-hotpluggable-cpus", > + .args_type = "", > + .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus, > + }, > + > +SQMP > +Show existing/possible CPUs Why two spaces? > +------------------------------- Line is too long. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature