mbox series

[v4,0/4] Introducing QMP query-netdev command

Message ID 20200921191912.105305-1-lekiravi@yandex-team.ru
Headers show
Series Introducing QMP query-netdev command | expand

Message

Alexey Kirillov Sept. 21, 2020, 7:19 p.m. UTC
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 the new QMP command 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
         }
     ]
   }

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 (4):
  qapi: net: Add query-netdev command
  tests: Add tests for query-netdev command
  hmp: Use QMP query-netdev 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                   |  80 ++++++++++++
 tests/qtest/meson.build         |   3 +
 tests/qtest/test-query-netdev.c | 115 +++++++++++++++++
 17 files changed, 807 insertions(+), 59 deletions(-)
 create mode 100644 tests/qtest/test-query-netdev.c

Comments

Alexey Kirillov Sept. 28, 2020, 11:35 a.m. UTC | #1
<div>Ping</div><div> </div><div>21.09.2020 22:19, Alexey Kirillov writes:</div><div>&gt; This patch series introduces a new QMP command "query-netdev" to get</div><div>&gt; information about currently attached backend network devices (netdevs).</div><div>&gt; Also, since the "info_str" field of "NetClientState" is now deprecated,</div><div>&gt; we no longer use it for netdevs, only for NIC/hubports.</div><div>&gt; The HMP command "info network" now also uses the new QMP command inside.</div><div>&gt;</div><div>&gt; Usage example:</div><div>&gt;</div><div>&gt; -&gt; { "execute": "query-netdev" }</div><div>&gt; &lt;- { "return": [</div><div>&gt; {<!-- --></div><div>&gt; "listen": "127.0.0.1:90",</div><div>&gt; "type": "socket",</div><div>&gt; "peer-id": "hub0port1",</div><div>&gt; "id": "__org.qemu.net1"</div><div>&gt; },</div><div>&gt; {<!-- --></div><div>&gt; "script": "/etc/qemu-ifup",</div><div>&gt; "downscript": "/etc/qemu-ifdown",</div><div>&gt; "ifname": "tap0",</div><div>&gt; "type": "tap",</div><div>&gt; "peer-id": "net5",</div><div>&gt; "vnet_hdr": true,</div><div>&gt; "id": "tap0"</div><div>&gt; },</div><div>&gt; {<!-- --></div><div>&gt; "ipv6": true,</div><div>&gt; "ipv4": true,</div><div>&gt; "host": "10.0.2.2",</div><div>&gt; "ipv6-dns": "fec0::3",</div><div>&gt; "ipv6-prefix": "fec0::",</div><div>&gt; "net": "10.0.2.0/255.255.255.0",</div><div>&gt; "ipv6-host": "fec0::2",</div><div>&gt; "type": "user",</div><div>&gt; "peer-id": "net0",</div><div>&gt; "dns": "10.0.2.3",</div><div>&gt; "hostfwd": [</div><div>&gt; {<!-- --></div><div>&gt; "str": "tcp::20004-:22"</div><div>&gt; }</div><div>&gt; ],</div><div>&gt; "ipv6-prefixlen": 64,</div><div>&gt; "id": "netdev0",</div><div>&gt; "restrict": false</div><div>&gt; }</div><div>&gt; ]</div><div>&gt; }</div><div>&gt;</div><div>&gt; v3-&gt;v4:</div><div>&gt; - Rename "query-netdevs" to "query-netdev".</div><div>&gt; - Copy netdev drivers to new QAPI enum "NetBackend".</div><div>&gt;</div><div>&gt; v2-&gt;v3:</div><div>&gt; - Remove NIC and hubports from query-netdevs.</div><div>&gt; - Remove several fields from NetdevInfo since they are unnecessary.</div><div>&gt; - Rename field @peer to @peer-id.</div><div>&gt; - Add support of vhost-vdpa.</div><div>&gt; - Keep "info_str" for NIC/hubports, but remove it for netdevs.</div><div>&gt;</div><div>&gt; v1-&gt;v2:</div><div>&gt; - Rewrite HMP "info network" to get information from results of QMP command.</div><div>&gt; - Remove obsolete field "info_str" from "NetClientState".</div><div>&gt;</div><div>&gt; Alexey Kirillov (4):</div><div>&gt; qapi: net: Add query-netdev command</div><div>&gt; tests: Add tests for query-netdev command</div><div>&gt; hmp: Use QMP query-netdev in hmp_info_network</div><div>&gt; net: Do not use legacy info_str for backends</div><div>&gt;</div><div>&gt; include/net/net.h | 4 +-</div><div>&gt; net/clients.h | 1 +</div><div>&gt; net/hub.c | 4 +-</div><div>&gt; net/hub.h | 2 +-</div><div>&gt; net/l2tpv3.c | 21 +++-</div><div>&gt; net/net.c | 213 +++++++++++++++++++++++++++++++-</div><div>&gt; net/netmap.c | 13 ++</div><div>&gt; net/slirp.c | 128 ++++++++++++++++++-</div><div>&gt; net/socket.c | 91 ++++++++++----</div><div>&gt; net/tap-win32.c | 10 +-</div><div>&gt; net/tap.c | 107 ++++++++++++++--</div><div>&gt; net/vde.c | 39 +++++-</div><div>&gt; net/vhost-user.c | 20 ++-</div><div>&gt; net/vhost-vdpa.c | 15 ++-</div><div>&gt; qapi/net.json | 80 ++++++++++++</div><div>&gt; tests/qtest/meson.build | 3 +</div><div>&gt; tests/qtest/test-query-netdev.c | 115 +++++++++++++++++</div><div>&gt; 17 files changed, 807 insertions(+), 59 deletions(-)</div><div>&gt; create mode 100644 tests/qtest/test-query-netdev.c</div><div>&gt;</div><div>&gt; --</div><div>&gt; 2.25.1</div><div> </div><div><div>-- </div><div>Alexey Kirillov</div><div>Yandex.Cloud</div></div>
Alexey Kirillov Sept. 28, 2020, 12:07 p.m. UTC | #2
Ping

