qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Introducing QMP query-netdevs command
@ 2020-09-01 18:23 Alexey Kirillov
  2020-09-01 18:23 ` [PATCH v3 1/4] qapi: net: Add " Alexey Kirillov
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Alexey Kirillov @ 2020-09-01 18:23 UTC (permalink / raw)
  To: Eric Blake, Markus Armbruster, Thomas Huth, Jason Wang
  Cc: Laurent Vivier, Michael S. Tsirkin, Stefan Weil, qemu-devel,
	Vincenzo Maffione, yc-core, Paolo Bonzini, Samuel Thibault,
	Giuseppe Lettieri, Luigi Rizzo

This patch series introduces a new QMP command "query-netdevs" to get
information about currently attached backend network devices (netdevs).
Also, since the "info_str" field of "NetClientState" is now deprecated,
we no longer use it for netdevs, only for NIC/hubports.
The HMP command "info network" now also uses the new QMP command inside.

Usage example:

-> { "execute": "query-netdevs" }
<- { "return": [
         {
             "listen": "127.0.0.1:90",
             "type": "socket",
             "peer-id": "hub0port1",
             "id": "__org.qemu.net1"
         },
         {
             "script": "/etc/qemu-ifup",
             "downscript": "/etc/qemu-ifdown",
             "ifname": "tap0",
             "type": "tap",
             "peer-id": "net5",
             "vnet_hdr": true,
             "id": "tap0"
         },
         {
             "ipv6": true,
             "ipv4": true,
             "host": "10.0.2.2",
             "ipv6-dns": "fec0::3",
             "ipv6-prefix": "fec0::",
             "net": "10.0.2.0/255.255.255.0",
             "ipv6-host": "fec0::2",
             "type": "user",
             "peer-id": "net0",
             "dns": "10.0.2.3",
             "hostfwd": [
                 {
                     "str": "tcp::20004-:22"
                 }
             ],
             "ipv6-prefixlen": 64,
             "id": "netdev0",
             "restrict": false
         }
     ]
   }

v2->v3:
- Remove NIC and hubports from query-netdevs.
- Remove several fields from NetdevInfo since they are unnecessary.
- Rename field @peer to @peer-id.
- Add support of vhost-vdpa.
- Keep "info_str" for NIC/hubports, but remove it for netdevs.

v1->v2:
- Rewrite HMP "info network" to get information from results of QMP command.
- Remove obsolete field "info_str" from "NetClientState".

Alexey Kirillov (4):
  qapi: net: Add query-netdevs command
  tests: Add tests for query-netdevs command
  hmp: Use QMP query-netdevs in hmp_info_network
  net: Do not use legacy info_str for backends

 include/net/net.h                |   4 +-
 net/clients.h                    |   1 +
 net/hub.c                        |   4 +-
 net/hub.h                        |   2 +-
 net/l2tpv3.c                     |  21 ++-
 net/net.c                        | 213 ++++++++++++++++++++++++++++++-
 net/netmap.c                     |  13 ++
 net/slirp.c                      | 128 ++++++++++++++++++-
 net/socket.c                     |  91 ++++++++++---
 net/tap-win32.c                  |  10 +-
 net/tap.c                        | 107 ++++++++++++++--
 net/vde.c                        |  39 +++++-
 net/vhost-user.c                 |  20 ++-
 net/vhost-vdpa.c                 |  15 ++-
 qapi/net.json                    |  68 ++++++++++
 tests/qtest/meson.build          |   3 +
 tests/qtest/test-query-netdevs.c | 117 +++++++++++++++++
 17 files changed, 797 insertions(+), 59 deletions(-)
 create mode 100644 tests/qtest/test-query-netdevs.c

-- 
2.25.1



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-09-16 11:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-01 18:23 [PATCH v3 0/4] Introducing QMP query-netdevs command Alexey Kirillov
2020-09-01 18:23 ` [PATCH v3 1/4] qapi: net: Add " Alexey Kirillov
2020-09-02 11:23   ` Markus Armbruster
2020-09-07 10:37     ` Alexey Kirillov
2020-09-07 12:39       ` Markus Armbruster
2020-09-08 12:36         ` Eric Blake
2020-09-08 14:31           ` Markus Armbruster
2020-09-16  9:37             ` Alexey Kirillov
2020-09-16 11:28               ` Markus Armbruster
2020-09-08 15:52         ` Alexey Kirillov
2020-09-09 11:41           ` Markus Armbruster
2020-09-09 12:45             ` Alexey Kirillov
2020-09-08 14:29   ` Markus Armbruster
2020-09-08 15:52     ` Alexey Kirillov
2020-09-01 18:23 ` [PATCH v3 2/4] tests: Add tests for " Alexey Kirillov
2020-09-01 18:23 ` [PATCH v3 3/4] hmp: Use QMP query-netdevs in hmp_info_network Alexey Kirillov
2020-09-01 18:23 ` [PATCH v3 4/4] net: Do not use legacy info_str for backends Alexey Kirillov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).