diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-11-10 17:45:43 +0400 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-01-14 00:40:54 +0100 |
commit | b7f43bf2f6166cc6e4ee22898ae31b76503378aa (patch) | |
tree | cf64d4d2516fc73606f0460a254b3910ffefdb9e /net | |
parent | 634d03487b3018b03f3fc45bf1af001ceb8dd603 (diff) |
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/slirp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/slirp.c b/net/slirp.c index 58d880de8d..b7319ca6b2 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -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); } } |