Received: from [140.186.70.92] (port=48562 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLdpt-0001Oa-Tf for qemu-devel@nongnu.org; Mon, 07 Jun 2010 11:02:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OLdpn-0000Hh-Cl for qemu-devel@nongnu.org; Mon, 07 Jun 2010 11:01:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29805) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OLdpn-0000HV-67 for qemu-devel@nongnu.org; Mon, 07 Jun 2010 11:01:51 -0400 From: Markus Armbruster Subject: Re: [Qemu-devel] Re: [RFC] QMP: Introduce query-netdevices documentation References: <1275660360-12137-1-git-send-email-miguel.filho@gmail.com> <4C0BC3C4.6010207@redhat.com> <4C0CF67B.8080601@redhat.com> <4C0CF89A.9030202@codemonkey.ws> Date: Mon, 07 Jun 2010 17:01:45 +0200 In-Reply-To: (Miguel Di Ciurcio Filho's message of "Mon, 7 Jun 2010 11:41:16 -0300") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Miguel Di Ciurcio Filho Cc: qemu-devel@nongnu.org, Avi Kivity , lcapitulino@redhat.com Miguel Di Ciurcio Filho writes: > On Mon, Jun 7, 2010 at 10:48 AM, Anthony Liguori = wrote: >>>> >>>> $ qemu -netdev tap,id=3Dtap0 -device e1000,netdev=3Dtap0 >>>> >>>> This makes a 1:1 relation. So clearly tap0 is a host device, e1000.0 >>>> will be a guest device, and they are connected. >>> >>> Yes. =C2=A0I'd want separate queries for each, or perhaps a single quer= y that >>> returns >>> >>> { 'hostdev': some-object-with-host-device-properties-only, 'nic': >>> some-object-that-describes-the-guest-nic } >> >> We need a query-netdev and then info qdm already provides the guest nic >> properties. =C2=A0Just filter out devices that have a netdev property. >> > > How about this small draft: > > Possible values for "type": tap, user, vde and socket. The 'info' > object contains all the parameters available via -netdev type,args. > > Notice: vlan is still there, unless the support for it is removed, IMHO. Agreed. As long as we have VLANs, we better cover them here. > -> { "execute": "query-netdev" } > <- { > "return": [ > { > "device": "tap.0", > "vlan": 0, > "type": "tap", > "info": { > "script": "/etc/qemu-ifup", > "downscript": "/etc/qemu-ifdown", > "ifname": "tap0", > }, This one's connected to a VLAN, namely #0. Any guest device on the same VLAN has a "vlan" property with the value 0. > { > "device": "user.0", > "type": "user", > "info": { > "net": "10.0.2.0", > "netmask": "255.255.255.0" > }, > }, And this one's not connected to a VLAN. It may or may not be connected to a single guest device. If it is, then that device has a "netdev" property pointing to it. For what it's worth, "info network" shows that device as "peer=3DID".