Revision 1a859593
b/net.c | ||
---|---|---|
855 | 855 |
qemu_opts_del(qemu_opts_find(qemu_find_opts_err("netdev", errp), id)); |
856 | 856 |
} |
857 | 857 |
|
858 |
static void print_net_client(Monitor *mon, NetClientState *nc)
|
|
858 |
void print_net_client(Monitor *mon, NetClientState *nc) |
|
859 | 859 |
{ |
860 | 860 |
monitor_printf(mon, "%s: type=%s,%s\n", nc->name, |
861 | 861 |
NetClientOptionsKind_lookup[nc->info->type], nc->info_str); |
... | ... | |
866 | 866 |
NetClientState *nc, *peer; |
867 | 867 |
NetClientOptionsKind type; |
868 | 868 |
|
869 |
monitor_printf(mon, "Devices not on any VLAN:\n"); |
|
869 |
net_hub_info(mon); |
|
870 |
|
|
870 | 871 |
QTAILQ_FOREACH(nc, &net_clients, next) { |
871 | 872 |
peer = nc->peer; |
872 | 873 |
type = nc->info->type; |
874 |
|
|
875 |
/* Skip if already printed in hub info */ |
|
876 |
if (net_hub_id_for_client(nc, NULL) == 0) { |
|
877 |
continue; |
|
878 |
} |
|
879 |
|
|
873 | 880 |
if (!peer || type == NET_CLIENT_OPTIONS_KIND_NIC) { |
874 |
monitor_printf(mon, " "); |
|
875 | 881 |
print_net_client(mon, nc); |
876 | 882 |
} /* else it's a netdev connected to a NIC, printed with the NIC */ |
877 | 883 |
if (peer && type == NET_CLIENT_OPTIONS_KIND_NIC) { |
878 |
monitor_printf(mon, " \\ ");
|
|
884 |
monitor_printf(mon, " \\ "); |
|
879 | 885 |
print_net_client(mon, peer); |
880 | 886 |
} |
881 | 887 |
} |
882 |
net_hub_info(mon); |
|
883 | 888 |
} |
884 | 889 |
|
885 | 890 |
void qmp_set_link(const char *name, bool up, Error **errp) |
b/net.h | ||
---|---|---|
100 | 100 |
int qemu_find_nic_model(NICInfo *nd, const char * const *models, |
101 | 101 |
const char *default_model); |
102 | 102 |
|
103 |
void print_net_client(Monitor *mon, NetClientState *nc); |
|
103 | 104 |
void do_info_network(Monitor *mon); |
104 | 105 |
|
105 | 106 |
/* NIC info */ |
b/net/hub.c | ||
---|---|---|
223 | 223 |
QLIST_FOREACH(hub, &hubs, next) { |
224 | 224 |
monitor_printf(mon, "hub %d\n", hub->id); |
225 | 225 |
QLIST_FOREACH(port, &hub->ports, next) { |
226 |
monitor_printf(mon, " port %d peer %s\n", port->id, |
|
227 |
port->nc.peer ? port->nc.peer->name : "<none>"); |
|
226 |
if (port->nc.peer) { |
|
227 |
monitor_printf(mon, " \\ "); |
|
228 |
print_net_client(mon, port->nc.peer); |
|
229 |
} |
|
228 | 230 |
} |
229 | 231 |
} |
230 | 232 |
} |
Also available in: Unified diff