[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 1/2] slirp: Add "query-usernet" QMP command
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 1/2] slirp: Add "query-usernet" QMP command |
Date: |
Wed, 2 May 2018 14:41:34 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 05/02/2018 02:30 AM, Fam Zheng wrote:
HMP "info usernet" has been available but it isn't ideal for programmed
use cases. This closes the gap in QMP by adding a counterpart
"query-usernet" command. It is basically translated from
the HMP slirp_connection_info() loop, which now calls the QMP
implementation and prints the data, just like other HMP info_* commands.
The TCPS_* macros are now defined as a QAPI enum.
Signed-off-by: Fam Zheng <address@hidden>
---
+##
+# @UsernetInfo:
+#
+# SLIRP usernet information.
+#
+# Since: 2.13
+##
+{ 'struct': 'UsernetInfo',
+ 'data': {
+ 'id': 'str',
+ 'hub': 'int',
+ 'connections': ['UsernetConnection']
+} }
+
+##
+# @query-usernet:
+#
+# Return SLIRP network information.
+#
+# Since: 2.13
+#
+# Example:
+#
+# -> { "execute": "query-usernet", "arguments": { } }
+# <- { "return": [
+# {
+# "promiscuous": true,
+# "name": "vnet0"
That example looks wrong; I'm expecting 'id', 'hub', and another array
'connections'.
+# }
+# ]
+# }
+#
+##
+{ 'command': 'query-usernet',
+ 'returns': ['UsernetInfo'] }
Other than the botched example, the qapi additions look okay to me.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org