From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT5cs-000402-Uz for qemu-devel@nongnu.org; Fri, 19 Apr 2013 03:20:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UT5cr-0000L0-Uf for qemu-devel@nongnu.org; Fri, 19 Apr 2013 03:20:54 -0400 From: Jason Wang Date: Fri, 19 Apr 2013 15:11:15 +0800 Message-Id: <1366355475-7243-1-git-send-email-jasowang@redhat.com> Subject: [Qemu-devel] [PATCH] tap: properly initialize vhostfds List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com, stefanha@redhat.com, qemu-devel@nongnu.org Cc: Michal Privoznik , Jason Wang , qemu-stable@nongnu.org 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 --- net/tap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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.7.1