From patchwork Wed Feb 20 09:18:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: tap: forbid creating multiqueue tap when hub is used Date: Tue, 19 Feb 2013 23:18:08 -0000 From: Jason Wang X-Patchwork-Id: 222018 Message-Id: <1361351888-45981-1-git-send-email-jasowang@redhat.com> To: aliguori@us.ibm.com, stefanha@redhat.com, qemu-devel@nongnu.org Cc: Jason Wang 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. Signed-off-by: Jason Wang --- This patch is needed for 1.4 stable also. --- net/tap.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/net/tap.c b/net/tap.c index 48c254e..1e14f59 100644 --- a/net/tap.c +++ b/net/tap.c @@ -693,6 +693,12 @@ int net_init_tap(const NetClientOptions *opts, const char *name, queues = tap->has_queues ? tap->queues : 1; vhostfdname = tap->has_vhostfd ? tap->vhostfd : NULL; + if (peer && (tap->has_queues || tap->has_fds || tap->has_vhostfds)) { + error_report("This configuration is not compatiable with multiqueue" + " tap"); + 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 ||