vmm: config: Add sparse flag to control disk space allocation

Add sparse boolean configuration option to DiskConfig with a default
value of true to control disk space allocation behavior.

When sparse is true, the disk uses sparse allocation where deallocated
blocks are returned to the filesystem, and the DISCARD feature is
advertised to the guest.

When sparse is false, disk space is kept fully allocated and DISCARD
is not advertised.

WRITE_ZEROES is always advertised when the backend supports it,
regardless of the sparse setting.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-01-30 16:18:29 +01:00
committed by Rob Bradford
parent 7f4b56b217
commit 7dfcbff309
5 changed files with 19 additions and 2 deletions

View File

@@ -67,6 +67,7 @@ fuzz_target!(|bytes: &[u8]| -> Corpus {
EventFd::new(EFD_NONBLOCK).unwrap(),
None,
queue_affinity,
true,
)
.unwrap();