* [Qemu-devel] QemuOpts eventually breaks net/tap parsing if more than one VLAN/NIC
@ 2009-10-10 19:04 Peter Lieven
2009-10-12 8:52 ` [Qemu-devel] [PATCH 1/1] net: fix multiple NICs causing net opts process to stop Mark McLoughlin
0 siblings, 1 reply; 2+ messages in thread
From: Peter Lieven @ 2009-10-10 19:04 UTC (permalink / raw)
To: qemu-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
i today updated to latest qemu snapshot from git. Unforunately I stumbled over the following problem:
Case 1) -net tap before -net nic
cmdline: /usr/local/bin/qemu-system-x86_64 -net tap,vlan=711,ifname=tap3,script=no -net
nic,vlan=711,model=e1000,macaddr=52:54:00:ff:00:02 -net tap,vlan=712,ifname=tap4,script=no -net
nic,vlan=712,model=e1000,macaddr=52:54:00:ff:00:03 -hda /dev/sdb -m 1024 -smp 2 -localtime -usb
- -usbdevice tablet -monitor tcp:0:4010,server,nowait -vnc :10 -name XXX -boot order=c,menu=on
- -pidfile /var/run/qemu/vm-3.pid
Everything works as expected.
Case 2) -net tap after -net nic
cmdline: /usr/local/bin/qemu-system-x86_64 -net nic,vlan=711,model=e1000,macaddr=52:54:00:ff:00:02
- -net tap,vlan=711,ifname=tap3,script=no -net nic,vlan=712,model=e1000,macaddr=52:54:00:ff:00:03 -net
tap,vlan=712,ifname=tap4,script=no -hda /dev/sdb -m 1024 -smp 2 -localtime -usb -usbdevice tablet
- -monitor tcp:0:4010,server,nowait -vnc :10 -name XXX -boot order=c,menu=on -pidfile
/var/run/qemu/vm-3.pid
I get the following warning:
Warning: vlan 712 is not connected to host network
In the qemu monitor I see, that vlan712 does not contain the tap interface. However, the tap4
interface is created on the host. vlan711 is working as expected.
I suspect that is has sth todo with the migration to QemuOpts as an earlier checkout without
QemuOpts works well.
Can someone who is more familiar with the QemuOpts implementation please look at this.
Thanks,
Peter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkrQ2sgACgkQO/ibohXUOnKeawCfVRBvoyuG0sHFzH0/3Cx/vhJW
DG4AoOVIj1pdN9qmRkX8p9MYkP2jB34t
=QJjf
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Qemu-devel] [PATCH 1/1] net: fix multiple NICs causing net opts process to stop
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
0 siblings, 0 replies; 2+ messages in thread
From: Mark McLoughlin @ 2009-10-12 8:52 UTC (permalink / raw)
To: qemu-devel; +Cc: Mark McLoughlin
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-10-12 8:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Qemu-devel] [PATCH 1/1] net: fix multiple NICs causing net opts process to stop Mark McLoughlin
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).