]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
net: Do not include a newline in the id of -nic devices
authorThomas Huth <thuth@redhat.com>
Mon, 18 May 2020 07:43:52 +0000 (09:43 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 16 Jun 2020 01:21:02 +0000 (20:21 -0500)
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>
(cherry picked from commit 0561dfac082becdd9e89110249a27b309b62aa9f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
net/net.c

index 84aa6d8d0032ce6b82ea21ffcfcbc9a4075e88d9..58adaafba93686a061e27a888ad97f25ece965de 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1524,7 +1524,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);
     }