Commit Graph

9364 Commits

Author SHA1 Message Date
Anatol Belski
25a63c8b87 tests: block: Add trailing_args parameter to run_qemu_img()
Extend run_qemu_img() with an optional trailing_args parameter
for arguments that follow the image path, such as the size in
'qemu-img create -f raw <path> 128M'.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-26 00:43:20 +00:00
Demi Marie Obenour
989f3a3233 misc: generic vhost-user: reject virtio device IDs that cannot work
Some virtio devices cannot be implemented via vhost-user because they
require tight integration with the VMM.  This includes the IOMMU and
watchdog devices.

An attempt to create a generic vhost-user device with one of these IDs
is always either a bug or human error.  To aid debugging, return a
helpful error message rather than silently continuing.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
7ea1fa07a2 misc: generic vhost-user: support human-readable device ID
This avoids having to pass the numeric device ID, which is not
very meaningful to humans.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
042d1abd67 docs: generic vhost-user: document
Include documentation for the generic vhost-user device.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
d6b80d9845 tests: generic vhost-user: add support
Include integeration tests for generic vhost-user devices.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
36371283c6 ch-remote: add generic vhost-user support
Support adding generic vhost-user devices via the ch-remote CLI.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
cfb69c68d2 virtio-devices: generic vhost-user: add D-Bus API
Allow adding and removing generic vhost-user devices via D-Bus.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
df86b2864b vmm: add HTTP API endpoints for generic vhost-user
This includes OpenAPI schemas.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
d510f11a50 misc: generic-vhost-user: wire up to command line
Support adding generic vhost-user devices via the Cloud Hypervisor
command line.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
085a7a49fa vmm: generic vhost-user: add support
Add VMM support for generic vhost-user devices.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
Demi Marie Obenour
8c618ff5e0 virtio-devices: generic-vhost-user: implement device
This implements a generic vhost-user device.  All information about this
device must be provided to Cloud Hypervisor via the command-line or API.
The main use-case is types of vhost-user devices Cloud Hypervisor
doesn't know about, but it can also be used for types it does know
about.

The generic device delegates all configuration space handling to the
backend.  This means that the vhost-user backend must support
configuration space access.  It also means that the backend has control
of configuration space.  For instance, this means that setting the tag
of a virtio-fs device on the virtiofsd command line works as expected.

