diff options
author | 2009-10-12 09:52:00 +0100 | |
---|---|---|
committer | 2009-10-15 09:32:03 -0500 | |
commit | c1671a0876e87c6bd2b38f2966e1e3f8865117a6 (patch) | |
tree | a27c4dc3d3495681f477cb1bcedebe7899102219 /net.c | |
parent | net: add queue for peer-to-peer packet forwarding (diff) | |
download | qemu-kvm-c1671a0876e87c6bd2b38f2966e1e3f8865117a6.tar.gz qemu-kvm-c1671a0876e87c6bd2b38f2966e1e3f8865117a6.tar.bz2 qemu-kvm-c1671a0876e87c6bd2b38f2966e1e3f8865117a6.zip |
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>
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3302,7 +3302,9 @@ static void net_check_clients(void) 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) |