All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/5] Introducing QMP query-netdev command
@ 2021-03-02 18:02 ` Alexey Kirillov
  0 siblings, 0 replies; 14+ messages in thread
From: Alexey Kirillov @ 2021-03-02 18:02 UTC (permalink / raw)
  To: Jason Wang, Markus Armbruster, Thomas Huth, Eric Blake
  Cc: Laurent Vivier, Stefano Stabellini, Stefan Weil, xen-devel,
	Michael S. Tsirkin, Michael Roth, Paul Durrant, qemu-devel,
	Vincenzo Maffione, yc-core, Paolo Bonzini, Anthony Perard,
	Samuel Thibault, Giuseppe Lettieri, Luigi Rizzo

This patch series introduces a new QMP command "query-netdev" 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 QAPI structure inside.

Usage example:

-> { "execute": "query-netdev" }
<- { "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
         }
     ]
   }

v5->v6:
- Add QAPI visitor to generate info_str replacement directly from NetdevInfo.
- Make info_str dynamically allocated.
- Make commit messages more meaningful.

v4->v5:
- Enable qtest of query-netdevs for AVR and RX archs.
- Bump "Since" version in QAPI to 6.0.

v3->v4:
- Rename "query-netdevs" to "query-netdev".
- Copy netdev drivers to new QAPI enum "NetBackend".

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 (5):
  qapi: net: Add query-netdev command
  tests: Add tests for query-netdev command
  net: Move NetClientState.info_str to dynamic allocations
  hmp: Use QAPI NetdevInfo in hmp_info_network
  net: Do not fill legacy info_str for backends

 hw/net/xen_nic.c                  |   5 +-
 include/net/net.h                 |   5 +-
 include/qapi/hmp-output-visitor.h |  30 +++++
 net/l2tpv3.c                      |   8 +-
 net/net.c                         |  75 ++++++++++--
 net/netmap.c                      |   7 ++
 net/slirp.c                       | 126 ++++++++++++++++++-
 net/socket.c                      |  92 ++++++++++----
 net/tap-win32.c                   |  10 +-
 net/tap.c                         | 107 +++++++++++++++--
 net/vde.c                         |  25 +++-
 net/vhost-user.c                  |  20 +++-
 net/vhost-vdpa.c                  |  15 ++-
 qapi/hmp-output-visitor.c         | 193 ++++++++++++++++++++++++++++++
 qapi/meson.build                  |   1 +
 qapi/net.json                     |  80 +++++++++++++
 tests/qtest/meson.build           |   3 +
 tests/qtest/test-query-netdev.c   | 120 +++++++++++++++++++
 18 files changed, 860 insertions(+), 62 deletions(-)
 create mode 100644 include/qapi/hmp-output-visitor.h
 create mode 100644 qapi/hmp-output-visitor.c
 create mode 100644 tests/qtest/test-query-netdev.c

-- 
2.25.1



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

end of thread, other threads:[~2021-03-02 19:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 18:02 [PATCH v6 0/5] Introducing QMP query-netdev command Alexey Kirillov
2021-03-02 18:02 ` Alexey Kirillov
2021-03-02 18:02 ` [PATCH v6 1/5] qapi: net: Add " Alexey Kirillov
2021-03-02 18:02   ` Alexey Kirillov
2021-03-02 19:10   ` Eric Blake
2021-03-02 19:10     ` Eric Blake
2021-03-02 18:02 ` [PATCH v6 2/5] tests: Add tests for " Alexey Kirillov
2021-03-02 18:02   ` Alexey Kirillov
2021-03-02 18:02 ` [PATCH v6 3/5] net: Move NetClientState.info_str to dynamic allocations Alexey Kirillov
2021-03-02 18:02   ` Alexey Kirillov
2021-03-02 18:02 ` [PATCH v6 4/5] hmp: Use QAPI NetdevInfo in hmp_info_network Alexey Kirillov
2021-03-02 18:02   ` Alexey Kirillov
2021-03-02 18:02 ` [PATCH v6 5/5] net: Do not fill legacy info_str for backends Alexey Kirillov
2021-03-02 18:02   ` Alexey Kirillov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.