qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4] net: introduce command to query rx-filter in


From: Amos Kong
Subject: Re: [Qemu-devel] [PATCH v4] net: introduce command to query rx-filter information
Date: Mon, 27 May 2013 15:12:06 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 24, 2013 at 06:26:40AM -0600, Eric Blake wrote:
> On 05/24/2013 06:03 AM, Michael S. Tsirkin wrote:
> > On Fri, May 24, 2013 at 02:44:06PM +0800, Amos Kong wrote:
> >> We want to implement mac programming over macvtap through Libvirt. The
> >> related rx-filter information of the nic contains main mac, rx-mode
> >> items.
> >>
> 
> >> +Each array entry contains the following:
> >> +
> >> +- "name": net client name (json-string)
> >> +- "promiscuous": promiscuous mode is enabled (json-bool)
> >> +- "multicast": multicast receive state (one of 'normal', 'none', 'all')
> >> +- "unicast": unicast receive state  (one of 'normal', 'none', 'all')
> >> +- "broadcast-allowed": allow to receive broadcast (json-bool)
> >> +- "multicast-overflow": multicast table is overflowed (json-bool)
> >> +- "unicast-overflow": unicast table is overflowed (json-bool)
> >> +- "main-mac": main macaddr string (json-string)
> >> +- "unicast-table": a json-array of unicast macaddr string
> >> +- "multicast-table": a json-array of multicast macaddr string
> > 
> > How are these sorted by the way?
 
The order is same as in 'struct VirtIONet'. I just keep this order match
the order in qapi-schema.json.

> They don't have to be - JSON uses name-value pairs in dictionaries
> precisely because they aren't sorted.  However, it looks like you
> matched the order that you listed in the qapi-schema.json file, which is
> as good as any (even if it differs from the random hash ordering
> demonstrated in your example below).

Yes.

> Or are you asking how macaddr
> strings within multicast-table are sorted (JSON arrays DO convey
> ordering relations),

macaddr strings order in QMP output is decided by python dictionary.
macaddr strings order in HMP output is same as the order in guest
mac-table.

> rather than how the name-value pairs are (not)
> sorted in the overall array entry dictionary?

-- 
                        Amos.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]