[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200416075643.27330-4-eperezma@redhat.com>
Date: Thu, 16 Apr 2020 09:56:38 +0200
From: Eugenio Pérez <eperezma@...hat.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
"virtualization@...ts.linux-foundation.org"
<virtualization@...ts.linux-foundation.org>,
Christian Borntraeger <borntraeger@...ibm.com>,
Eugenio Pérez <eperezma@...hat.com>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
kvm list <kvm@...r.kernel.org>,
Cornelia Huck <cohuck@...hat.com>,
Halil Pasic <pasic@...ux.ibm.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH v2 3/8] vhost: Replace vq->private_data access by backend accesors
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=random")
Signed-off-by: Eugenio Pérez <eperezma@...hat.com>
---
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
Powered by blists - more mailing lists