Commit Graph

9387 Commits

Author SHA1 Message Date
Anatol Belski
a94fa554c3 hypervisor: kvm: Fix nightly rustfmt import ordering
Nightly rustfmt now prefers `self` re-exports inline rather
than a separate 'pub use {kvm_bindings, kvm_ioctls}' line.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-03-01 18:07:22 +00:00
dependabot[bot]
d1c89a271d build: Bump crate-ci/typos from 1.43.5 to 1.44.0
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.43.5 to 1.44.0.
- [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.5...v1.44.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-28 00:51:12 +00:00
Rob Bradford
5b5e5cb999 vmm: cpu: Avoid potential infinite loop during core scheduling setup
Avoid a potential infinite loop where if the leader fails to create a
cookie due to an unexpected error (not one of the SMT/no kernel support
errors) then the other vcpu threads will continue around their
spinloops.

This change also clarifies the state machine for the leader election
with an explicit enum.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-27 14:06:28 +00:00
Muminul Islam
b41927dbcc tests: cvm: remove unused GuestAddress import
Drop an unused vm_memory::GuestAddress import from common_cvm
in integration tests to keep the module clean.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
a216cf164f tests: use default memory helper in integration tests
Replace hard-coded --memory size=512M args with default_memory()
across integration tests to centralize default memory settings.
This reduces duplicated CLI fragments and keeps behavior consistent.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
c35bfbd79f tests: use default_cpus() across integration tests
Replace hard-coded --cpus boot=<n> arguments in integration tests
with GuestCommand::default_cpus() for shared, centralized defaults.

This removes duplicated CLI fragments and keeps CPU setup consistent.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
af764235a0 tests: nested not supported for CVM on MSHV
Nested on MSHV confident VM not supported yet.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
32edcf39a6 tests: centralize memory validation in test helpers
Replace the hard-coded memory threshold check in the simple launch
integration test with Guest::validate_memory(None).

Add Guest::get_expected_memory() to derive thresholds from mem_size_str
and vm_type, and reuse this through validate_memory().

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
05aeef06e5 tests: centralize default memory args in helpers
Replace hard-coded --memory args in simple launch tests
with GuestCommand defaults driven by Guest state.
Add Guest.mem_size_str with a default of 512M and introduce
default_memory_string() and GuestCommand::default_memory().

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
45a5c7a04e tests: validate CPU count in the test infra
Instead of validating number of CPU in the test case itself,
moving the checking of the CPU count to Guest struct with a
new function as The Guest already has the Default CPU number.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
60c6242bde tests: centralize default CPU arguments in test infrastructure
Replace the hard-coded  .args(["--cpus", "boot=1"]) in the simple
launch integration test with a shared helper (default_cpus) from test
infrastructure.

Extend Guest with explicit CPU-related defaults (num_cpu, nested)
and add default_cpus_string() so CPU configuration is derived from
guest state instead of being duplicated at call sites.

This refactor improves consistency and makes CPU defaults easier to
maintain across integration tests.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
Muminul Islam
fdc51d923f tests: refactor event sequencing expectations for simple launch
Move MetaEvent from the integration test into shared test infrastructure
and expose it for reuse. Add a Guest helper that returns the expected
sequential events for simple launch, and update the integration test to
consume this helper instead of maintaining a local event list.

Adjust expected behavior for confidential VMs by omitting the disk reset
event, which is not guaranteed to be emitted in that mode. Preserve the
existing expected sequence for non-confidential VMs.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-27 10:44:18 +00:00
dependabot[bot]
9fd9c24419 build: Bump actions/upload-artifact from 6 to 7
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-27 00:50:46 +00:00
Victor Vieux
110192087e vmm: config: Fix missing comma in NetConfig help text
The SYNTAX help string for --net was missing a comma between
pci_segment and offload_tso parameters, making the help output
show them as a single run-on token.

Signed-off-by: Victor Vieux <vieux@repl.it>
2026-02-26 21:48:55 +00:00
Saravanan D
00c05f4761 block: Use logical block size for alignment
O_DIRECT requires buffer addresses to be aligned to the backend
device's logical block size. The existing bounce buffer logic in
execute_async() hardcodes SECTOR_SIZE (512) for the alignment check
and bounce buffer allocation. This is insufficient for devices with
a 4096-byte logical block size, where misaligned buffers cause
-EINVAL from the host kernel.

Add an alignment() method to the AsyncIo trait that returns the
backend's logical block size, defaulting to SECTOR_SIZE. The three
raw I/O backends (io_uring, AIO, synchronous) probe the device
topology via DiskTopology::probe() at creation time and return the
actual logical block size. All image format backends would simply
use the default value of 512 bytes since their underlying are
not block devices.

execute_async() now queries disk_image.alignment() instead of using
the hardcoded SECTOR_SIZE

Fixes: #7720

Signed-off-by: Saravanan D <saravanand@crusoe.ai>
2026-02-26 15:47:17 +00:00
Rob Bradford
272fa624ef ci: Disable RISC-V workflows temporarily
The workflows are very flaky and have been failing the majority of the
time recently.

Fixes: #7758

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-26 15:33:28 +00:00
Rob Bradford
3f800d2bb4 vmm: Add core scheduling support for vCPU threads
Add a core_scheduling option to --cpus with three modes of operation.
This feature takes advantage of a kernel feature that restricts
scheduling of processes on the SMT threads on the same core. This is
useful for mitigating certain classes of side-channel attacks and has
better performance that disabling SMT on the CPU.

- vm (default): All vCPU threads share one core scheduling cookie.
  They may be co-scheduled on SMT siblings while host threads are
  excluded - this has minimal performance impact and can even
  potentially improve performance from co-location.
- vcpu: Each vCPU gets a unique cookie preventing any two vCPUs from
  sharing SMT siblings. This has the strongest isolation but at some
  compromise of performance.
- off: No core scheduling applied (old behaviour).

This isolation is done by the kernel maintaining a "cookie" - threads
with the same cookie can share the same core.

In vCPU mode each vCPU thread the cookie is created when the thread
starts and each gets a unique cookie. For VM mode the first vCPU thread
(the leader) will create the cookie. All other vCPU threads started (via
hotplug or during boot) will have that cookie shared to it.

EINVAL/ENODEV from prctl is silently ignored so this works transparently
on kernels older than 5.14 that lack PR_SCHED_CORE or when SMT disabled.

Full details of this kernel feature can be found at:
https://docs.kernel.org/admin-guide/hw-vuln/core-scheduling.html

This implementation was inspired by crosvm's implementation - in
particular the enable_core_scheduling() function.

This is challenging to test via integration testing but the logging of
the received cookie shows it working:

VM case:

cloud-hypervisor:   0.243102s: <vcpu1> INFO:vmm/src/cpu.rs:1247 -- vCPU 1: core scheduling cookie = 0x33e4c167
cloud-hypervisor:   0.243102s: <vcpu0> INFO:vmm/src/cpu.rs:1247 -- vCPU 0: core scheduling cookie = 0x33e4c167

vCPU case:

cloud-hypervisor:   0.089356s: <vcpu0> INFO:vmm/src/cpu.rs:1247 -- vCPU 0: core scheduling cookie = 0x13993ad6
cloud-hypervisor:   0.089380s: <vcpu1> INFO:vmm/src/cpu.rs:1247 -- vCPU 1: core scheduling cookie = 0xd48e86e

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-02-26 11:57:39 +00:00
Pascal Scholz
15d1f1d7fd vmm: Refactor locking in AddressManager::move_bar
The current implementation performs multiple operations on allocators in
a row, with the single goal of updating the allocator. For each of these
operations, the `Mutex` guarding the respective allocator is locked anew
which introduces room for race conditions.

Instead of locking the mutex multiple times, we should lock it once to
perform the whole move.

Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
On-behalf-of: SAP pascal.scholz@sap.com
2026-02-26 11:56:59 +00:00
Muminul Islam
c9cf3294ea vmm: remove duplicate vm config parameter
Vm::create_device_manager accepted both config and _vm_config, but
both represented the same VM configuration source. Remove _vm_config
from the function signature and from its call site, and use config
for the TDX dynamic check.

This is a cleanup-only refactor with no intended functional change.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
2026-02-26 00:44:11 +00:00
Anatol Belski
6404d2d513 block: Assume sparse support for block devices
There is no non destructive readonly ioctl to query block device
discard or write zeroes capabilities. BLKZEROOUT is guaranteed to
succeed via kernel software fallback. BLKDISCARD may fail at runtime
with EOPNOTSUPP on devices that lack trim support, but the error
propagates to the guest as VIRTIO_BLK_S_IOERR and well behaved
guests handle it gracefully.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-26 00:43:20 +00:00
Anatol Belski
e067c76880 tests: windows: Disable sparse for DM snapshot OS disks
The Windows tests use a DM snapshot device for the OS disk.
DM snapshot targets do not support BLKDISCARD, so the VMM returns
IOERR for every TRIM attempt. viostor.sys may BSOD when the host
returns an error for negotiated discard/write-zeroes operations.

Add a default_disks_sparse_off() helper to GuestCommand and use it
in all Windows tests.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-26 00:43:20 +00:00
Anatol Belski
8a165aef3b tests: block: Add integration test for DM snapshot discard failure
Verify that the guest remains stable when BLKDISCARD fails on the
host backend.  DM snapshot targets do not support discard, so the
VMM returns VIRTIO_BLK_S_IOERR.  The test retries blkdiscard several
times, checking guest responsiveness after each attempt, then
confirms normal I/O still works.

The DM topology follows the same pattern used by WindowsDiskConfig.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-26 00:43:20 +00:00
Anatol Belski
bc374c537c tests: block: Add test for block device discard on loop device
Verify that a loopback block device advertises
VIRTIO_BLK_F_DISCARD to the guest and that blkdiscard succeeds.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-02-26 00:43:20 +00:00
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