mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
slirp: remove Monitor dependency, return a string for info
There is nothing performance-sensitive in returning an allocated string for info, and handling the monitor_printf() on the caller side. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
parent
634d03487b
commit
b7f43bf2f6
3 changed files with 18 additions and 14 deletions
|
@ -828,10 +828,11 @@ void hmp_info_usernet(Monitor *mon, const QDict *qdict)
|
|||
QTAILQ_FOREACH(s, &slirp_stacks, entry) {
|
||||
int id;
|
||||
bool got_hub_id = net_hub_id_for_client(&s->nc, &id) == 0;
|
||||
monitor_printf(mon, "Hub %d (%s):\n",
|
||||
char *info = slirp_connection_info(s->slirp);
|
||||
monitor_printf(mon, "Hub %d (%s):\n%s",
|
||||
got_hub_id ? id : -1,
|
||||
s->nc.name);
|
||||
slirp_connection_info(s->slirp, mon);
|
||||
s->nc.name, info);
|
||||
g_free(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue