[18/30] virtiofsd: get/set features callbacks
diff mbox series

Message ID 20191021105832.36574-19-dgilbert@redhat.com
State New
Headers show
Series
  • virtiofs daemon (base)
Related show

Commit Message

Dr. David Alan Gilbert Oct. 21, 2019, 10:58 a.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Add the get/set features callbacks.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 contrib/virtiofsd/fuse_virtio.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/contrib/virtiofsd/fuse_virtio.c b/contrib/virtiofsd/fuse_virtio.c
index 9c58f11634..ee9b3af3a4 100644
--- a/contrib/virtiofsd/fuse_virtio.c
+++ b/contrib/virtiofsd/fuse_virtio.c
@@ -46,6 +46,17 @@  struct virtio_fs_config {
     uint32_t num_queues;
 };
 
+/* Callback from libvhost-user */
+static uint64_t fv_get_features(VuDev *dev)
+{
+    return 1ULL << VIRTIO_F_VERSION_1;
+}
+
+/* Callback from libvhost-user */
+static void fv_set_features(VuDev *dev, uint64_t features)
+{
+}
+
 /*
  * Callback from libvhost-user if there's a new fd we're supposed to listen
  * to, typically a queue kick?
@@ -78,7 +89,9 @@  static bool fv_queue_order(VuDev *dev, int qidx)
 }
 
 static const VuDevIface fv_iface = {
-    /* TODO: Add other callbacks */
+    .get_features = fv_get_features,
+    .set_features = fv_set_features,
+
     .queue_is_processed_in_order = fv_queue_order,
 };