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 <erik.schilling@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
parent
4029089f75
commit
c63c9b3c83
1 changed files with 5 additions and 0 deletions
|
|
@ -421,6 +421,11 @@ impl<S: VhostUserSlaveReqHandler> SlaveReqHandler<S> {
|
|||
Ok(MasterReq::GET_PROTOCOL_FEATURES) => {
|
||||
self.check_request_size(&hdr, size, 0)?;
|
||||
let features = self.backend.get_protocol_features()?;
|
||||
|
||||
// Enable the `XEN_MMAP` protocol feature for backends if xen feature is enabled.
|
||||
#[cfg(feature = "xen")]
|
||||
let features = features | VhostUserProtocolFeatures::XEN_MMAP;
|
||||
|
||||
let msg = VhostUserU64::new(features.bits());
|
||||
self.send_reply_message(&hdr, &msg)?;
|
||||
self.protocol_features = features;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue