提交 0f2fbf40 编写于 作者: M Mark McLoughlin 提交者: Anthony Liguori

net: print correct error for '-netdev ""'

Reported-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 f401ca22
......@@ -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 &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册