From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQQsS-0005hB-E9 for qemu-devel@nongnu.org; Thu, 11 Apr 2013 19:26:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQQsR-0001cR-FA for qemu-devel@nongnu.org; Thu, 11 Apr 2013 19:26:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQQsR-0001c9-5s for qemu-devel@nongnu.org; Thu, 11 Apr 2013 19:25:59 -0400 Date: Fri, 12 Apr 2013 07:25:53 +0800 From: Amos Kong Message-ID: <20130411232553.GA1935@t430s.nay.redhat.com> References: <1365693118-6603-1-git-send-email-akong@redhat.com> <5166D888.4060907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5166D888.4060907@redhat.com> Subject: Re: [Qemu-devel] [RFC PATCH] net: introduce monitor command to query mactables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, laine@redhat.com, mst@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.