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?

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).  Or are you asking how macaddr
strings within multicast-table are sorted (JSON arrays DO convey
ordering relations), rather than how the name-value pairs are (not)
sorted in the overall array entry dictionary?

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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to