From patchwork Wed Mar 31 18:20:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 49170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B364EB7D00 for ; Thu, 1 Apr 2010 05:26:17 +1100 (EST) Received: from localhost ([127.0.0.1]:41970 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nx2bz-0004zc-Pt for incoming@patchwork.ozlabs.org; Wed, 31 Mar 2010 14:25:55 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nx2aK-0004op-C4 for qemu-devel@nongnu.org; Wed, 31 Mar 2010 14:24:12 -0400 Received: from [140.186.70.92] (port=48617 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nx2aI-0004mT-Ek for qemu-devel@nongnu.org; Wed, 31 Mar 2010 14:24:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nx2aG-0000VE-J1 for qemu-devel@nongnu.org; Wed, 31 Mar 2010 14:24:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56710) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nx2aG-0000UT-82 for qemu-devel@nongnu.org; Wed, 31 Mar 2010 14:24:08 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2VIO5Yt023862 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 31 Mar 2010 14:24:05 -0400 Received: from redhat.com (vpn1-7-169.ams2.redhat.com [10.36.7.169]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o2VIO2NP018043; Wed, 31 Mar 2010 14:24:03 -0400 Date: Wed, 31 Mar 2010 21:20:31 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, Anthony Liguori Message-ID: <20100331182031.GA5200@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] vhost: fix features ack X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: David L Stevens vhost driver in qemu didn't ack features, and this happens to work because we don't really require any features. However, it's better not to rely on this. This patch passes features to vhost as guest acks them. Signed-off-by: David L Stevens Signed-off-by: Michael S. Tsirkin --- Anthony, here's a fixup patch to address an issue in vhost patches. Incidentially, what's the status of the vhost patchset? hw/virtio-net.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 9ddd58c..4c7c46e 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -218,6 +218,14 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint32_t features) (features >> VIRTIO_NET_F_GUEST_ECN) & 1, (features >> VIRTIO_NET_F_GUEST_UFO) & 1); } + if (!n->nic->nc.peer || + n->nic->nc.peer->info->type != NET_CLIENT_TYPE_TAP) { + return; + } + if (!tap_get_vhost_net(n->nic->nc.peer)) { + return; + } + return vhost_net_ack_features(tap_get_vhost_net(n->nic->nc.peer), features); } static int virtio_net_handle_rx_mode(VirtIONet *n, uint8_t cmd,