thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
ddf19c
From 59bfe3ad924d00dc9c7a4363fcd3db36ea247988 Mon Sep 17 00:00:00 2001
ddf19c
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ddf19c
Date: Mon, 27 Jan 2020 19:00:59 +0100
ddf19c
Subject: [PATCH 028/116] virtiofsd: get/set features callbacks
ddf19c
MIME-Version: 1.0
ddf19c
Content-Type: text/plain; charset=UTF-8
ddf19c
Content-Transfer-Encoding: 8bit
ddf19c
ddf19c
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
Message-id: <20200127190227.40942-25-dgilbert@redhat.com>
ddf19c
Patchwork-id: 93478
ddf19c
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 024/112] virtiofsd: get/set features callbacks
ddf19c
Bugzilla: 1694164
ddf19c
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
ddf19c
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ddf19c
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
ddf19c
ddf19c
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ddf19c
ddf19c
Add the get/set features callbacks.
ddf19c
ddf19c
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ddf19c
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
(cherry picked from commit f2cef5fb9ae20136ca18d16328787b69b3abfa18)
ddf19c
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ddf19c
---
ddf19c
 tools/virtiofsd/fuse_virtio.c | 15 ++++++++++++++-
ddf19c
 1 file changed, 14 insertions(+), 1 deletion(-)
ddf19c
ddf19c
diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
ddf19c
index 1928a20..4819e56 100644
ddf19c
--- a/tools/virtiofsd/fuse_virtio.c
ddf19c
+++ b/tools/virtiofsd/fuse_virtio.c
ddf19c
@@ -46,6 +46,17 @@ struct virtio_fs_config {
ddf19c
     uint32_t num_queues;
ddf19c
 };
ddf19c
 
ddf19c
+/* Callback from libvhost-user */
ddf19c
+static uint64_t fv_get_features(VuDev *dev)
ddf19c
+{
ddf19c
+    return 1ULL << VIRTIO_F_VERSION_1;
ddf19c
+}
ddf19c
+
ddf19c
+/* Callback from libvhost-user */
ddf19c
+static void fv_set_features(VuDev *dev, uint64_t features)
ddf19c
+{
ddf19c
+}
ddf19c
+
ddf19c
 /*
ddf19c
  * Callback from libvhost-user if there's a new fd we're supposed to listen
ddf19c
  * to, typically a queue kick?
ddf19c
@@ -78,7 +89,9 @@ static bool fv_queue_order(VuDev *dev, int qidx)
ddf19c
 }
ddf19c
 
ddf19c
 static const VuDevIface fv_iface = {
ddf19c
-    /* TODO: Add other callbacks */
ddf19c
+    .get_features = fv_get_features,
ddf19c
+    .set_features = fv_set_features,
ddf19c
+
ddf19c
     .queue_is_processed_in_order = fv_queue_order,
ddf19c
 };
ddf19c
 
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c