From adae98623371076f9736e75c81ac158bcfd168e2 Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Fri, 6 Aug 2021 15:01:37 +0200 Subject: [PATCH] virtio-devices: vhost_user: Add LOG_SHMFD protocol feature Now that the common vhost-user code can handle logging dirty pages through shared memory, we need to advertise it to the vhost-user backends with the protocol feature VHOST_USER_PROTOCOL_F_LOG_SHMFD. Signed-off-by: Sebastien Boeuf --- virtio-devices/src/vhost_user/blk.rs | 3 ++- virtio-devices/src/vhost_user/fs.rs | 3 ++- virtio-devices/src/vhost_user/net.rs | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/virtio-devices/src/vhost_user/blk.rs b/virtio-devices/src/vhost_user/blk.rs index 7a355a090..9ca1299e9 100644 --- a/virtio-devices/src/vhost_user/blk.rs +++ b/virtio-devices/src/vhost_user/blk.rs @@ -91,7 +91,8 @@ impl Blk { | VhostUserProtocolFeatures::MQ | VhostUserProtocolFeatures::CONFIGURE_MEM_SLOTS | VhostUserProtocolFeatures::REPLY_ACK - | VhostUserProtocolFeatures::INFLIGHT_SHMFD; + | VhostUserProtocolFeatures::INFLIGHT_SHMFD + | VhostUserProtocolFeatures::LOG_SHMFD; let (acked_features, acked_protocol_features) = vu.negotiate_features_vhost_user(avail_features, avail_protocol_features)?; diff --git a/virtio-devices/src/vhost_user/fs.rs b/virtio-devices/src/vhost_user/fs.rs index 630d07a5b..da2372a3b 100644 --- a/virtio-devices/src/vhost_user/fs.rs +++ b/virtio-devices/src/vhost_user/fs.rs @@ -337,7 +337,8 @@ impl Fs { let mut avail_protocol_features = VhostUserProtocolFeatures::MQ | VhostUserProtocolFeatures::CONFIGURE_MEM_SLOTS | VhostUserProtocolFeatures::REPLY_ACK - | VhostUserProtocolFeatures::INFLIGHT_SHMFD; + | VhostUserProtocolFeatures::INFLIGHT_SHMFD + | VhostUserProtocolFeatures::LOG_SHMFD; let slave_protocol_features = VhostUserProtocolFeatures::SLAVE_REQ | VhostUserProtocolFeatures::SLAVE_SEND_FD; if cache.is_some() { diff --git a/virtio-devices/src/vhost_user/net.rs b/virtio-devices/src/vhost_user/net.rs index 94c7e1996..da7e35afe 100644 --- a/virtio-devices/src/vhost_user/net.rs +++ b/virtio-devices/src/vhost_user/net.rs @@ -155,7 +155,8 @@ impl Net { let avail_protocol_features = VhostUserProtocolFeatures::MQ | VhostUserProtocolFeatures::CONFIGURE_MEM_SLOTS | VhostUserProtocolFeatures::REPLY_ACK - | VhostUserProtocolFeatures::INFLIGHT_SHMFD; + | VhostUserProtocolFeatures::INFLIGHT_SHMFD + | VhostUserProtocolFeatures::LOG_SHMFD; let (mut acked_features, acked_protocol_features) = vu.negotiate_features_vhost_user(avail_features, avail_protocol_features)?;