diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-11-25 18:49:33 +0000 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-12-03 09:41:35 -0600 |
commit | 0f2fbf40a9d1f0ccdd86bd47f17fff24666f01d9 (patch) | |
tree | b44d3eec26358ed49ec35b2b7f500b03e0415d79 /net.c | |
parent | f401ca22d872e93fd5f12c99ffcb4f1261bb46b9 (diff) | |
download | qemu-0f2fbf40a9d1f0ccdd86bd47f17fff24666f01d9.tar.gz qemu-0f2fbf40a9d1f0ccdd86bd47f17fff24666f01d9.tar.bz2 qemu-0f2fbf40a9d1f0ccdd86bd47f17fff24666f01d9.zip |
net: print correct error for '-netdev ""'
Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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 && |