All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Amos Kong <akong@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: Thu, 11 Apr 2013 09:36:40 -0600	[thread overview]
Message-ID: <5166D888.4060907@redhat.com> (raw)
In-Reply-To: <1365693118-6603-1-git-send-email-akong@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2749 bytes --]

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.

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).

s/_overflow/-overflow/2 - we prefer '-' over '_' in new QMP interfaces.

> +
> +##
> +# @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.

> +            "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" ]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  parent reply	other threads:[~2013-04-11 15:36 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 [this message]
2013-04-11 23:25   ` Amos Kong
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=5166D888.4060907@redhat.com \
    --to=eblake@redhat.com \
    --cc=akong@redhat.com \
    --cc=aliguori@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.