From: Mark McLoughlin <markmc@redhat.com>
To: qemu-devel@nongnu.org
Cc: Mark McLoughlin <markmc@redhat.com>
Subject: [Qemu-devel] [PATCH 1/1] net: fix multiple NICs causing net opts process to stop
Date: Mon, 12 Oct 2009 09:52:00 +0100 [thread overview]
Message-ID: <1255337520-30381-1-git-send-email-markmc@redhat.com> (raw)
In-Reply-To: <4AD0DAC8.90209@dlh.net>
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>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
net.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net.c b/net.c
index 2e4dd58..7cee404 100644
--- a/net.c
+++ b/net.c
@@ -3203,7 +3203,9 @@ static void net_check_clients(void)
static int net_init_client(QemuOpts *opts, void *dummy)
{
- return net_client_init(NULL, opts);
+ if (net_client_init(NULL, opts) < 0)
+ return -1;
+ return 0;
}
int net_init_clients(void)
--
1.6.2.5
prev parent reply other threads:[~2009-10-12 8:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-10 19:04 [Qemu-devel] QemuOpts eventually breaks net/tap parsing if more than one VLAN/NIC Peter Lieven
2009-10-12 8:52 ` Mark McLoughlin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1255337520-30381-1-git-send-email-markmc@redhat.com \
--to=markmc@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).