Commit 0561dfac authored by Thomas Huth's avatar Thomas Huth Committed by Laurent Vivier
Browse files

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: 78cd6f7b ('net: Add a new convenience option "--nic" ...')
Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200518074352.23125-1-thuth@redhat.com>
Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
parent 705f7f2f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
    }