net: Move hmp_info_network() to net-hmp-cmds.c

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20230124121946.1139465-17-armbru@redhat.com>
This commit is contained in:
Markus Armbruster 2023-01-24 13:19:30 +01:00
parent 2030ca36bf
commit ae71d13d4e
6 changed files with 33 additions and 30 deletions

View file

@ -63,7 +63,7 @@
#endif
static VMChangeStateEntry *net_change_state_entry;
static QTAILQ_HEAD(, NetClientState) net_clients;
NetClientStateList net_clients;
typedef struct NetdevQueueEntry {
Netdev *nd;
@ -1345,32 +1345,6 @@ RxFilterInfoList *qmp_query_rx_filter(const char *name, Error **errp)
return filter_list;
}
void hmp_info_network(Monitor *mon, const QDict *qdict)
{
NetClientState *nc, *peer;
NetClientDriver type;
net_hub_info(mon);
QTAILQ_FOREACH(nc, &net_clients, next) {
peer = nc->peer;
type = nc->info->type;
/* Skip if already printed in hub info */
if (net_hub_id_for_client(nc, NULL) == 0) {
continue;
}
if (!peer || type == NET_CLIENT_DRIVER_NIC) {
print_net_client(mon, nc);
} /* else it's a netdev connected to a NIC, printed with the NIC */
if (peer && type == NET_CLIENT_DRIVER_NIC) {
monitor_printf(mon, " \\ ");
print_net_client(mon, peer);
}
}
}
void colo_notify_filters_event(int event, Error **errp)
{
NetClientState *nc;