If the VM is snapshotted or migrated, the backend must write the
configuration space to a separate save file or migration stream.
Similarly, if the VM is restored or migrated, the backend must read the
configuration space from a separate save file or migration stream.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-24 07:53:53 +00:00
dependabot[bot]
8a09b3870c build: Bump the non-rust-vmm group across 2 directories with 12 updates
Bumps the non-rust-vmm group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.101` | `1.0.102` |
| [clap](https://github.com/clap-rs/clap) | `4.5.59` | `4.5.60` |
| [zbus](https://github.com/z-galaxy/zbus) | `5.13.2` | `5.14.0` |
| [bumpalo](https://github.com/fitzgen/bumpalo) | `3.19.1` | `3.20.2` |
| [jiff](https://github.com/BurntSushi/jiff) | `0.2.20` | `0.2.21` |
| [rustix](https://github.com/bytecodealliance/rustix) | `1.1.3` | `1.1.4` |
| [syn](https://github.com/dtolnay/syn) | `2.0.116` | `2.0.117` |

Bumps the non-rust-vmm group with 4 updates in the /fuzz directory: [anyhow](https://github.com/dtolnay/anyhow), [clap](https://github.com/clap-rs/clap), [bumpalo](https://github.com/fitzgen/bumpalo) and [syn](https://github.com/dtolnay/syn).


Updates `anyhow` from 1.0.101 to 1.0.102
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.101...1.0.102)

Updates `clap` from 4.5.59 to 4.5.60
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.59...clap_complete-v4.5.60)

Updates `zbus` from 5.13.2 to 5.14.0
- [Release notes](https://github.com/z-galaxy/zbus/releases)
- [Changelog](https://github.com/z-galaxy/zbus/blob/main/release-plz.toml)
- [Commits](https://github.com/z-galaxy/zbus/compare/zbus-5.13.2...zbus-5.14.0)

Updates `bumpalo` from 3.19.1 to 3.20.2
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/v3.19.1...v3.20.2)

Updates `clap_builder` from 4.5.59 to 4.5.60
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.59...v4.5.60)

Updates `jiff` from 0.2.20 to 0.2.21
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.20...jiff-static-0.2.21)

Updates `jiff-static` from 0.2.20 to 0.2.21
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.20...jiff-static-0.2.21)

Updates `rustix` from 1.1.3 to 1.1.4
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Changelog](https://github.com/bytecodealliance/rustix/blob/main/CHANGES.md)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v1.1.3...v1.1.4)

Updates `syn` from 2.0.116 to 2.0.117
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.116...2.0.117)

Updates `zbus_macros` from 5.13.2 to 5.14.0
- [Release notes](https://github.com/z-galaxy/zbus/releases)
- [Changelog](https://github.com/z-galaxy/zbus/blob/main/release-plz.toml)
- [Commits](https://github.com/z-galaxy/zbus/compare/zbus_macros-5.13.2...zbus_macros-5.14.0)

Updates `zvariant` from 5.9.2 to 5.10.0
- [Release notes](https://github.com/z-galaxy/zbus/releases)
- [Changelog](https://github.com/z-galaxy/zbus/blob/main/release-plz.toml)
- [Commits](https://github.com/z-galaxy/zbus/compare/zvariant-5.9.2...zvariant-5.10.0)

Updates `zvariant_derive` from 5.9.2 to 5.10.0
- [Release notes](https://github.com/z-galaxy/zbus/releases)
- [Changelog](https://github.com/z-galaxy/zbus/blob/main/release-plz.toml)
- [Commits](https://github.com/z-galaxy/zbus/compare/zvariant_derive-5.9.2...zvariant_derive-5.10.0)

Updates `anyhow` from 1.0.101 to 1.0.102
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.101...1.0.102)

Updates `clap` from 4.5.59 to 4.5.60
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.59...clap_complete-v4.5.60)

Updates `bumpalo` from 3.19.1 to 3.20.2
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/v3.19.1...v3.20.2)

Updates `clap_builder` from 4.5.59 to 4.5.60
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.59...v4.5.60)

Updates `syn` from 2.0.116 to 2.0.117
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.116...2.0.117)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.102
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.5.60
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zbus
  dependency-version: 5.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: bumpalo
  dependency-version: 3.20.2
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.5.60
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff
  dependency-version: 0.2.21
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff-static
  dependency-version: 0.2.21
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: rustix
  dependency-version: 1.1.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.117
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zbus_macros
  dependency-version: 5.14.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: zvariant
  dependency-version: 5.10.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: zvariant_derive
  dependency-version: 5.10.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: anyhow
  dependency-version: 1.0.102
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.5.60
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: bumpalo
  dependency-version: 3.20.2
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.5.60
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.117
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-24 01:44:47 +00:00
Anatol Belski
6f19d0071d block: vhdx: Fix multiqueue data corruption
Wrap the Vhdx instance in Arc<Mutex<>> so that all queues share
a single mutex-protected backend, matching the approach already
used for QCOW2.

Vhdx::clone() uses dup() which shares the kernel file description
including the file offset. With multiple queues performing
concurrent seek+read/write on the shared offset, I/O operations
race and corrupt data.

Fixes: #7665

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-23 18:25:21 +00:00
Anatol Belski
184a229ca4 tests: vhdx: Enable VHDX fstrim integration test
Remove the #[ignore] attribute from
test_virtio_block_fstrim_unsupported_vhdx.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-23 18:25:21 +00:00
Anatol Belski
600e74f0af scripts: dev_cli.sh: Allow passing commands to shell subcommand
Accept arguments after -- in 'dev_cli.sh shell' and forward them
to 'bash -c' inside the container. When no arguments are given,
an interactive shell is started as before. This enables running
one-off commands in the CI container without an interactive session,
for example:

  ./scripts/dev_cli.sh shell -- rustup toolchain install nightly \&\& cargo +nightly fmt --all -- --check

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-23 16:07:23 +00:00
Anatol Belski
ec5374cd99 performance-metrics: Set image_type for backing file tests
Add explicit image_type=qcow2 along backing_files=on
for the relevant QCOW2 perf tests.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-22 21:05:25 +00:00
Bo Chen
8aaf3734aa build: Temporarily remove the vfio CI worker
This runner machine is out for maintenance.

Signed-off-by: Bo Chen <bchen@crusoe.ai>
2026-02-21 08:51:12 +00:00
Wei Liu
52b2ebb2b8 vmm: api: Fix image_type in OpenAPI definition
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-02-21 08:50:31 +00:00
Bo Chen
00e106e53e build: Release v51.0
This release contains security fixes. Details can be found in the
release notes.

Signed-off-by: Bo Chen <bchen@crusoe.ai>
v51.0
2026-02-19 16:28:52 -08:00
Rob Bradford
a63315df54 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>
2026-02-19 22:43:15 +00:00
Rob Bradford
76e233504b vhost_user_block: Disable use of backing files in test implementation
Remove the use of QCOW2 backing files in the test implementation used
for CI.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-19 22:43:15 +00:00
Rob Bradford
b3e8e2abc5 vmm, virtio-devices: Deny zero sector writes for autodetected raw images
If the disk image was autodetected to raw (not specified with image_type
= 0) then in the virtio-block subsystem generate errors for writes to
block 0 (treat as if read-only). This gives an immediate error vs using
the image implementations in the block subsystem.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-19 22:43:15 +00:00
Rob Bradford
6f2357c14e vmm: Improve resiliency of image type handling
Add an image_type to DiskConfig to specify the image type. If none is
specified autodetect the image type but disable potentially unsafe
behaviour in the QCOW2 backend by disabling the backing file support.

If the image type is autodetected then fix it in the config so that it
will be persistant across reboots and migrations/snapshot & restores.
This also handles the case where the image type was not specified as
part of the disk configuration.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-19 22:43:15 +00:00
Anatol Belski
e36096db3e vmm: openapi: Sync DiskConfig OpenAPI spec
Add backing_files and sparse fields to the REST API.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-19 19:09:03 +00:00
Anatol Belski
4d30ba12c8 block: qcow: Add test for BackingFilesDisabled error
Verify that opening a QCOW2 image with a backing file reference
through QcowDiskSync with backing_files=off produces the user-facing
BackingFilesDisabled error rather than MaxNestingDepthExceeded.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-19 13:48:40 +00:00
Anatol Belski
94368c622e block: Add BackingFilesDisabled error for actionable user guidance
When a QCOW2 image has a backing file but backing_files=on is not set,
the error was MaxNestingDepthExceeded which gives no indication that
this is a policy decision or how to resolve it.

Add a BackingFilesDisabled error variant whose message indicates that
backing file support is disabled and references the backing_files
option. The translation from MaxNestingDepthExceeded to
BackingFilesDisabled happens at the QcowDiskSync boundary where the
policy decision is made, preserving the original error for genuine
recursive depth exhaustion.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-19 13:48:40 +00:00
Anirudh Rayabharam
68f746fbea hypervisor: mshv: use the new default partition args function
The 0.6.7 version of the mshv crates introduced a new version of
make_default_partition_create_arg inside `struct Mshv`. This version
queries the available processor features on the host and gives the same
feature set to the guests.

Move Cloud Hypervisor to this new function.

Signed-off-by: Anirudh Rayabharam <anrayabh@microsoft.com>
2026-02-18 13:58:08 +00:00
Rob Bradford
003ef780e0 build: Bump to latest igvm released version 0.4.0
Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-18 13:45:13 +00:00
Saravanan D
17b0749e1c tests: Fix Generic Initiator integration test
test_guest_numa_generic_initiator was missing the #[test] attribute and
did not match the VFIO CI filter pattern "vfio::test_nvidia"

Add #[test] and rename to test_nvidia_guest_numa_generic_initiator so
the existing CI infrastructure picks it up on the vfio-nvidia runner.

Fixes: #7718

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-02-18 11:13:07 +00:00
Saravanan D
924baa9c0f vmm: Forward device_id from NumaConfig to NumaNode
The device_id field was added to both NumaConfig and NumaNode as part
of the Generic Initiator support, but create_numa_nodes() change
was missed when the commits were reorganized.

As a result, node.device_id is never propogated from the config to
the runtime node and the ACPI SRAT Type 5 (Generic Initiator Affinity)
entries were never emitted.

Add the missing propogation so that create_srat_table() can resolve
the device and emit the correct affinity structure

Fixes: #7717

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-02-18 11:13:07 +00:00
Wei Liu
0a5e79afce vmm: api: Expose the nested option in API description
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-02-17 23:39:44 +00:00
dependabot[bot]
08f338bcf6 build: Bump the non-rust-vmm group across 2 directories with 27 updates
Bumps the non-rust-vmm group with 14 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [bitflags](https://github.com/bitflags/bitflags) | `2.10.0` | `2.11.0` |
| [clap](https://github.com/clap-rs/clap) | `4.5.57` | `4.5.59` |
| [env_logger](https://github.com/rust-cli/env_logger) | `0.11.8` | `0.11.9` |
| [libc](https://github.com/rust-lang/libc) | `0.2.181` | `0.2.182` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.20.0` | `1.21.0` |
| [arc-swap](https://github.com/vorner/arc-swap) | `1.8.1` | `1.8.2` |
| [futures](https://github.com/rust-lang/futures-rs) | `0.3.31` | `0.3.32` |
| [async-executor](https://github.com/smol-rs/async-executor) | `1.13.3` | `1.14.0` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.55` | `1.2.56` |
| [jiff](https://github.com/BurntSushi/jiff) | `0.2.19` | `0.2.20` |
| [syn](https://github.com/dtolnay/syn) | `2.0.114` | `2.0.116` |
| [toml_parser](https://github.com/toml-rs/toml) | `1.0.6+spec-1.1.0` | `1.0.9+spec-1.1.0` |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.23` | `1.0.24` |
| [zmij](https://github.com/dtolnay/zmij) | `1.0.20` | `1.0.21` |

Bumps the non-rust-vmm group with 13 updates in the /fuzz directory:

| Package | From | To |
| --- | --- | --- |
| [bitflags](https://github.com/bitflags/bitflags) | `2.10.0` | `2.11.0` |
| [clap](https://github.com/clap-rs/clap) | `4.5.57` | `4.5.59` |
| [libc](https://github.com/rust-lang/libc) | `0.2.181` | `0.2.182` |
| [uuid](https://github.com/uuid-rs/uuid) | `1.20.0` | `1.21.0` |
| [arc-swap](https://github.com/vorner/arc-swap) | `1.8.1` | `1.8.2` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.55` | `1.2.56` |
| [futures-core](https://github.com/rust-lang/futures-rs) | `0.3.31` | `0.3.32` |
| [futures-sink](https://github.com/rust-lang/futures-rs) | `0.3.31` | `0.3.32` |
| [syn](https://github.com/dtolnay/syn) | `2.0.114` | `2.0.116` |
| [toml_parser](https://github.com/toml-rs/toml) | `1.0.6+spec-1.1.0` | `1.0.9+spec-1.1.0` |
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | `1.0.23` | `1.0.24` |
| [zmij](https://github.com/dtolnay/zmij) | `1.0.20` | `1.0.21` |
| [libfuzzer-sys](https://github.com/rust-fuzz/libfuzzer) | `0.4.10` | `0.4.12` |



Updates `bitflags` from 2.10.0 to 2.11.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.10.0...2.11.0)

Updates `clap` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.57...clap_complete-v4.5.59)

Updates `env_logger` from 0.11.8 to 0.11.9
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.8...v0.11.9)

Updates `libc` from 0.2.181 to 0.2.182
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.182/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.181...0.2.182)

Updates `uuid` from 1.20.0 to 1.21.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.20.0...v1.21.0)

Updates `arc-swap` from 1.8.1 to 1.8.2
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.8.1...v1.8.2)

Updates `futures` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `async-executor` from 1.13.3 to 1.14.0
- [Release notes](https://github.com/smol-rs/async-executor/releases)
- [Changelog](https://github.com/smol-rs/async-executor/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/async-executor/compare/v1.13.3...v1.14.0)

Updates `cc` from 1.2.55 to 1.2.56
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.55...cc-v1.2.56)

Updates `clap_builder` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.57...v4.5.59)

Updates `clap_lex` from 0.7.7 to 1.0.0
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_lex-v0.7.7...clap_lex-v1.0.0)

Updates `env_filter` from 0.1.4 to 1.0.0
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/env_filter-v0.1.4...env_filter-v1.0.0)

Updates `futures-channel` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-core` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-executor` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-io` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-macro` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-sink` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-task` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-util` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `jiff` from 0.2.19 to 0.2.20
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.19...jiff-static-0.2.20)

Updates `jiff-static` from 0.2.19 to 0.2.20
- [Release notes](https://github.com/BurntSushi/jiff/releases)
- [Changelog](https://github.com/BurntSushi/jiff/blob/master/CHANGELOG.md)
- [Commits](https://github.com/BurntSushi/jiff/compare/jiff-static-0.2.19...jiff-static-0.2.20)

Updates `syn` from 2.0.114 to 2.0.116
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.114...2.0.116)

Updates `toml_parser` from 1.0.6+spec-1.1.0 to 1.0.9+spec-1.1.0
- [Commits](https://github.com/toml-rs/toml/compare/toml_parser-v1.0.6...toml_parser-v1.0.9)

Updates `unicode-ident` from 1.0.23 to 1.0.24
- [Release notes](https://github.com/dtolnay/unicode-ident/releases)
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.23...1.0.24)

Updates `zmij` from 1.0.20 to 1.0.21
- [Release notes](https://github.com/dtolnay/zmij/releases)
- [Commits](https://github.com/dtolnay/zmij/compare/1.0.20...1.0.21)

Updates `bitflags` from 2.10.0 to 2.11.0
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.10.0...2.11.0)

Updates `clap` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.57...clap_complete-v4.5.59)

Updates `libc` from 0.2.181 to 0.2.182
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.182/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.181...0.2.182)

Updates `uuid` from 1.20.0 to 1.21.0
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/v1.20.0...v1.21.0)

Updates `arc-swap` from 1.8.1 to 1.8.2
- [Changelog](https://github.com/vorner/arc-swap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vorner/arc-swap/compare/v1.8.1...v1.8.2)

Updates `cc` from 1.2.55 to 1.2.56
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.55...cc-v1.2.56)

Updates `clap_builder` from 4.5.57 to 4.5.59
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.5.57...v4.5.59)

Updates `clap_lex` from 0.7.7 to 1.0.0
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_lex-v0.7.7...clap_lex-v1.0.0)

Updates `futures-core` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `futures-sink` from 0.3.31 to 0.3.32
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.31...0.3.32)

Updates `syn` from 2.0.114 to 2.0.116
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.114...2.0.116)

Updates `toml_parser` from 1.0.6+spec-1.1.0 to 1.0.9+spec-1.1.0
- [Commits](https://github.com/toml-rs/toml/compare/toml_parser-v1.0.6...toml_parser-v1.0.9)

Updates `unicode-ident` from 1.0.23 to 1.0.24
- [Release notes](https://github.com/dtolnay/unicode-ident/releases)
- [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.23...1.0.24)

Updates `zmij` from 1.0.20 to 1.0.21
- [Release notes](https://github.com/dtolnay/zmij/releases)
- [Commits](https://github.com/dtolnay/zmij/compare/1.0.20...1.0.21)

Updates `libfuzzer-sys` from 0.4.10 to 0.4.12
- [Changelog](https://github.com/rust-fuzz/libfuzzer/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-fuzz/libfuzzer/commits)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.5.59
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: env_logger
  dependency-version: 0.11.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libc
  dependency-version: 0.2.182
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: uuid
  dependency-version: 1.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: arc-swap
  dependency-version: 1.8.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures
  dependency-version: 0.3.32
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: async-executor
  dependency-version: 1.14.0
  dependency-type: indirect
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: cc
  dependency-version: 1.2.56
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.5.59
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_lex
  dependency-version: 1.0.0
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: non-rust-vmm
- dependency-name: env_filter
  dependency-version: 1.0.0
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: non-rust-vmm
- dependency-name: futures-channel
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-core
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-executor
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-io
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-macro
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-sink
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-task
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-util
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff
  dependency-version: 0.2.20
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff-static
  dependency-version: 0.2.20
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.116
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: toml_parser
  dependency-version: 1.0.9+spec-1.1.0
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: unicode-ident
  dependency-version: 1.0.24
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zmij
  dependency-version: 1.0.21
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: bitflags
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.5.59
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libc
  dependency-version: 0.2.182
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: uuid
  dependency-version: 1.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: non-rust-vmm
- dependency-name: arc-swap
  dependency-version: 1.8.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: cc
  dependency-version: 1.2.56
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.5.59
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_lex
  dependency-version: 1.0.0
  dependency-type: indirect
  update-type: version-update:semver-major
  dependency-group: non-rust-vmm
- dependency-name: futures-core
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-sink
  dependency-version: 0.3.32
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.116
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: toml_parser
  dependency-version: 1.0.9+spec-1.1.0
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: unicode-ident
  dependency-version: 1.0.24
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zmij
  dependency-version: 1.0.21
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libfuzzer-sys
  dependency-version: 0.4.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 01:03:53 +00:00
dependabot[bot]
2a5c4f0e4d build: Bump crate-ci/typos from 1.43.4 to 1.43.5
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.43.4 to 1.43.5.
- [Release notes](https://github.com/crate-ci/typos/releases)
- [Changelog](https://github.com/crate-ci/typos/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crate-ci/typos/compare/v1.43.4...v1.43.5)

---
updated-dependencies:
- dependency-name: crate-ci/typos
  dependency-version: 1.43.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 00:49:30 +00:00
Rob Bradford
5dd5659440 build: Switch to released version of acpi_tables
Replace git version with latest released version from crates.io

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-16 22:07:52 +00:00
Anatol Belski
16d6a16e5c performance-metrics: Add standalone qcow2 perf tests
Add performance tests for standalone qcow2 images without backing
files - uncompressed, zlib and zstd compressed. Each variant
includes single queue and multiqueue tests for sequential
read, random read and warmed up sequential read.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-16 11:50:23 +00:00
Anatol Belski
333db1acb3 performance-metrics: Add multi-queue overlay block I/O tests
Add multiqueue num_queues=4 performance tests for qcow2 overlay
images with both qcow2 and raw backing files - sequential read,
random read, and warm read variants.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-16 11:50:23 +00:00
Anatol Belski
ecb971a491 performance-metrics: Add backing_files=on for overlay tests
The backing_files option defaults to false, so qcow2 overlay
tests fail with MaxNestingDepthExceeded. Pass backing_files=on
when the test file is an overlay.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-15 12:31:32 +00:00
Anatol Belski
20f5cadb6f scripts: Fix run_metrics.sh to use sha1sums common file
The focal image checksums have been moved in the -common
sha1sums file. Use the correct file for metrics.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-15 12:31:32 +00:00
Demi Marie Obenour
ce93686ad2 block: do not allow guest to not negotiate VIRTIO_BLK_F_RO
Unlike most virtio feature bits, VIRTIO_BLK_F_RO is not optional.
It indicates that the host is refusing to permit write operations, and
the guest must not be allowed to override it.

However, the block device currently does not enforce this.  If the guest
does not negotiate VIRTIO_BLK_F_RO, the block device will think the
device is writable and forward write requests to the backend.

This is not a security problem right now because the backing device of a
read-only device is always opened read-only.  The kernel will thus
reject the write operations with EBADF.  If support is added for
receiving the backing device file descriptor via SCM_RIGHTS (#7704),
it will be possible to have a read-only block device backed by a
writable file descriptor.  This would make the bug a genuine security
vulnerability.

Fix the bug by explicitly checking if VIRTIO_BLK_F_RO was offered but
not negotiated.  In this case, log a warning and proceed as if the guest
did acknowledge the feature.  This always indicates a guest driver bug.

Fixes: #7697
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-14 09:55:42 +00:00
Demi Marie Obenour
80ea1fe62d block: Allow (and ignore) FLUSH requests on read-only devices
OVMF sends FLUSH requests to read-only virtio-block devices.  Refusing
these requests prevents OVMF from accessing the EFI System Partition and
therefore makes VMs unable to boot.  Accept these requests instead.
them.

Ignoring these requests is possible, but inconsistent with fsync(2)
which honors them.

Fixes: #7698
Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-02-14 09:54:46 +00:00
Muminul Islam
ff4c8f7480 hypervisor: mshv: handle Special Debug Print VMG exit
Add handling for GHCB_INFO_SPECIAL_DBGPRINT VMG exit in the SEV-SNP
guest exit handler. This exit occurs when the guest sends debug print
requests through the GHCB interface.

Without this handler, SEV-SNP guests fail to boot when debug output
is triggered, such as when a debugger is attached to the guest image.

The handler acknowledges the exit without printing to avoid performance
degradation from frequent debug print requests.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-13 22:22:00 +00:00
Leander Kohler
30c86d5999 vmm: fix --net fd helptext for list syntax
The --net help text documented fd as fd=<fd1,fd2...>, but
comma-separated FD lists in option values must be bracketed to avoid
top-level option splitting.

Update NetConfig::SYNTAX to use fd=<[fd1,fd2,...]>, matching parser
behavior and existing net parsing tests:
`cargo test -p vmm test_net_parsing`

On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
2026-02-13 20:58:30 +00:00
Leander Kohler
adfcd17bfc vmm: Include invalid UUID string in ParseUuid err
On-behalf-of: SAP leander.kohler@sap.com
Signed-off-by: Leander Kohler <leander.kohler@cyberus-technology.de>
2026-02-13 20:58:30 +00:00
Anatol Belski
8e51c57aea tests: Add integration tests for virtio-blk DISCARD operations
Add comprehensive integration tests for DISCARD and WRITE_ZEROES:

Multiqueue stress tests verify concurrent operations across queues,
testing scattered writes with simultaneous fstrim, and write/discard
races that stress refcount table locking.

Format specific tests verify QCOW2 deallocates clusters after DISCARD,
raw files create holes using fallocate, and unsupported formats VHD
and VHDX correctly reject DISCARD requests.

Tests for sparse=off verify raw files preallocate full disk size and
QCOW2 uses zero flag instead of deallocating clusters.

Add helper functions to verify sparse files, count QCOW2 zero flagged
regions using qemu-img map, and verify guest reads zeros from
discarded regions.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
4676fdb494 block: Add unit tests for DISCARD zero flag
Add comprehensive tests for DISCARD and WRITE_ZEROES operations:

QCOW2 zero flag test validates the complete workflow: allocate
cluster, DISCARD it, verify reads return zeros, write new data,
verify cluster reallocated.

QcowSync tests verify punch_hole and write_zeroes with Arc<Mutex<>>
sharing, including tests for cache consistency with multiple async
I/O operations.

RawFileSync tests verify punch_hole and write_zeroes using
fallocate.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
45b115aeb0 block: raw: Implement punch_hole and write_zeroes
Implement punch_hole() and write_zeroes() for raw file backends using
io_uring and fallocate.

punch_hole() uses FALLOC_FL_PUNCH_HOLE to deallocate storage.
write_zeroes() uses FALLOC_FL_ZERO_RANGE to write zeros efficiently.

Both use FALLOC_FL_KEEP_SIZE to maintain file size.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
6c94975c80 block: qcow: Implement punch_hole and write_zeroes for QcowSync
Implement punch_hole and write_zeroes for QcowSync backend by
delegating to QcowFile::punch_hole which triggers cluster
deallocation. write_zeroes delegates to punch_hole as unallocated
clusters read as zeros in QCOW2.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
81c075b317 block: Add virtio-blk DISCARD and WRITE_ZEROES support
Add VIRTIO_BLK_T_DISCARD and VIRTIO_BLK_T_WRITE_ZEROES request types.
Parse discard/write_zeroes descriptors (sector, num_sectors, flags),
convert to byte offsets, and call punch_hole/write_zeroes on the disk
backend. Mark as unsupported in sync mode.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
e913d0d9cb block: qcow: Implement DISCARD with sparse aware deallocation
Implement DISCARD using QCOW2 zero flag (bit 0 of L2 entries) with
sparse aware behavior.

When sparse=true - fully deallocate clusters by decrementing
refcount, clearing L2 entry, and reclaiming storage via punch_hole
when refcount reaches zero.

When sparse=false - use zero flag to keep storage allocated while
marking as reading zeros. Only works when cluster is not shared.
Shared clusters are fully deallocated.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00
Anatol Belski
49a30cbbaf block: raw: Implement disk preallocation for sparse=false
When sparse=false is configured, preallocate the entire raw disk file
at startup using fallocate(). This provides space reservation and
reduces fragmentation.

Only applies to raw disks. QCOW2/VHD/VHDX formats manage their own
allocation.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-13 18:44:30 +00:00