From patchwork Fri Apr 3 16:51:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugenio Perez Martin X-Patchwork-Id: 11473171 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 836ED15AB for ; Fri, 3 Apr 2020 16:51:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 589852082F for ; Fri, 3 Apr 2020 16:51:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OzVJcL7q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404620AbgDCQvs (ORCPT ); Fri, 3 Apr 2020 12:51:48 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:27936 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2404613AbgDCQvs (ORCPT ); Fri, 3 Apr 2020 12:51:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585932707; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=+TgfKjPk2T5P2zzuaFMRdLZ3Utt6NiSkelGon/Wg0oc=; b=OzVJcL7qOcIYL33LSHySLcAKoI7sIzm7Rd72AEXFnfSEvB4WIOjK1oXvccXrRb2VWRKQTc ZNEVshkJDjj6+w8YVOvhXx6cAeTwtlln+LQf0P04sPr0I6FYVOFILWbTruOjXaN+fgKWq+ +NJoBmg5IutN/SF8nSiHYOmMdcarUuA= 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-117-FS9jkDrXPjKkupA58dS5qg-1; Fri, 03 Apr 2020 12:51:42 -0400 X-MC-Unique: FS9jkDrXPjKkupA58dS5qg-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 2655A1005F82; Fri, 3 Apr 2020 16:51:41 +0000 (UTC) Received: from eperezma.remote.csb (ovpn-113-28.ams2.redhat.com [10.36.113.28]) by smtp.corp.redhat.com (Postfix) with ESMTP id A450A18A85; Fri, 3 Apr 2020 16:51:38 +0000 (UTC) From: =?utf-8?q?Eugenio_P=C3=A9rez?= To: "Michael S. Tsirkin" Cc: kvm list , "virtualization@lists.linux-foundation.org" , Linux Next Mailing List , =?utf-8?q?Eugenio_P?= =?utf-8?q?=C3=A9rez?= , Stephen Rothwell , Cornelia Huck , Halil Pasic , "linux-kernel@vger.kernel.org" , Christian Borntraeger Subject: [PATCH 3/8] vhost: Replace vq->private_data access by backend accesors Date: Fri, 3 Apr 2020 18:51:14 +0200 Message-Id: <20200403165119.5030-4-eperezma@redhat.com> In-Reply-To: <20200403165119.5030-1-eperezma@redhat.com> References: <20200403165119.5030-1-eperezma@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org --- 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) static long vhost_test_set_backend(struct vhost_test *n, unsigned index, int fd) { - static void *private_data; + static void *backend; const bool enable = fd != -1; struct vhost_virtqueue *vq; @@ -290,11 +290,11 @@ static long vhost_test_set_backend(struct vhost_test *n, unsigned index, int fd) } if (!enable) { vhost_poll_stop(&vq->poll); - private_data = vq->private_data; - vq->private_data = NULL; + backend = vhost_vq_get_backend(vq); + vhost_vq_set_backend(vq, NULL); } else { r = vhost_vq_init_access(vq); - vq->private_data = private_data; + vhost_vq_set_backend(vq, backend); if (r == 0) r = vhost_poll_start(&vq->poll, vq->kick); }