From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQJYK-0007Un-Ge for qemu-devel@nongnu.org; Thu, 11 Apr 2013 11:36:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQJYI-0007oD-RU for qemu-devel@nongnu.org; Thu, 11 Apr 2013 11:36:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQJYI-0007ny-In for qemu-devel@nongnu.org; Thu, 11 Apr 2013 11:36:42 -0400 Message-ID: <5166D888.4060907@redhat.com> Date: Thu, 11 Apr 2013 09:36:40 -0600 From: Eric Blake MIME-Version: 1.0 References: <1365693118-6603-1-git-send-email-akong@redhat.com> In-Reply-To: <1365693118-6603-1-git-send-email-akong@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2ESJEQIGKBKJXBAFNLKEF" 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: Amos Kong Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, laine@redhat.com, mst@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ESJEQIGKBKJXBAFNLKEF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > +++ 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'] }} =2E..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" ] --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2ESJEQIGKBKJXBAFNLKEF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRZtiIAAoJEKeha0olJ0Nq0WkH/0p9KuQG6NpXiMfFSth75n11 c0Sn2wIQE5Ia/clt9TFP2Hb14CBEhyLoP8VC+LR8KoL2o/RbGeZXp0JiaxWQEQtO 77bZEyD0JtCtRTqe3nCUx6VxuoqEnfctLcTG4wfIlNuN4k5DmMiEKcqLBYNSed/I sbn+N1JdCRyy+TPH/+Ckkf8VNTuDFmSG2pKMTG8iEobnx7NW5Mm7H4YlVdQ8Z5ii k18UvWtfErXGAXNQvHrtv8vk8AK5g6mVoyUeZsbcO3HggtI8nomedxHOrePtxMWW SGZgZa02vL0rQ91WjexSIoWb65SUviHvVps70IlMQ5MCLJXziPiLZI4yoeHP+TM= =KqJ8 -----END PGP SIGNATURE----- ------enig2ESJEQIGKBKJXBAFNLKEF--