21.09.2020 22:19, Alexey Kirillov writes:
> 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 the new QMP command 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

>          }

>      ]

>    }

>

> 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 (4):

>  qapi: net: Add query-netdev command

>  tests: Add tests for query-netdev command

>  hmp: Use QMP query-netdev 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                  |  80 ++++++++++++

>  tests/qtest/meson.build        |  3 +

>  tests/qtest/test-query-netdev.c | 115 +++++++++++++++++

>  17 files changed, 807 insertions(+), 59 deletions(-)

>  create mode 100644 tests/qtest/test-query-netdev.c

>

> --

> 2.25.1


P.S. Sorry for double-ping (first message was with "Content-Type: text/html", my mistake).

-- 
Alexey Kirillov
Yandex.Cloud
Alexey Kirillov Oct. 7, 2020, 7:52 a.m. UTC | #3
ping

http://patchwork.ozlabs.org/project/qemu-devel/list/?series=203284

21.09.2020, 22:19, "Alexey Kirillov" <lekiravi@yandex-team.ru>:
> 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 the new QMP command 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

>          }

>      ]

>    }

>

> 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 (4):

>   qapi: net: Add query-netdev command

>   tests: Add tests for query-netdev command

>   hmp: Use QMP query-netdev 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 | 80 ++++++++++++

>  tests/qtest/meson.build | 3 +

>  tests/qtest/test-query-netdev.c | 115 +++++++++++++++++

>  17 files changed, 807 insertions(+), 59 deletions(-)

>  create mode 100644 tests/qtest/test-query-netdev.c

>

> --

> 2.25.1



-- 
Alexey Kirillov
Yandex.Cloud
Alexey Kirillov Oct. 16, 2020, 3:34 p.m. UTC | #4
Ping again, as no progress since september 22.

http://patchwork.ozlabs.org/project/qemu-devel/list/?series=203284

21.09.2020, 22:19, "Alexey Kirillov" <lekiravi@yandex-team.ru>:
> 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 the new QMP command 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

>          }

>      ]

>    }

>

> 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 (4):

>   qapi: net: Add query-netdev command

>   tests: Add tests for query-netdev command

>   hmp: Use QMP query-netdev 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 | 80 ++++++++++++

>  tests/qtest/meson.build | 3 +

>  tests/qtest/test-query-netdev.c | 115 +++++++++++++++++

>  17 files changed, 807 insertions(+), 59 deletions(-)

>  create mode 100644 tests/qtest/test-query-netdev.c

>

> --

> 2.25.1



-- 
Alexey Kirillov
Yandex.Cloud