From patchwork Fri Jun 18 16:26:27 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: 56207 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 E5552B7D8A for ; Sat, 19 Jun 2010 02:28:52 +1000 (EST) Received: from localhost ([127.0.0.1]:56481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPeR0-0008DB-3v for incoming@patchwork.ozlabs.org; Fri, 18 Jun 2010 12:28:50 -0400 Received: from [140.186.70.92] (port=54368 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OPeQ0-0008Am-Nk for qemu-devel@nongnu.org; Fri, 18 Jun 2010 12:27:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OPePz-0003Ft-Ff for qemu-devel@nongnu.org; Fri, 18 Jun 2010 12:27:48 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:59714) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OPePz-0003Fh-9F for qemu-devel@nongnu.org; Fri, 18 Jun 2010 12:27:47 -0400 Received: by gyd5 with SMTP id 5so997720gyd.4 for ; Fri, 18 Jun 2010 09:27:46 -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=nP8o3Ko3KvFsOl34wrAAIjF8mvSZd4C1+KejNxNvLKs=; b=VjjKuIsO6q4rLbo68N1FxiMBeEEdFaMVk0Kb2yXOhl6lDMVwPk80A/rtQ8wxNotBr0 DzKJzRTQbM7u6IJJyQ7PLtZzUAlhnSI/DcHSAJAJbBLHWV5oY9jvcr+8WAxzztTq4qpD 1JdUjEJcSJh6BzzVOXpvS5Cefln7hEQPI0HjE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=Gjg699AZZPMrfmIs3JVNsc6TEyxfVwK5dN+K36VGhvSOWlEdI3cSorGLdg3Jqx2E0m lpWsqGSniPFZZcbJu3NjI8ik9qMnDONusFmcG1HKKojrj4717lf86G/IpmiV52Lp/7Ej ugMToOsIVUi7NKxOSsDslFTzTflygUoTf0X9A= Received: by 10.151.1.24 with SMTP id d24mr1203147ybi.319.1276878466058; Fri, 18 Jun 2010 09:27:46 -0700 (PDT) Received: from localhost.localdomain ([189.61.230.202]) by mx.google.com with ESMTPS id p5sm14675100ybe.24.2010.06.18.09.27.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 18 Jun 2010 09:27:44 -0700 (PDT) From: Miguel Di Ciurcio Filho To: qemu-devel@nongnu.org Date: Fri, 18 Jun 2010 13:26:27 -0300 Message-Id: <1276878387-9489-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: armbru@redhat.com, Miguel Di Ciurcio Filho , avi@redhat.com, lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH v2] QMP: Introduce the documentation for query-netdev and info netdev 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 These commands show the information about active backend network devices. Signed-off-by: Miguel Di Ciurcio Filho --- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-) diff --git a/qemu-monitor.hx b/qemu-monitor.hx index 9f62b94..8fc5ed6 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -1674,6 +1674,111 @@ show the various VLANs and the associated devices ETEXI STEXI +@item info netdev +show information about the current backend network devices +ETEXI +SQMP +query-netdev +------------ + +Each device is represented by a json-object. The returned value is a json-array +of all devices. + +Each json-object contains the following: + +- "id": the device's ID, must be unique (json-string) +- "type": device type (json-string) + - Possible values: "tap", "user", "vde", "socket" +- "vlan": QEMU's internal vlan identification. Only present if the device is + attached to a VLAN (json-int, optional) +- "peer": ID of the frontend device when on a 1:1 relationship (json-string, + optional) +- "info": json-object containing the configuration information about the device. + - When "type" is "tap", the following values might be available: + - "fd": available if connected to an already opened TAP interface + (json-int, optional) + - "script": path to an script used to configure the interface, if + the value is "no" then no script is used. (json-string, only + present if "fd" is not present) + - "downscript": path to an script used to deconfigure the interface, + if the value is "no" then no script is used. (json-string, only + present if "fd" is not present) + - "ifname": name of the attached host interface (json-string, only + present if "fd" is not present) + - "vhost": vhost acceleration status, true if enabled, false + otherwise (json-boolean) + - "vnet_hdr": true if the IFF_VNET_HDR flag must be set, false + otherwise (json-boolean) + - "vhostfd": positive number if the device is connected to an + already opened vhost net device, -1 otherwise (json-int) + - "sndbuf": send buffer size, in bytes (json-int) + - When "type" is "vde", the following values might be available: + - "sock": path to the VDE listening socket (json-string) + - "port": port number connected to virtual switch (json-int) + - "group": group name (json-string) + - "mode": permission mode, in octal (json-int) + - When "type" is "user", the following values might be available: + - "hostname": client hostname reported by the builtin DHCP server, + (json-string, optional) + - "restrict": true if guest is isolated from the host, + false otherwise (json-boolean) + - "net": network address (json-string) + - "netmask": netmask (json-string) + - "host": guest-visible address of the host (json-string) + - "tftp": root directory of the built-in TFTP server (json-string, + optional) + - "bootfile": BOOTP filename (json-string, optional) + - "dhcpstart": the first of the 16 IPs the built-in DHCP server can + assign (json-string) + - "dns": guest-visible address of the virtual nameserver + (json-string) + - "smb": root directory of the built-in SMB server (json-string, + optional) + - "smbserver": IP address of the built-in SMB server (json-string, + optional) + - "hostfwd": guest port number to forward incoming TCP or UDP + connections (json-int, optional) + - "guestfwd": IP address and port to forward guest TCP connections + (json-int, optional) + - When "type" is "socket", the following values might be available: + - "host": IP address (json-string) + - "service": port number (json-int) + - "family": IP version, possible values "ipv4" or "ipv6" + (json-string) + - "server": true if the socket is receiving incoming connections, + false otherwise (json-boolean) + +Example: + +-> { "execute": "query-netdev" } +<- { + "return": [ + { + "id": "tap.0", + "type": "tap", + "vlan": 0, + "info": { + "script": "/etc/qemu-ifup", + "downscript": "/etc/qemu-ifdown", + "ifname": "tap0", + "vhost": true + }, + }, + { + "id": "user.0", + "type": "user", + "peer": "e1000.0", + "info": { + "net": "10.0.2.0", + "netmask": "255.255.255.0" + }, + }, + ] + } + +EQMP + +STEXI @item info chardev show the character devices ETEXI