render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame 0030-virtiofsd-get-set-features-callbacks.patch

1d442b
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
1d442b
Date: Mon, 27 Jan 2020 19:00:59 +0000
1d442b
Subject: [PATCH] virtiofsd: get/set features callbacks
1d442b
MIME-Version: 1.0
1d442b
Content-Type: text/plain; charset=UTF-8
1d442b
Content-Transfer-Encoding: 8bit
1d442b
1d442b
Add the get/set features callbacks.
1d442b
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit f2cef5fb9ae20136ca18d16328787b69b3abfa18)
1d442b
---
1d442b
 tools/virtiofsd/fuse_virtio.c | 15 ++++++++++++++-
1d442b
 1 file changed, 14 insertions(+), 1 deletion(-)
1d442b
1d442b
diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
1d442b
index 1928a2025c..4819e56568 100644
1d442b
--- a/tools/virtiofsd/fuse_virtio.c
1d442b
+++ b/tools/virtiofsd/fuse_virtio.c
1d442b
@@ -46,6 +46,17 @@ struct virtio_fs_config {
1d442b
     uint32_t num_queues;
1d442b
 };
1d442b
 
1d442b
+/* Callback from libvhost-user */
1d442b
+static uint64_t fv_get_features(VuDev *dev)
1d442b
+{
1d442b
+    return 1ULL << VIRTIO_F_VERSION_1;
1d442b
+}
1d442b
+
1d442b
+/* Callback from libvhost-user */
1d442b
+static void fv_set_features(VuDev *dev, uint64_t features)
1d442b
+{
1d442b
+}
1d442b
+
1d442b
 /*
1d442b
  * Callback from libvhost-user if there's a new fd we're supposed to listen
1d442b
  * to, typically a queue kick?
1d442b
@@ -78,7 +89,9 @@ static bool fv_queue_order(VuDev *dev, int qidx)
1d442b
 }
1d442b
 
1d442b
 static const VuDevIface fv_iface = {
1d442b
-    /* TODO: Add other callbacks */
1d442b
+    .get_features = fv_get_features,
1d442b
+    .set_features = fv_set_features,
1d442b
+
1d442b
     .queue_is_processed_in_order = fv_queue_order,
1d442b
 };
1d442b