From d32ad10a14d46dfe9304e3ed5858a11dcd5c71a0 Mon Sep 17 00:00:00 2001 From: Alexey Kirillov Date: Wed, 3 Mar 2021 12:59:06 +0300 Subject: qapi: net: Add query-netdev command The query-netdev command is used to get the configuration of the current network device backends (netdevs). This is the QMP analog of the HMP command "info network" but only for netdevs (i.e. excluding NIC and hubports). The query-netdev command returns an array of objects of the NetdevInfo type, which are an extension of Netdev type. It means that response can be used for netdev-add after small modification. This can be useful for recreate the same netdev configuration. Information about the network device is filled in when it is created or modified and is available through the NetClientState->stored_config. Signed-off-by: Alexey Kirillov Acked-by: Markus Armbruster Signed-off-by: Jason Wang --- include/net/net.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/net/net.h b/include/net/net.h index 4f56cae0fa..dc3679f41c 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -5,6 +5,8 @@ #include "qapi/qapi-types-net.h" #include "net/queue.h" #include "hw/qdev-properties-system.h" +#include "qapi/clone-visitor.h" +#include "qapi/qapi-visit-net.h" #define MAC_FMT "%02X:%02X:%02X:%02X:%02X:%02X" #define MAC_ARG(x) ((uint8_t *)(x))[0], ((uint8_t *)(x))[1], \ @@ -93,6 +95,7 @@ struct NetClientState { char *model; char *name; char info_str[256]; + NetdevInfo *stored_config; unsigned receive_disabled : 1; NetClientDestructor *destructor; unsigned int queue_index; -- cgit v1.2.3-55-g7522