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 <lekir...@yandex-team.ru>
---
+++ 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