Skip to content

Commit 78e158e

Browse files
committed
block: Only negotiate the virtio features that we support
Currently the only feature supported is the standard virtio v1 feature. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
1 parent fdaec5e commit 78e158e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/block.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,12 @@ impl<'a> VirtioBlockDevice<'a> {
158158
return Err(VirtioError::VirtioLegacyOnly);
159159
}
160160

161+
// Don't support any advanced features for now
162+
let supported_features = VIRTIO_F_VERSION_1;
163+
161164
// Report driver features
162-
self.transport.set_features(device_features);
165+
self.transport
166+
.set_features(device_features & supported_features);
163167

164168
self.transport.add_status(VIRTIO_STATUS_FEATURES_OK);
165169
if self.transport.get_status() & VIRTIO_STATUS_FEATURES_OK != VIRTIO_STATUS_FEATURES_OK {

0 commit comments

Comments
 (0)