From patchwork Fri Apr 19 07:11:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 237862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3985D2C04CB for ; Fri, 19 Apr 2013 17:21:19 +1000 (EST) Received: from localhost ([::1]:41630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT5dB-00040S-2k for incoming@patchwork.ozlabs.org; Fri, 19 Apr 2013 03:21:13 -0400 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 Received: from mx1.redhat.com ([209.132.183.28]:65402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UT5cr-0000Ku-MH; Fri, 19 Apr 2013 03:20:53 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3J7Kpp7001311 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Apr 2013 03:20:52 -0400 Received: from amd-6168-8-1.englab.nay.redhat.com (amd-6168-8-1.englab.nay.redhat.com [10.66.104.52]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r3J7KmxY029469; Fri, 19 Apr 2013 03:20:49 -0400 From: Jason Wang To: aliguori@us.ibm.com, stefanha@redhat.com, qemu-devel@nongnu.org Date: Fri, 19 Apr 2013 15:11:15 +0800 Message-Id: <1366355475-7243-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Michal Privoznik , Jason Wang , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] tap: properly initialize vhostfds X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 Reviewed-by: Michal Privoznik --- 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;