cryptospore / rpms / qemu-kvm

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