From: Amos Kong <akong@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, laine@redhat.com,
mst@redhat.com
Subject: Re: [Qemu-devel] [RFC PATCH] net: introduce monitor command to query mactables
Date: Fri, 12 Apr 2013 07:25:53 +0800 [thread overview]
Message-ID: <20130411232553.GA1935@t430s.nay.redhat.com> (raw)
In-Reply-To: <5166D888.4060907@redhat.com>
Hi Eric,
On Thu, Apr 11, 2013 at 09:36:40AM -0600, Eric Blake wrote:
> On 04/11/2013 09:11 AM, Amos Kong wrote:
> > We want to do macvtap programming by libvirt, this patch added
> > a monitor command to query rx mode information. I will also
> > work on another patch to add QMP event notification for rx-mode
> > changing. Libvirt will sync the rx-mode change to macvtap
> > devices, there maybe exist an un-controlled delay, guests
> > normally expect rx mode updates immediately, it's another
> > separate issue.
> >
>
> > +++ b/qapi-schema.json
> > @@ -3513,3 +3513,40 @@
> > '*asl_compiler_rev': 'uint32',
> > '*file': 'str',
> > '*data': 'str' }}
> > +
> > +# @MacTableInfo:
> > +#
> > +# Mac table information.
> > +#
> > +# @name: the name of nic device
> > +#
> > +# @unicast: #optional a list of unicast mac strings
> > +#
> > +# @multicast: #optional a list of multicast mac strings
>
> Quite a few undocumented fields in relation to...
>
> > +#
> > +# Since 1.5
> > +##
> > +{ 'type': 'MacTableInfo',
> > + 'data': {
> > + 'name': 'str',
> > + '*promisc': 'bool',
> > + '*allmulti': 'bool',
> > + '*alluni': 'bool',
> > + '*nomulti': 'bool',
> > + '*nouni': 'bool',
> > + '*nobcast': 'bool',
> > + '*multi_overflow': 'bool',
> > + '*uni_overflow': 'bool',
> > + '*unicast': ['String'],
> > + '*multicast': ['String'] }}
>
> ...the size of the struct itself.
Ok.
> Why ['String'] instead of the simpler ['str']? That's just adding
> additional JSON structure for no discernible gain (unless it is a
> workaround for a weakness in the code generation tool not allowing an
> array of a native JSON type - in which case, let's fix that).
Yes, 'str' is the native JSON type, but strList is not defined
by default, I will fix it in next version.
> s/_overflow/-overflow/2 - we prefer '-' over '_' in new QMP interfaces.
got it.
> > +
> > +##
> > +# @query-mac-table:
> > +#
> > +# Return mac tables information of nic devices
> > +#
> > +# Returns: @MacTableInfo on success
> > +#
> > +# Since: 1.5
> > +##
> > +{ 'command': 'query-mac-table', 'returns': ['MacTableInfo'] }
>
> Seems useful.
>
> > +-> { "execute": "query-mac-table"}
> > +<- {"return": [
> > + {
> > + "name": "virtio-net-pci.0",
> > + "uni_overflow": false,
> > + "nobcast": false,
> > + "promisc": ,
>
> Invalid JSON.
I wanted to edit it to true manually ;)
> > + "nouni": false,
> > + "nomulti": false,
> > + "allmulti": false,
> > + "multi_overflow": false,
> > + "alluni": false
> > + "unicast": [
> > + {
> > + "str": "33:33:ff:00:00:00"
> > + }
>
> If you use 'str' instead of 'String', this would be:
>
> "unicast": [ "33:33:ff:00:00:00" ]
Yeah, the expected format should be(after fixed the native type 'str'):
"unicast": [ "33:33:ff:00:00:00",
"33:33:ff:00:00:01",
"33:33:ff:00:00:02" ]
Thanks.
--
Amos.
next prev parent reply other threads:[~2013-04-11 23:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-11 15:11 [Qemu-devel] [RFC PATCH] net: introduce monitor command to query mactables Amos Kong
2013-04-11 15:33 ` Michael S. Tsirkin
2013-04-11 15:44 ` Amos Kong
2013-04-11 15:36 ` Eric Blake
2013-04-11 23:25 ` Amos Kong [this message]
2013-04-16 8:11 ` Stefan Hajnoczi
2013-04-18 2:51 ` Amos Kong
2013-04-18 7:27 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130411232553.GA1935@t430s.nay.redhat.com \
--to=akong@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=eblake@redhat.com \
--cc=laine@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).