summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-02-21 11:05:56 +0800
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-04-02 10:07:24 -0500
commit332e93417a677a2f6845cd7215a2f20a227d3251 (patch)
treeba69b584e6844030af96cfd6e01c854db1f960f5
parente6b795f34e2dfb440340d559c6813ce0febec937 (diff)
downloadqemu-332e93417a677a2f6845cd7215a2f20a227d3251.tar.gz
tap: forbid creating multiqueue tap when hub is used
Obviously, hub does not support multiqueue tap. So this patch forbids creating multiple queue tap when hub is used to prevent the crash when command line such as "-net tap,queues=2" is used. Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit ce675a7579fea498397c5d2da3c5367671e9f02a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--net/tap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tap.c b/net/tap.c
index 48c254ed85..daab350efc 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -693,6 +693,13 @@ int net_init_tap(const NetClientOptions *opts, const char *name,
queues = tap->has_queues ? tap->queues : 1;
vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL;
+ /* QEMU vlans does not support multiqueue tap, in this case peer is set.
+ * For -netdev, peer is always NULL. */
+ if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) {
+ error_report("Multiqueue tap cannnot be used with QEMU vlans");
+ return -1;
+ }
+
if (tap->has_fd) {
if (tap->has_ifname || tap->has_script || tap->has_downscript ||
tap->has_vnet_hdr || tap->has_helper || tap->has_queues ||