From 53b85d9574f3c162c0aadbd988f95e207d4c6e31 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Fri, 21 Oct 2022 11:09:10 +0200 Subject: net: introduce qemu_set_info_str() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Embed the setting of info_str in a function. Signed-off-by: Laurent Vivier Reviewed-by: David Gibson Acked-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Jason Wang --- net/slirp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'net/slirp.c') diff --git a/net/slirp.c b/net/slirp.c index 8679be6444..14a8d59277 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -611,9 +611,8 @@ static int net_slirp_init(NetClientState *peer, const char *model, nc = qemu_new_net_client(&net_slirp_info, peer, model, name); - snprintf(nc->info_str, sizeof(nc->info_str), - "net=%s,restrict=%s", inet_ntoa(net), - restricted ? "on" : "off"); + qemu_set_info_str(nc, "net=%s,restrict=%s", inet_ntoa(net), + restricted ? "on" : "off"); s = DO_UPCAST(SlirpState, nc, nc); -- cgit v1.2.3