]> git.proxmox.com Git - qemu.git/commitdiff
net: print correct error for '-netdev ""'
authorMark McLoughlin <markmc@redhat.com>
Wed, 25 Nov 2009 18:49:33 +0000 (18:49 +0000)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 3 Dec 2009 15:41:35 +0000 (09:41 -0600)
Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net.c

diff --git a/net.c b/net.c
index c71699de29ec1ddf8a7cebebb3297fc935beb389..13bdbb2caa0d14ad25909afc18da31aec5c83df7 100644 (file)
--- 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 &&