Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp682432ybb; Fri, 3 Apr 2020 09:53:21 -0700 (PDT) X-Google-Smtp-Source: APiQypINonK2DsI2zxmaJT4JigswZPC35DmXpXbiKHBuSBMRpgtrmOu/3y6pPWcb7F2elWem+X7Q X-Received: by 2002:a4a:919b:: with SMTP id d27mr7495081ooh.76.1585932801789; Fri, 03 Apr 2020 09:53:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585932801; cv=none; d=google.com; s=arc-20160816; b=drmtTzCBFZd+vdEEzki+vHYS7lGlu2eOYiI5Whrn7uXA2Tm3os2eNDAdbV9/IqzULh mPLP5FJXwTbRDcD4vzMVtPshgCNAfrNllqoIVs+coJDHuUJnkZ5Z2iGxNLCN9/ON6QJQ qiPIx4iXCb5KHRZy3axLT8OhS5zPfvgnzFCjj6XbaUanbAjAkWz/KS8FygUkAEVDlSf9 6hlSH4wcPien3c/9aU7EO5jPLiv3poq1/YaLuVVSpH07K56MLvuiCAxY6EXxGEiMkCyj VxywOIsJrXnhDD4lYdOSSunFHNcB6BL+h9MiA4dpQXss6qNMQo+SiN+CMXOtxHL/Pjum 0Pvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=+TgfKjPk2T5P2zzuaFMRdLZ3Utt6NiSkelGon/Wg0oc=; b=UqwNkNjZxdQLORd1B5g0IvPYo63GrIopvUhGVDkWfi7y+N6uR32rE2ZnnOK9vSpvMq PWYPpoR3pbn1psIHnIS6nuqds+C8XRSD5r5qLvSznro1nTHFlmD3jLnN+0ryfYoxuToX d8ZKLcuj6R/wlAAMZunvLGvdb8Ylsx73xyxMNU24pr9KWIosJnQrv91qonKJzXMZDq7t StVGkbShRXja23Rhl3qLlVJX1SCRn6nWlqjRIeg7YZlZcJd4BBFmAWAA+mDOQ3YzuLuT tm5TdWZ5sckv5RiGyTeAusJwOl8+Cj3KeE56mi61iMXMG0w+OxyKw3nvPc/Jz/8j24fH Vo/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B+ceakp9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id a66si3983436otb.65.2020.04.03.09.53.09; Fri, 03 Apr 2020 09:53:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B+ceakp9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2404602AbgDCQvp (ORCPT + 99 others); Fri, 3 Apr 2020 12:51:45 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:40738 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2403998AbgDCQvp (ORCPT ); Fri, 3 Apr 2020 12:51:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585932704; 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=B+ceakp9bFQhgWUY1QcR8OFVTuy007M26zVulVFI7htiG3xa6M+hrUksZX163otlJ/v9HD haTwB5jOSHgSTpFXPAOm3FQ0QKchACaixZ2eC9jqeS8Dd6cAMKwzCVD23HH4ObClp4BB/S YL/y6ELPAhMge22T321pPHujzDKU1eI= 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=20P=C3=A9rez?= To: "Michael S. Tsirkin" Cc: kvm list , "virtualization@lists.linux-foundation.org" , Linux Next Mailing List , =?UTF-8?q?Eugenio=20P=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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); } -- 2.18.1