Re: [Qemu-devel] [PATCH v4 12/15] Add optional parameters to QMP command query-cpu-definitions

2015-03-31 Thread Michael Mueller
On Tue, 31 Mar 2015 16:46:56 -0300
Eduardo Habkost  wrote:

> On Mon, Mar 30, 2015 at 04:28:25PM +0200, Michael Mueller wrote:
> [...]
> >  ##
> >  # @query-cpu-definitions:
> >  #
> >  # Return a list of supported virtual CPU definitions
> >  #
> > +# @machine: #optional machine type (since 2.4)
> > +#
> > +# @accel: #optional accelerator id (since 2.4)
> > +#
> >  # Returns: a list of CpuDefInfo
> >  #
> >  # Since: 1.2.0
> >  ##
> > -{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
> > +{ 'command': 'query-cpu-definitions',
> > +  'data': { '*machine': 'str', '*accel': 'AccelId' },
> > +  'returns': ['CpuDefinitionInfo'] }
> 
> What happens if the new parameters are provided to an old QEMU version
> that doesn't accept them? It looks like we need an introspection
> mechanism or a new command name.

Yep, as Eric mentions:

[mimu@p57lp59 (master) qemu]$ sudo virsh qemu-monitor-command zhyp027 '{ 
"execute":
"query-cpu-definitions", "arguments": { "accel": "kvm", "machine":
"s390-ccw-virtio" } }'

{"id":"libvirt-13","error":{"class":"GenericError","desc":"Invalid parameter 
'accel'"}}



> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] [PATCH v4 12/15] Add optional parameters to QMP command query-cpu-definitions

2015-03-31 Thread Michael Mueller
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Mon, 30 Mar 2015 14:28:01 -0600
Eric Blake  wrote:

> On 03/30/2015 08:28 AM, Michael Mueller wrote:
> > The patch adds optional parameters to the QMP command query-cpu-definitions.
> > Thus the signature of routine arch_query_cpu_definitions needs to be changed
> > for the stub function and all target implementations:
> > 
> > target-arm
> > target-i386
> > target-ppc
> > target-s390
> > 
> > Signed-off-by: Michael Mueller 
> > ---
> 
> > +++ b/qapi-schema.json
> > @@ -2532,21 +2532,31 @@
> >  #
> >  # @name: the name of the CPU definition
> >  #
> > +# @default: #optional defines if cpu model is the default (since 2.4)
> 
> Reads poorly.  How about:
> 
> # @default: #optional true if cpu model is the default, omitted if false
> (since 2.4)

Yep, will change

> 
> 
> > +#
> > +# @runnable: #optional defines if cpu model is runnable (since 2.4)
> 
> Similarly:
> 
> # @runnable: #optional true if cpu model is runnable, omitted if false
> (since 2.4)

here as well

> 
> > +#
> >  # Since: 1.2.0
> >  ##
> >  { 'type': 'CpuDefinitionInfo',
> > -  'data': { 'name': 'str' } }
> > +  'data': { 'name': 'str', '*is-default': 'bool', '*runnable': 'bool' } }
> >  
> >  ##
> >  # @query-cpu-definitions:
> >  #
> >  # Return a list of supported virtual CPU definitions
> >  #
> > +# @machine: #optional machine type (since 2.4)
> > +#
> > +# @accel: #optional accelerator id (since 2.4)
> 
> Maybe mention that these two fields are for filtering results.

I will add a comment as it is more than filtering, it is execution context 
information that allows
to determine if a cpu model is runnable.

Thanks a lot,
Michael

> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBAgAGBQJVGk/gAAoJELPcPLQSJsKQ9qcQAJiURTXS+NZO/kmKfP1aH18s
RC/bhXyV6gVmfsvZ1X7S0cH5eO4Z7AfpNNT73Mw0lYDIXei+94/Mdby4AplF7S8q
RoPVu9KxWXV6oM1nigEMvExt5n6BxIM3+/xvKt1Rkef4cx8qIRju+rCLNekmBd3E
yJtSs3Oasft8LoG+4ZPEv26jC7uvHa04bp1nZslXhgUmbUJZzRtArRohp0JA0kfl
BIzpFSKJEvGB/xwyj4bvfC4NQJ9nMtel6BhO04oxHgQNXmpaJK4vN5h7wi6PG2ac
I7mKhC/nNFPUXvQUGQ91itWH/ir1fyim4Rjhtd2Pvpq19waEg2M+dHp2YKAqg1xd
YrHpAQA/6MLqlBqrsqYzVS/LHz7juXP3u/sX5azdbZY8LPynAXqnSwqiNinvk2bA
sc3NG/JwZnbtASFrjJEpmrudS29IXuNNycISzGwrL06pwgmrFaJkpyzD6gOkJfnh
UByIMqTYskk3yP8G8K4n6775al0Zx8v39E7En+dQozEnVa/SxA5YdjJMVPOZiEt4
O/szkqCr5kcQHZJ/x42Sz0YFZ5QIidhMkX6jEqeak7q0Ow0awXgreuxXEmPYu6lG
5wHo6WP1h6tdogQnJGnyFXC5kWzp2iBYxVDP86/4aKLGyZViNPS1XDSjhd9NH4X/
9IPbCIOJYwpZF9l5GeG/
=JAwu
-END PGP SIGNATURE-


Re: [Qemu-devel] [PATCH v4 12/15] Add optional parameters to QMP command query-cpu-definitions

2015-03-30 Thread Eric Blake
On 03/30/2015 08:28 AM, Michael Mueller wrote:
> The patch adds optional parameters to the QMP command query-cpu-definitions.
> Thus the signature of routine arch_query_cpu_definitions needs to be changed
> for the stub function and all target implementations:
> 
> target-arm
> target-i386
> target-ppc
> target-s390
> 
> Signed-off-by: Michael Mueller 
> ---

> +++ b/qapi-schema.json
> @@ -2532,21 +2532,31 @@
>  #
>  # @name: the name of the CPU definition
>  #
> +# @default: #optional defines if cpu model is the default (since 2.4)

Reads poorly.  How about:

# @default: #optional true if cpu model is the default, omitted if false
(since 2.4)


> +#
> +# @runnable: #optional defines if cpu model is runnable (since 2.4)

Similarly:

# @runnable: #optional true if cpu model is runnable, omitted if false
(since 2.4)

> +#
>  # Since: 1.2.0
>  ##
>  { 'type': 'CpuDefinitionInfo',
> -  'data': { 'name': 'str' } }
> +  'data': { 'name': 'str', '*is-default': 'bool', '*runnable': 'bool' } }
>  
>  ##
>  # @query-cpu-definitions:
>  #
>  # Return a list of supported virtual CPU definitions
>  #
> +# @machine: #optional machine type (since 2.4)
> +#
> +# @accel: #optional accelerator id (since 2.4)

Maybe mention that these two fields are for filtering results.

-- 
Eric Blake   eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature