From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgrbK-0003cA-0h for qemu-devel@nongnu.org; Mon, 27 May 2013 03:12:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgrbH-0006xF-8Z for qemu-devel@nongnu.org; Mon, 27 May 2013 03:12:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgrbH-0006x6-1J for qemu-devel@nongnu.org; Mon, 27 May 2013 03:12:11 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4R7C93k017663 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 27 May 2013 03:12:09 -0400 Date: Mon, 27 May 2013 15:12:06 +0800 From: Amos Kong Message-ID: <20130527071206.GA6120@t430s.nay.redhat.com> References: <1369377846-18439-1-git-send-email-akong@redhat.com> <20130524120345.GB8669@redhat.com> <519F5C80.1020200@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <519F5C80.1020200@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4] net: introduce command to query rx-filter information List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, "Michael S. Tsirkin" 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.