net: fix multiple NICs causing net opts process to stop
authorMark McLoughlin <markmc@redhat.com>
Mon, 12 Oct 2009 08:52:00 +0000 (09:52 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 15 Oct 2009 14:32:03 +0000 (09:32 -0500)
commit6341c5f7d56aa20986d79f98d2806bbb50a6610c
treea27c4dc3d3495681f477cb1bcedebe7899102219
parent846e3e34ac66a2f30b701edd9dad41078f00e544
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: Peter Lieven <pl@dlh.net>
Patchworks-ID: 35736
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
net.c