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

net: fix multiple NICs causing net opts process to stop

For NICs, net_init_client() returns the index into the NICInfo table.

qemu_opts_foreach() interprets non-zero as an error return an stops
iterating over the options.

So, if you have more than one '-net nic' on the command line, subsequent
'-net' options do not get processed.

Fix this by making net_client_init() only return non-zero if
net_init_client() returns an error.
Reported-by: NPeter Lieven <pl@dlh.net>
Patchworks-ID: 35736
Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 9a6ecb30
...@@ -3302,7 +3302,9 @@ static void net_check_clients(void) ...@@ -3302,7 +3302,9 @@ static void net_check_clients(void)
static int net_init_client(QemuOpts *opts, void *dummy) static int net_init_client(QemuOpts *opts, void *dummy)
{ {
return net_client_init(NULL, opts, 0); if (net_client_init(NULL, opts, 0) < 0)
return -1;
return 0;
} }
static int net_init_netdev(QemuOpts *opts, void *dummy) static int net_init_netdev(QemuOpts *opts, void *dummy)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册