virtio-devices, block: Reject sector 0 discard/"write zeroes" requests

As well as rejecting writes to sector 0 in the case of raw files where
the user hasn't specified the image_type also reject virtio requests of
type discard and write_zeroes.

Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-02-19 11:55:36 -08:00
committed by Bo Chen
parent 76e233504b
commit a63315df54
2 changed files with 11 additions and 0 deletions

View File

@@ -263,6 +263,7 @@ impl BlockEpollHandler {
self.disk_nsectors.load(Ordering::SeqCst),
self.disk_image.as_mut(),
&self.serial,
self.disable_sector0_writes,
desc_chain.head_index() as u64,
);