From patchwork Fri Jun 4 14:06:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Di Ciurcio Filho X-Patchwork-Id: 54598 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 26171B7D2E for ; Sat, 5 Jun 2010 00:39:59 +1000 (EST) Received: from localhost ([127.0.0.1]:44200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKY3v-0007y1-IK for incoming@patchwork.ozlabs.org; Fri, 04 Jun 2010 10:39:55 -0400 Received: from [140.186.70.92] (port=56558 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKXXo-0002yh-D2 for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKXXl-0001Cx-VA for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:06:43 -0400 Received: from mail-pv0-f173.google.com ([74.125.83.173]:44077) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKXXl-0001Ck-QX for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:06:41 -0400 Received: by pvg12 with SMTP id 12so607357pvg.4 for ; Fri, 04 Jun 2010 07:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=FKJA4hbyVILEa368TnY9tMCtNoQMaNdQpQ8fEYZLCqg=; b=T31od0t4TAX9aYIhwWmGRmbBdX1Bxb/tYMBjzuFKW4u0TIsu9YKPNIe7GsO466B1S3 li4SePE3/FQiVX3xX21DMvILJyQ8zTdd3IUKuBSHxvEt0u6DzJI3H2tPO68I0X/yFcCU xW6qMUHPUE+N2BubJq6HkMph5KMvLnDseT2X8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=D42Xhemqez7haT8zvKU9olTYZ/PjRQhyAoa6bTi3VPVMcnTF2offaOXK9sb2yxUtpA PTtYYgTSeRF3ZD/LKOAyR1N7iW9A8TOk0ZsE6oDfazd15qZGohKslUBuWnrO387NmpUB aZ8vuHtrMLzPWqwe5OFy6caMaE+gF4lx3+px0= Received: by 10.115.84.40 with SMTP id m40mr8635707wal.223.1275660400575; Fri, 04 Jun 2010 07:06:40 -0700 (PDT) Received: from localhost.localdomain ([189.61.230.202]) by mx.google.com with ESMTPS id b6sm9055086wam.9.2010.06.04.07.06.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Jun 2010 07:06:38 -0700 (PDT) From: Miguel Di Ciurcio Filho To: qemu-devel@nongnu.org Date: Fri, 4 Jun 2010 11:06:00 -0300 Message-Id: <1275660360-12137-1-git-send-email-miguel.filho@gmail.com> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: lcapitulino@redhat.com, avi@redhat.com, armbru@redhat.com Subject: [Qemu-devel] [RFC] QMP: Introduce query-netdevices documentation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This introduces the protocol specification for querying information about network devices available on a VM and a new monitor command that show the same information. Signed-off-by: Miguel Di Ciurcio Filho --- qemu-monitor.hx | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 69 insertions(+), 0 deletions(-) diff --git a/qemu-monitor.hx b/qemu-monitor.hx index f6a94f2..8600129 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -1674,6 +1674,75 @@ show the various VLANs and the associated devices ETEXI STEXI +@item info netdevices +show information about network devices +ETEXI +SQMP +query-netdevices +---------------- + +Each device is represented by a json-object. The returned value is a json-array +of all devices. + +Each json-object contain the following: + +- "device": device name (json-string) +- "vlan": only present if the device is attached to a VLAN (json-int) +- "info": json-object containing the following: + - "model": type of the device (json-string) + - Possible values: "tap", "socket", "xen", "slirp", "dump", + "vde", "ne2k_pci", "i82551", "i82557b", + "i82559er", "rtl8139", "e1000", "pcnet", + "virtio", "dp83932", "lan9118", "mcf_fec", + "xilinx-ethlite", "lance", "stellaris", + "smc91c111", "ne2k_isa", "mv88w8618", + "mipsnet", "fseth", "dp83932", "usb" + - "macaddr": MAC address, only present if the device is a NIC + (json-string) + - "script": path to script used to configure the device, only present + if "model" is "tap" (json-string) + - "downscript": path to script used to deconfigure the device, only + present if "model" is "tap" (json-string) + - "fd": handle to the device, only present if "model" is "vde" + (json-int) + - "ifname": name of the host device connected to the guest device, + only present if "model" is "tap" (json-string) + - "host": IP address, only present if "model" is "socket" + (json-string) + - "service": port number, only present if "model" is "socket" + - "family": address familyi, only present if "model" is "socket" + (json-string) + - Possible values: "ipv4" + +Example: + +-> { "execute": "query-netdevices" } +<- { + "return": [ + { + "device": "tap.0", + "vlan": 0, + "info": { + "script": "/etc/kvm/kvm-ifup", + "downscript": "/etc/qemu-ifdown", + "ifname": "tap0", + "model": "tap" + }, + }, + { + "device": "e1000.0", + "vlan": 0, + "info": { + "model": "e1000", + "macaddr": "52:54:00:12:34:56" + }, + } + ] + } + +EQMP + +STEXI @item info chardev show the character devices ETEXI