From: Mark McLoughlin Date: Wed, 25 Nov 2009 18:49:33 +0000 (+0000) Subject: net: print correct error for '-netdev ""' X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0f2fbf40a9d1f0ccdd86bd47f17fff24666f01d9;p=qemu.git net: print correct error for '-netdev ""' Reported-by: Markus Armbruster Signed-off-by: Mark McLoughlin Signed-off-by: Anthony Liguori --- diff --git a/net.c b/net.c index c71699de29..13bdbb2caa 100644 --- a/net.c +++ b/net.c @@ -1055,12 +1055,18 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev) int i; type = qemu_opt_get(opts, "type"); - if (!type) { - qemu_error("No type specified for -net\n"); - return -1; - } - if (is_netdev) { + if (!is_netdev) { + if (!type) { + qemu_error("No type specified for -net\n"); + return -1; + } + } else { + if (!type) { + qemu_error("No type specified for -netdev\n"); + return -1; + } + if (strcmp(type, "tap") != 0 && #ifdef CONFIG_SLIRP strcmp(type, "user") != 0 &&