|
| From: | Eric Blake |
| Subject: | Re: [PATCH 1/2] qapi: net: Add query-netdevs command |
| Date: | Wed, 13 Nov 2019 15:31:07 -0600 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 |
On 11/13/19 3:25 PM, Alexey Kirillov wrote:
Add a qmp command that provides information about currently attached network devices and their configuration. Signed-off-by: Alexey Kirillov <address@hidden> ---
+++ b/qapi/net.json
@@ -754,3 +754,88 @@
##
{ 'event': 'FAILOVER_NEGOTIATED',
'data': {'device-id': 'str'} }
+
+##
+# @NetdevInfo:
+#
+# Configuration of a network device.
+#
+# @id: Device identifier.
+#
+# @type: Specify the driver used for interpreting remaining arguments.
+#
+# @peer: Connected network device.
+#
+# @queues_count: Number of queues.
Unless there is a strong reason otherwise, this should be 'queues-count'.
+#
+# @hub: hubid of hub, if connected to.
+#
+# Since: 4.2
+##
+{ 'union': 'NetdevInfo',
+ 'base': { 'id': 'str',
+ 'type': 'NetClientDriver',
+ '*peer': 'str',
+ 'queues_count': 'int',
+ '*hub': 'int' },
+ 'discriminator': 'type',
+ 'data': {
+ 'nic': 'NetLegacyNicOptions',
+ 'user': 'NetdevUserOptions',
+ 'tap': 'NetdevTapOptions',
+ 'l2tpv3': 'NetdevL2TPv3Options',
+ 'socket': 'NetdevSocketOptions',
+ 'vde': 'NetdevVdeOptions',
+ 'bridge': 'NetdevBridgeOptions',
+ 'hubport': 'NetdevHubPortOptions',
+ 'netmap': 'NetdevNetmapOptions',
+ 'vhost-user': 'NetdevVhostUserOptions' } }
+
+##
+# @x-query-netdevs:
What are the reasons for the x- prefix? Are we planning on changing this interface down the road? If so, what changes might we make?
+# +# Get a list of @NetdevInfo for all virtual network devices. +# +# Returns: a list of @NetdevInfo describing each virtual network device. +# +# Since: 4.2
This is a new feature; as such, it's too late to make it into 4.2; you'll want to change this to 5.0.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
| [Prev in Thread] | Current Thread | [Next in Thread] |