Patchwork [2/8] QMP: Introduce the documentation for query-netdev and info netdev

login
register
mail settings
Submitter Miguel Di Ciurcio Filho
Date June 10, 2010, 9:36 p.m.
Message ID <1276205825-1922-3-git-send-email-miguel.filho@gmail.com>
Download mbox | patch
Permalink /patch/55264/
State New
Headers show

Comments

Miguel Di Ciurcio Filho - June 10, 2010, 9:36 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 |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 53 insertions(+), 0 deletions(-)
Markus Armbruster - June 11, 2010, 11:37 a.m.
Miguel Di Ciurcio Filho <miguel.filho@gmail.com> writes:

> These commands show the information about active backend network devices.
>
> Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
> ---
>  qemu-monitor.hx |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 53 insertions(+), 0 deletions(-)
>
> diff --git a/qemu-monitor.hx b/qemu-monitor.hx
> index f6a94f2..14a0ba1 100644
> --- a/qemu-monitor.hx
> +++ b/qemu-monitor.hx
> @@ -1674,6 +1674,59 @@ 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 contain the following:
> +
> +- "id": the device's ID, must be unique (json-string)
> +- "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.

Didn't we agree to have two separate query commands, one for net devices
on VLANs, and another one for the rest?

> +
> +Note: The supported device information is the same one supported by the '-net'
> +command-line argument, which are listed in the '-help' output or QEMU's manual.

Not sure a pointer to -help suffices here.

[...]
Miguel Di Ciurcio Filho - June 11, 2010, 11:47 a.m.
On Fri, Jun 11, 2010 at 8:37 AM, Markus Armbruster <armbru@redhat.com> wrote:
>> +- "id": the device's ID, must be unique (json-string)
>> +- "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.
>
> Didn't we agree to have two separate query commands, one for net devices
> on VLANs, and another one for the rest?
>

There were no consensus or requirement about that on the previous thread.

>> +
>> +Note: The supported device information is the same one supported by the '-net'
>> +command-line argument, which are listed in the '-help' output or QEMU's manual.
>
> Not sure a pointer to -help suffices here.
>

Various parts of the documentation have the same structure: e.g.:
netdev_add. If it is really necessary, I could send a new version
without just a pointer to -help.

Regards,

Miguel
Luiz Capitulino - June 16, 2010, 5:39 p.m.
On Thu, 10 Jun 2010 18:36:59 -0300
Miguel Di Ciurcio Filho <miguel.filho@gmail.com> wrote:

> These commands show the information about active backend network devices.
> 
> Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
> ---
>  qemu-monitor.hx |   53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 53 insertions(+), 0 deletions(-)
> 
> diff --git a/qemu-monitor.hx b/qemu-monitor.hx
> index f6a94f2..14a0ba1 100644
> --- a/qemu-monitor.hx
> +++ b/qemu-monitor.hx
> @@ -1674,6 +1674,59 @@ 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 contain the following:
> +
> +- "id": the device's ID, must be unique (json-string)
> +- "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)

 'type' is missing.

> +- "info": json-object containing the configuration information about the device.

 We need a list of all backends (maybe in 'type') and then we need to list all
possible cases for 'info'.

 I have some other comments, otherwise looks good.
Miguel Di Ciurcio Filho - June 16, 2010, 9:55 p.m.
On Wed, Jun 16, 2010 at 2:39 PM, Luiz Capitulino <lcapitulino@redhat.com> wrote:
>> +SQMP
>> +query-netdev
>> +----------------
>> +
>> +Each device is represented by a json-object. The returned value is a json-array
>> +of all devices.
>> +
>> +Each json-object contain the following:
>> +
>> +- "id": the device's ID, must be unique (json-string)
>> +- "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)
>
>  'type' is missing.
>

Actually, 'type' goes inside the 'info' object.

>> +- "info": json-object containing the configuration information about the device.
>
>  We need a list of all backends (maybe in 'type') and then we need to list all
> possible cases for 'info'.
>

Roger that.

Regards,

Miguel

Patch

diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index f6a94f2..14a0ba1 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -1674,6 +1674,59 @@  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 contain the following:
+
+- "id": the device's ID, must be unique (json-string)
+- "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.
+
+Note: The supported device information is the same one supported by the '-net'
+command-line argument, which are listed in the '-help' output or QEMU's manual.
+
+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