Patchwork [v2,1/7] QMP: Introduce the documentation for query-netdev and info netdev

login
register
mail settings
Submitter Miguel Di Ciurcio Filho
Date June 30, 2010, 2:52 p.m.
Message ID <1277909584-13012-2-git-send-email-miguel.filho@gmail.com>
Download mbox | patch
Permalink /patch/57416/
State New
Headers show

Comments

Miguel Di Ciurcio Filho - June 30, 2010, 2:52 p.m.
These commands show the information about active backend network devices.

Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
---
 qemu-monitor.hx |  100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 100 insertions(+), 0 deletions(-)

Patch

diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 9f62b94..330d7a6 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -1674,6 +1674,106 @@  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"
+- "peer": ID of the frontend guest device, if not available means that this
+  netdev is not connected to a guest device yet (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,
+              available only if an script is used. (json-string, optional, only
+              present if "fd" is not present)
+            - "downscript": path to an script used to deconfigure the interface,
+              available only if an script is used. (json-string, optional, 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 and is in
+              use, false otherwise (json-boolean)
+            - "vhostfd": fd used to connect the device to an already opened
+              vhost net device (json-int, optional)
+        - 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)
+            - "mode": permission mode, in octal (json-int)
+            - "group": group name (json-string, optional)
+        - 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)
+
+Example:
+
+-> { "execute": "query-netdev" }
+<- {
+      "return": [
+         {
+            "id": "tap.0",
+            "type": "tap",
+            "peer": "virtio-net-pci.0",
+            "info": {
+               "script": "/etc/qemu-ifup",
+               "downscript": "/etc/qemu-ifdown",
+               "ifname": "tap0",
+               "vnet_hdr": false,
+               "vhost": true
+            },
+         },
+         {
+            "id": "user.0",
+            "type": "user",
+            "peer": "e1000.0",
+            "info": {
+               "restrict": false,
+               "net": "10.0.2.0",
+               "netmask": "255.255.255.0",
+               "host": 10.0.2.2",
+               "dhcpstart": "10.2.0.15",
+               "dns": "10.0.2.3"
+            },
+         },
+      ]
+   }
+
+EQMP
+
+STEXI
 @item info chardev
 show the character devices
 ETEXI