qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Introducing QMP query-netdevs command
@ 2019-11-13 21:25 Alexey Kirillov
  2019-11-13 21:25 ` [PATCH 1/2] qapi: net: Add " Alexey Kirillov
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alexey Kirillov @ 2019-11-13 21:25 UTC (permalink / raw)
  To: Jason Wang, Samuel Thibault, Markus Armbruster
  Cc: Michael S. Tsirkin, Jan Kiszka, qemu-devel, Vincenzo Maffione,
	yc-core, Alexey Kirillov, Giuseppe Lettieri, Luigi Rizzo

This patch introduces a new QMP command "query-netdevs" to get information
about currently attached network devices.
Potentially, this patch makes the "info_str" field of "struct NetClientState"
and HMP command "info network" obsolete as new command gives out more
information in a structured way.

Usage example:

{ "execute": "x-query-netdevs" }
{ "return": [
    {
      "peer": "netdev0",
      "netdev": "netdev0",
      "model": "virtio-net-pci",
      "macaddr": "52:54:00:12:34:56",
      "queues_count": 1,
      "type": "nic",
      "id": "net0"
    },
    {
      "peer": "net0",
      "ipv6": true,
      "ipv4": true,
      "host": "10.0.2.2",
      "queues_count": 1,
      "ipv6-dns": "fec0::3",
      "ipv6-prefix": "fec0::",
      "net": "10.0.2.0/255.255.255.0",
      "ipv6-host": "fec0::2",
      "type": "user",
      "dns": "10.0.2.3",
      "hostfwd": [
        {
          "str": "tcp::20004-:22"
        }
      ],
      "ipv6-prefixlen": 64,
      "id": "netdev0",
      "restrict": false
    }
  ]
}

Alexey Kirillov (2):
  qapi: net: Add query-netdevs command
  tests: Add tests for query-netdevs command

 include/net/net.h          |   1 +
 net/hub.c                  |   8 +++
 net/l2tpv3.c               |  19 ++++++
 net/net.c                  |  80 +++++++++++++++++++++++
 net/netmap.c               |  13 ++++
 net/slirp.c                | 126 +++++++++++++++++++++++++++++++++++++
 net/socket.c               |  71 +++++++++++++++++++++
 net/tap-win32.c            |   9 +++
 net/tap.c                  | 103 ++++++++++++++++++++++++++++--
 net/vde.c                  |  26 ++++++++
 net/vhost-user.c           |  18 +++++-
 qapi/net.json              |  85 +++++++++++++++++++++++++
 tests/Makefile.include     |   2 +
 tests/test-query-netdevs.c | 114 +++++++++++++++++++++++++++++++++
 14 files changed, 667 insertions(+), 8 deletions(-)
 create mode 100644 tests/test-query-netdevs.c

-- 
2.17.1



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

end of thread, other threads:[~2019-11-14 11:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-13 21:25 [PATCH 0/2] Introducing QMP query-netdevs command Alexey Kirillov
2019-11-13 21:25 ` [PATCH 1/2] qapi: net: Add " Alexey Kirillov
2019-11-13 21:31   ` Eric Blake
2019-11-13 21:25 ` [PATCH 2/2] tests: Add tests for " Alexey Kirillov
2019-11-14 11:28   ` Thomas Huth
2019-11-13 21:32 ` [PATCH 0/2] Introducing QMP " Eric Blake
2019-11-13 21:48   ` 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).