On 25/8/26 21:09, Marc-André Lureau wrote:
Add a structured x-query-network QMP command that returns network
configuration as a NetworkInfo struct with pre-grouped hub information
and a flat list of non-hub clients. Each hub includes its ports with
inlined peer client info, and each client includes attached netfilter
details.
Refactor hmp_info_network() to consume only the QMP result instead of
directly accessing internal net_clients state. This decouples HMP from
internal data structures, making it possible to remove HMP support
without losing programmatic network introspection.
Signed-off-by: Marc-André Lureau <[email protected]>
---
include/net/net.h | 3 +-
net/hub.c | 29 +++++++------
net/hub.h | 4 +-
net/net-hmp-cmds.c | 57 +++++++++++++++++++------
net/net.c | 70 +++++++++++++++++++++++-------
qapi/net.json | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 242 insertions(+), 43 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>