aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2020-05-18 09:43:52 +0200
committerLaurent Vivier <laurent@vivier.eu>2020-06-09 18:50:39 +0200
commit0561dfac082becdd9e89110249a27b309b62aa9f (patch)
tree13083a3d2c7925f024461fe33ddddfce44e63da4 /net/net.c
parent705f7f2fce25e774e19f6853cd92ebaf909958f3 (diff)
downloadqemu-0561dfac082becdd9e89110249a27b309b62aa9f.zip
qemu-0561dfac082becdd9e89110249a27b309b62aa9f.tar.gz
qemu-0561dfac082becdd9e89110249a27b309b62aa9f.tar.bz2
net: Do not include a newline in the id of -nic devices
The '\n' sneaked in by accident here, an "id" string should really not contain a newline character at the end. Fixes: 78cd6f7bf6b ('net: Add a new convenience option "--nic" ...') Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200518074352.23125-1-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/net.c b/net/net.c
index 38778e8..cbeeead 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1506,7 +1506,7 @@ static int net_param_nic(void *dummy, QemuOpts *opts, Error **errp)
/* Create an ID if the user did not specify one */
nd_id = g_strdup(qemu_opts_id(opts));
if (!nd_id) {
- nd_id = g_strdup_printf("__org.qemu.nic%i\n", idx);
+ nd_id = g_strdup_printf("__org.qemu.nic%i", idx);
qemu_opts_set_id(opts, nd_id);
}