From patchwork Wed Sep 3 06:25:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 385398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 944251400B6 for ; Wed, 3 Sep 2014 16:26:18 +1000 (EST) Received: from localhost ([::1]:42578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP41I-0007oH-On for incoming@patchwork.ozlabs.org; Wed, 03 Sep 2014 02:26:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP40l-00078z-Mg for qemu-devel@nongnu.org; Wed, 03 Sep 2014 02:25:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP40h-0002T1-G5 for qemu-devel@nongnu.org; Wed, 03 Sep 2014 02:25:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP40h-0002Sw-7g; Wed, 03 Sep 2014 02:25:39 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s836PaZP010447 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 3 Sep 2014 02:25:36 -0400 Received: from hp-dl380pg8-02.qe.lab.eng.nay.redhat.com (hp-dl380pg8-02.qe.lab.eng.nay.redhat.com [10.66.106.69]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s836PVBa026779; Wed, 3 Sep 2014 02:25:32 -0400 From: Jason Wang To: mst@redhat.com, qemu-devel@nongnu.org Date: Wed, 3 Sep 2014 14:25:30 +0800 Message-Id: <1409725530-1425-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Jason Wang , Andrey Korolyov , Michael Roth , Nikolay Nikolaev , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH] vhost_net: initialize acked_features to a safe value during ack 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 commit 2e6d46d77ed328d34a94688da8371bcbe243479b (vhost: add vhost_get_features and vhost_ack_features) removes the step that initializes the acked_features to backend_features. This will result an unexpected value of acked_features which may fail the features setting of vhost. This patch fixes it by recover this step. Cc: Nikolay Nikolaev Cc: Andrey Korolyov Cc: Michael S. Tsirkin Cc: Michael Roth Cc: qemu-stable@nongnu.org Signed-off-by: Jason Wang --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index f87c798..b1d4b1f 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -115,6 +115,7 @@ unsigned vhost_net_get_features(struct vhost_net *net, unsigned features) void vhost_net_ack_features(struct vhost_net *net, unsigned features) { + net->dev.acked_features = net->dev.backend_features; vhost_ack_features(&net->dev, vhost_net_get_feature_bits(net), features); }