diff mbox series

[6/6] virtiofsd: Opt in for slave start/stop/shutdown functionality

Message ID 20210125180115.22936-7-vgoyal@redhat.com (mailing list archive)
State New, archived
Headers show
Series vhost-user: Shutdown/Flush slave channel properly | expand

Commit Message

Vivek Goyal Jan. 25, 2021, 6:01 p.m. UTC
This is an opt-in feature not enabled by default. Enable it in
protocol features by setting VHOST_USER_PROTOCOL_F_SLAVE_CH_START_STOP.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 tools/virtiofsd/fuse_virtio.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/tools/virtiofsd/fuse_virtio.c b/tools/virtiofsd/fuse_virtio.c
index 6805d8ba01..9328c8fac6 100644
--- a/tools/virtiofsd/fuse_virtio.c
+++ b/tools/virtiofsd/fuse_virtio.c
@@ -103,6 +103,11 @@  static void fv_set_features(VuDev *dev, uint64_t features)
 {
 }
 
+static uint64_t fv_get_protocol_features(VuDev *dev)
+{
+    return 1ULL << VHOST_USER_PROTOCOL_F_SLAVE_CH_START_STOP;
+}
+
 /*
  * Callback from libvhost-user if there's a new fd we're supposed to listen
  * to, typically a queue kick?
@@ -902,6 +907,7 @@  static const VuDevIface fv_iface = {
     .get_features = fv_get_features,
     .set_features = fv_set_features,
 
+    .get_protocol_features = fv_get_protocol_features,
     /* Don't need process message, we've not got any at vhost-user level */
     .queue_set_started = fv_queue_set_started,