From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYEcW-0002TW-8f for qemu-devel@nongnu.org; Fri, 03 May 2013 07:57:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYEcS-0002lF-Me for qemu-devel@nongnu.org; Fri, 03 May 2013 07:57:48 -0400 From: Stefan Hajnoczi Date: Fri, 3 May 2013 13:57:34 +0200 Message-Id: <1367582254-15060-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1367582254-15060-1-git-send-email-stefanha@redhat.com> References: <1367582254-15060-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] tap: properly initialize vhostfds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michal Privoznik , Anthony Liguori , Jason Wang , Stefan Hajnoczi , qemu-stable@nongnu.org From: Jason Wang Only tap->vhostfd were checked net_init_tap_one(), but tap->vhostfds were forgot, this will lead qemu to ignore all fds passed by management through vhostfds, and tries to create vhost_net device itself. Fix by adding this check also. Reportyed-by: Michal Privoznik Cc: Michal Privoznik Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang Reviewed-by: Michal Privoznik Signed-off-by: Stefan Hajnoczi --- net/tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/tap.c b/net/tap.c index 17bdf01..e0b7a2a 100644 --- a/net/tap.c +++ b/net/tap.c @@ -623,7 +623,7 @@ static int net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, vhostfdname || (tap->has_vhostforce && tap->vhostforce)) { int vhostfd; - if (tap->has_vhostfd) { + if (tap->has_vhostfd || tap->has_vhostfds) { vhostfd = monitor_handle_fd_param(cur_mon, vhostfdname); if (vhostfd == -1) { return -1; -- 1.8.1.4