[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 1/2] slirp: Add "query-usernet" QMP command
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v4 1/2] slirp: Add "query-usernet" QMP command |
Date: |
Thu, 3 May 2018 09:25:14 +0800 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
On Wed, 05/02 14:41, Eric Blake wrote:
> On 05/02/2018 02:30 AM, Fam Zheng wrote:
> > HMP "info usernet" has been available but it isn't ideal for programmed
> > use cases. This closes the gap in QMP by adding a counterpart
> > "query-usernet" command. It is basically translated from
> > the HMP slirp_connection_info() loop, which now calls the QMP
> > implementation and prints the data, just like other HMP info_* commands.
> >
> > The TCPS_* macros are now defined as a QAPI enum.
> >
> > Signed-off-by: Fam Zheng <address@hidden>
> > ---
>
> > +##
> > +# @UsernetInfo:
> > +#
> > +# SLIRP usernet information.
> > +#
> > +# Since: 2.13
> > +##
> > +{ 'struct': 'UsernetInfo',
> > + 'data': {
> > + 'id': 'str',
> > + 'hub': 'int',
> > + 'connections': ['UsernetConnection']
> > +} }
> > +
> > +##
> > +# @query-usernet:
> > +#
> > +# Return SLIRP network information.
> > +#
> > +# Since: 2.13
> > +#
> > +# Example:
> > +#
> > +# -> { "execute": "query-usernet", "arguments": { } }
> > +# <- { "return": [
> > +# {
> > +# "promiscuous": true,
> > +# "name": "vnet0"
>
> That example looks wrong; I'm expecting 'id', 'hub', and another array
> 'connections'.
Copy-pasto. Will fix.
Fam
>
> > +# }
> > +# ]
> > +# }
> > +#
> > +##
> > +{ 'command': 'query-usernet',
> > + 'returns': ['UsernetInfo'] }
>
> Other than the botched example, the qapi additions look okay to me.
>
> --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc. +1-919-301-3266
> Virtualization: qemu.org | libvirt.org