Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1021219ybz; Thu, 16 Apr 2020 01:02:55 -0700 (PDT) X-Google-Smtp-Source: APiQypIsYiIuR0Cp33blOvCg/Pi3zoj58WnuyQNBMEFxhAFk4LrGV5qi28Oq6x/xE2x+BjDgrUpP X-Received: by 2002:a17:906:68cf:: with SMTP id y15mr8293617ejr.260.1587024174937; Thu, 16 Apr 2020 01:02:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587024174; cv=none; d=google.com; s=arc-20160816; b=xdewkmcaJQUsxrrm+VbIAnyDiO3bsWmzajhP+U+2dcp9j0WHUUrEyNz5qt+z2QOHjK dJ3LdFcdLs2gB/RBF6kUh5HxGr5yJYesIvccjidiOpBBcu3hdPyihc77mhDsYMRL2c95 EvtL8+ybi+UXKfduUTpcsILMx+ry98ZYauSdWkJMgxMGuo0M7OIcuuufegANA6oKQzdc T3rg8C8lb3GRtya9F26c9Xh694QlUmV+SqBNwqZJRdNPBfkyIa/v7IDH8F78GN5mij1w qOF6a03RW6bcFq8lNghmYnmPaNW9YgKrzQcydHCmwkquL8wmzHYiZlRZNemveEe5utWZ gB6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=J/bW9r45TOwsNmE8eTZdikVBjfTc4MSQA0VtKPvgd54=; b=VsGzix1bN3r110Sj7aD5c0XvbTpacgwo0FUn4A2xFWp6WEn97QU4QRhwjs8iP5cxiV qGSa9d4okeAONdZg7W2pKdGoXC+DlW/1GxBRG9uT4kkBl02/c4tes9Hq6DUUpbMKxT1T tDTcrFKu2Yx3qxwYMD+MNAN37/wOwfFlK2FSdOBaT5+AklNAtZPw258tCQ2pOKAvtRLU zqEUJLLA2G68doXccCt3N86eCj3kvK6HINeOkCQwiCULBl9OYeo+MXohyUu3ndntEtBR CIywnMRdURgk7Jn6tYv2kbBw/ZPpGqDnjhQwlPQN/M1KesvbVK7qwLmWHjS4SuBHgrSV dQzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ixz4VGS7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bd4si195796edb.607.2020.04.16.01.02.31; Thu, 16 Apr 2020 01:02:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ixz4VGS7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2441051AbgDPH6l (ORCPT + 99 others); Thu, 16 Apr 2020 03:58:41 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35687 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2440152AbgDPH5G (ORCPT ); Thu, 16 Apr 2020 03:57:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587023825; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J/bW9r45TOwsNmE8eTZdikVBjfTc4MSQA0VtKPvgd54=; b=ixz4VGS7zpVs29ofxdgyCMMHleii3YoJ/6clpEQeYGRpQS3Rt3sXidaPVBzbuX5MQTjJNW F9uf4KfKCCsLUheTwABxr3nHx1fwMQDXFcaOCsO2BcXUy/QmXnNeoGKfLObKSIgHpQThNS jC/NAmyBD7gkLnt90vv7+6RppsdHIJA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-YgMnOMW2PYamKI8TvnTRkQ-1; Thu, 16 Apr 2020 03:57:02 -0400 X-MC-Unique: YgMnOMW2PYamKI8TvnTRkQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF545801E5E; Thu, 16 Apr 2020 07:57:00 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-112-194.ams2.redhat.com [10.36.112.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 726E17E7C0; Thu, 16 Apr 2020 07:56:58 +0000 (UTC) From: =?UTF-8?q?Eugenio=20P=C3=A9rez?= To: "Michael S. Tsirkin" Cc: Stephen Rothwell , "virtualization@lists.linux-foundation.org" , Christian Borntraeger , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Linux Next Mailing List , kvm list , Cornelia Huck , Halil Pasic , "linux-kernel@vger.kernel.org" Subject: [PATCH v2 3/8] vhost: Replace vq->private_data access by backend accesors Date: Thu, 16 Apr 2020 09:56:38 +0200 Message-Id: <20200416075643.27330-4-eperezma@redhat.com> In-Reply-To: <20200416075643.27330-1-eperezma@redhat.com> References: <20200416075643.27330-1-eperezma@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function still places backend directly in private_data, instead of use the accesors created on ("cbfc8f21b49a vhost: Create accessors for virtqueues private_data"). Using accesor. Fixes: ("7ce8cc28ce48 tools/virtio: Add --reset=3Drandom") Signed-off-by: Eugenio P=C3=A9rez --- drivers/vhost/test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 251ca723ac3f..789c096e454b 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -265,7 +265,7 @@ static int vhost_test_set_features(struct vhost_test = *n, u64 features) =20 static long vhost_test_set_backend(struct vhost_test *n, unsigned index,= int fd) { - static void *private_data; + static void *backend; =20 const bool enable =3D fd !=3D -1; struct vhost_virtqueue *vq; @@ -290,11 +290,11 @@ static long vhost_test_set_backend(struct vhost_tes= t *n, unsigned index, int fd) } if (!enable) { vhost_poll_stop(&vq->poll); - private_data =3D vq->private_data; - vq->private_data =3D NULL; + backend =3D vhost_vq_get_backend(vq); + vhost_vq_set_backend(vq, NULL); } else { r =3D vhost_vq_init_access(vq); - vq->private_data =3D private_data; + vhost_vq_set_backend(vq, backend); if (r =3D=3D 0) r =3D vhost_poll_start(&vq->poll, vq->kick); } --=20 2.18.1