Skip to content

Commit c63c9b3

Browse files
vireshkjiangliu
authored andcommitted
vhost: Enable XEN_MMAP protocol feature for xen
Automatically enable the VhostUserProtocolFeatures::XEN_MMAP feature for backends for Xen specific builds. With these the backends don't need to enable this feature and can directly support Xen. Suggested-by: Erik Schilling <[email protected]> Signed-off-by: Viresh Kumar <[email protected]>
1 parent 4029089 commit c63c9b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/vhost/src/vhost_user/slave_req_handler.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,11 @@ impl<S: VhostUserSlaveReqHandler> SlaveReqHandler<S> {
421421
Ok(MasterReq::GET_PROTOCOL_FEATURES) => {
422422
self.check_request_size(&hdr, size, 0)?;
423423
let features = self.backend.get_protocol_features()?;
424+
425+
// Enable the `XEN_MMAP` protocol feature for backends if xen feature is enabled.
426+
#[cfg(feature = "xen")]
427+
let features = features | VhostUserProtocolFeatures::XEN_MMAP;
428+
424429
let msg = VhostUserU64::new(features.bits());
425430
self.send_reply_message(&hdr, &msg)?;
426431
self.protocol_features = features;

0 commit comments

Comments
 (0)