QMP: Introduce the documentation for query-netdev and info netdev
PATCH v2 1/1 QMP: Introduce the documentation for query-netdev and info netdev
These commands show the information about active backend network devices.
--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)
qemu-monitor.hx +105 -0
@@ -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
Signature · 1 line
1.7.1
Quoted 25 lines · Miguel Di Ciurcio Filho
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho<[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +10
-0@@ -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. +
qemu-monitor.hx show the various VLANs and the associated devices · line 1696
Quoted 10 lines
qemu-monitor.hx +9
-0+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)
I think we should only return items with a valid peer property and drop anything attached to vlans. The current info network already provides vlan information.
Regards,
Anthony Liguori
Quoted 31 lines · On Fri, 18 Jun 2010 15:28:42 -0500 Anthony Liguori <[email protected]>…
Quoted 30 lines · Miguel Di Ciurcio Filho
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho<[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +15
-0@@ -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"
Quoted 8 lines
qemu-monitor.hx show the various VLANs and the associated devices
Quoted 5 lines
qemu-monitor.hx +4
-0+- "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)I think we should only return items with a valid peer property and drop anything attached to vlans.
The reason is that we're going to completely drop the vlan stuff, right?
Quoted 1 line
The current info network already provides vlan information.
What did you mean by that? info network is not going to be converted to QMP,
that's why we're doing query-netdev.
If I got it right:
- query-netdev: backend info
- query-qdm: device info
Quoted 43 lines · Luiz Capitulino
Quoted 31 lines · On Fri, 18 Jun 2010 15:28:42 -0500 Anthony Liguori <[email protected]>…
Quoted 30 lines · Miguel Di Ciurcio Filho
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho<[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +15
-0@@ -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"Quoted 8 lines
qemu-monitor.hx show the various VLANs and the associated devices
Quoted 5 lines
qemu-monitor.hx +4
-0+- "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)I think we should only return items with a valid peer property and drop anything attached to vlans.
Quoted 6 lines
The reason is that we're going to completely drop the vlan stuff, right?
Quoted 1 line
The current info network already provides vlan information.
What did you mean by that? info network is not going to be converted to QMP,
that's why we're doing query-netdev.
If we want to cover VLANs in QMP, we can either cover them in query-netdev, or provide a separate query, say query-vlans. The latter has the advantage that we won't have to mess with query-netdev when we get rid of VLANs.
In my personal opinion, we should just ditch VLANs and be done with it.
Quoted 4 lines
If I got it right:
- query-netdev: backend info
- query-qdm: device info
I think you mean query-qtree. query-qdm is about available device models.
Quoted 52 lines · On Mon, 21 Jun 2010 10:27:11 +0200 Markus Armbruster <[email protected]> wrote:
Quoted 43 lines · Luiz Capitulino
Quoted 31 lines · On Fri, 18 Jun 2010 15:28:42 -0500 Anthony Liguori <[email protected]>…
Quoted 30 lines · Miguel Di Ciurcio Filho
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho<[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +15
-0@@ -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"Quoted 8 lines
qemu-monitor.hx show the various VLANs and the associated devices
Quoted 5 lines
qemu-monitor.hx +4
-0+- "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)I think we should only return items with a valid peer property and drop anything attached to vlans.
Quoted 6 lines
The reason is that we're going to completely drop the vlan stuff, right?
Quoted 1 line
The current info network already provides vlan information.
What did you mean by that? info network is not going to be converted to QMP,
that's why we're doing query-netdev.
Quoted 6 lines
If we want to cover VLANs in QMP, we can either cover them in query-netdev, or provide a separate query, say query-vlans. The latter has the advantage that we won't have to mess with query-netdev when we get rid of VLANs.
In my personal opinion, we should just ditch VLANs and be done with it.
Agreed.
Quoted 8 lines
Quoted 5 lines
If I got it right:
- query-netdev: backend info
- query-qdm: device infoI think you mean query-qtree. query-qdm is about available device models.
Yes.
Quoted 37 lines · Anthony Liguori
Quoted 36 lines · Miguel Di Ciurcio Filho
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho<[email protected]>---
qemu-monitor.hx | 105
+++++++++++++++++++++++++++++++++++++++++++++++++++++++1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +0
-0@@ -1674,6 +1674,111 @@ show the various VLANs and the associated devicesETEXI
STEXI
+@item info netdevqemu-monitor.hx +7
-0+show information about the current backend network devices +ETEXI +SQMP +query-netdev +------------ + +Each device is represented by a json-object. The returned value is ajson-array
qemu-monitor.hx +8
-0+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 deviceis
+ attached to a VLAN (json-int, optional)
Quoted 9 lines
Quoted 4 lines
+- "peer": ID of the frontend device when on a 1:1 relationship (json-string,
+ optional)I think we should only return items with a valid peer property and drop anything attached to vlans. The current info network already provides vlan information.
We need a strong compromise that sometime in the future, the qemu "vlan" concept will be removed, deprecated, or something like that. Otherwise we will end up with QMP not exporting networking configuration that can be setup by a user or management software.
Previous discussions about the "vlan" removal:
http://lists.gnu.org/archive/html/qemu-devel/2010-06/msg00947.html
Will it break for some people? Yes, but the current status quo is not good. Interconnecting virtual network devices should be done by software like VDE or Open vSwitch on the host.
I think even devices without a peer must be listed. After a netdev_add command, there is going to be no way to verify that the netdev is there, only after adding a guest NIC associated with the netdev if we put a restriction like that.
Regards,
Miguel
Quoted 49 lines · Miguel Di Ciurcio Filho
Quoted 37 lines · Anthony Liguori
Quoted 35 lines · Miguel Di Ciurcio Filho
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho<[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +8
-0@@ -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 ajson-array
qemu-monitor.hx +8
-0+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 deviceis
+ attached to a VLAN (json-int, optional)Quoted 10 lines
Quoted 5 lines
+- "peer": ID of the frontend device when on a 1:1 relationship (json-string,
+ optional)I think we should only return items with a valid peer property and drop anything attached to vlans. The current info network already provides vlan information.
Quoted 5 lines
We need a strong compromise that sometime in the future, the qemu "vlan" concept will be removed, deprecated, or something like that. Otherwise we will end up with QMP not exporting networking configuration that can be setup by a user or management software.
One way or another, vlan will go away in the form it exists today. I'm not sure how we're going to replace it yet but the notion that every device is always connected to a hub is not something that we can reasonably live with.
netdev has already killed it. TBH, I don't think netdev should have a vlan tag. In fact, I think a patch to remove that from the user interface would be a very good thing.
Regards,
Anthony Liguori
Quoted 32 lines · Anthony Liguori
Quoted 31 lines · Miguel Di Ciurcio Filho
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho<[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +16
-0@@ -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
Quoted 8 lines
qemu-monitor.hx show the various VLANs and the associated devices
Quoted 4 lines
qemu-monitor.hx +3
-0+ attached to a VLAN (json-int, optional) +- "peer": ID of the frontend device when on a 1:1 relationship (json-string, + optional)I think we should only return items with a valid peer property and drop anything attached to vlans. The current info network already provides vlan information.
Not quite. Not having a valid peer doesn't imply connection to VLAN.
I also think we should keep VLAN-stuff as separate as possible, to ease the transition away from it.
In implementation terms, I'd like query-netdev to cover the members of non_vlan_clients that are not guest devices (info->type != NET_CLIENT_TYPE_NIC). Member vlan should be ignored (it should always be null). Member peer points to the guest device, and may be null (no guest device attached).
Quoted 18 lines · On Fri, 18 Jun 2010 13:26:27 -0300 Miguel Di Ciurcio Filho…
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho <[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +3
-0@@ -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
qemu-monitor.hx show the various VLANs and the associated devices · line 1689
Quoted 10 lines
qemu-monitor.hx +10
-0+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)
There were some talking about changing this to 'device. Jan, Markus?
qemu-monitor.hx show the various VLANs and the associated devices · line 1702
Quoted 13 lines
qemu-monitor.hx +13
-0+- "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)
What if the script is called "no"? Better not to include the key in this case.
qemu-monitor.hx show the various VLANs and the associated devices · line 1705
Quoted 3 lines
qemu-monitor.hx +3
-0+ - "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)
Same as above.
qemu-monitor.hx show the various VLANs and the associated devices · line 1711
Quoted 6 lines
qemu-monitor.hx +6
-0+ - "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)
Why is vnet_hdr important?
qemu-monitor.hx show the various VLANs and the associated devices · line 1713
Quoted 2 lines
qemu-monitor.hx +2
-0+ - "vhostfd": positive number if the device is connected to an + already opened vhost net device, -1 otherwise (json-int)
Making the key option is better, IMO.
Quoted 71 lines
qemu-monitor.hx +68
-0+ - "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
Quoted 17 lines · Luiz Capitulino
Quoted 14 lines · On Fri, 18 Jun 2010 13:26:27 -0300 Miguel Di Ciurcio Filho…
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho <[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +0
-0@@ -1674,6 +1674,111 @@ show the various VLANs and the associated devices ETEXI
Quoted 16 lines
Quoted 4 lines
qemu-monitor.hx +3
-0STEXI +@item info netdev +show information about the current backend network devices +ETEXIqemu-monitor.hx show the various VLANs and the associated devices · line 1689
Quoted 10 lines
qemu-monitor.hx +10
-0+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)There were some talking about changing this to 'device. Jan, Markus?
Only for qdev. Should be a different namespace here.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 35 lines · Jan Kiszka
Quoted 17 lines · Luiz Capitulino
Quoted 14 lines · On Fri, 18 Jun 2010 13:26:27 -0300 Miguel Di Ciurcio Filho…
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho <[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +0
-0@@ -1674,6 +1674,111 @@ show the various VLANs and the associated devices ETEXIQuoted 16 lines
Quoted 4 lines
qemu-monitor.hx +3
-0STEXI +@item info netdev +show information about the current backend network devices +ETEXIqemu-monitor.hx show the various VLANs and the associated devices · line 1689
Quoted 10 lines
qemu-monitor.hx +10
-0+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)There were some talking about changing this to 'device. Jan, Markus?
Quoted 1 line
Only for qdev. Should be a different namespace here.
Huh?
We need to point to the NIC here, i.e. we need a unambigous name. Device ID is fine, but it's optional. Canonical qdev path?
Quoted 35 lines · Markus Armbruster
Quoted 33 lines · Jan Kiszka
Quoted 32 lines · Luiz Capitulino
Quoted 18 lines · On Fri, 18 Jun 2010 13:26:27 -0300 Miguel Di Ciurcio Filho…
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho <[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +3
-0@@ -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 +ETEXIqemu-monitor.hx show the various VLANs and the associated devices · line 1689
Quoted 10 lines
qemu-monitor.hx +10
-0+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)There were some talking about changing this to 'device. Jan, Markus?
Quoted 6 lines
Quoted 1 line
Only for qdev. Should be a different namespace here.
Huh?
We need to point to the NIC here, i.e. we need a unambigous name. Device ID is fine, but it's optional. Canonical qdev path?
Unless I'm still on the wrong track: 'peer' should point to the front-end, this ID describes the back-end, and that's not a qdev thing. Still, dumping the peer's qdev path along its (optional) ID might be worth a thought.
Jan
Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux
Quoted 40 lines · Jan Kiszka
Quoted 39 lines · Markus Armbruster
Quoted 33 lines · Jan Kiszka
Quoted 17 lines · Luiz Capitulino
Quoted 14 lines · On Fri, 18 Jun 2010 13:26:27 -0300 Miguel Di Ciurcio Filho…
These commands show the information about active backend network devices.
Signed-off-by Miguel Di Ciurcio Filho <[email protected]>--- qemu-monitor.hx | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-)qemu-monitor.hx +0
-0@@ -1674,6 +1674,111 @@ show the various VLANs and the associated devices ETEXIQuoted 15 lines
Quoted 4 lines
qemu-monitor.hx +3
-0STEXI +@item info netdev +show information about the current backend network devices +ETEXIqemu-monitor.hx show the various VLANs and the associated devices · line 1689
Quoted 10 lines
qemu-monitor.hx +10
-0+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)There were some talking about changing this to 'device. Jan, Markus?
Quoted 1 line
Only for qdev. Should be a different namespace here.
Huh?
Quoted 7 lines
Quoted 2 lines
We need to point to the NIC here, i.e. we need a unambigous name. Device ID is fine, but it's optional. Canonical qdev path?
Unless I'm still on the wrong track: 'peer' should point to the front-end, this ID describes the back-end, and that's not a qdev thing. Still, dumping the peer's qdev path along its (optional) ID might be worth a thought.
One of us is probably confused, and it could well be me :)
Frontend / backend is difficult for the directionally challenged, so let's use "guest NIC" and "host network device".
A guest NIC's peer points to a host network device, and vice versa.
query-netdev is about host network devices. Thus, peer identifes a guest NIC.
Quoted 9 lines · Luiz Capitulino
Quoted 7 lines
+- "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)What if the script is called "no"? Better not to include the key in this case.
Actually, it can't be named "no". Because if the name is "no", qemu does not run any script. net/tap.c:net_tap_init():391 and net/tap.c:net_init_tap:():462.
$ qemu -netdev type=tap,script=no,downscript=no....
But, returning "no" is really not a good idea, indeed. If scripts were disabled in the command line, "script" and "downscript" should not exist.
Quoted 6 lines
Quoted 3 lines
+ - "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)Same as above.
Quoted 8 lines
Quoted 6 lines
+ - "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 theIFF_VNET_HDRflag must be set, false
+ otherwise (json-boolean)Why is
vnet_hdrimportant?
Because of this (quoting the command line docs):
"use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag use vnet_hdr=on to make the lack of IFF_VNET_HDR support an error condition"
So if "vnet_hdr" is true, it means that the VM is effectively using the feature.
Quoted 6 lines
Quoted 3 lines
+ - "vhostfd": positive number if the device is connected to an
+ already opened vhost net device, -1 otherwise (json-int)Making the key option is better, IMO.
Indeed, same case as "script" and "downscript".
Regards,
Miguel