Commit Graph

11106 Commits

Author SHA1 Message Date
Oliver Anderson
6ea8e8e20e hypervisor: Optional vCPU MSR configuration update in vcpu constructor
When applying a CPU profile we need a way to change the configuration of
each vCPU to respect the requirements of the CPU profile.

This means that we need to set the feature MSRs in accordance with the
CPU profile upon configuring the vCPU and also ensuring that we do not
attempt to restore any MSRs that are not compatible with the profile
upon snapshot/restore.

The first step is to update `Vm::create_vcpu` to take an extra
parameter describing the necessary update.

In the case of KVM we modify the internal MSR state buffer when
constructing the vCPU whenever a VcpuMsrConfigUpdate is present.

The feature MSRs contained in the configuration will be treated in
follow up commits.

The changes to the vmm crate that are part of this commit are just
the minimum necessary to make the crate compile. We will update the
vmm crate to take CPU profiles into account in a follow up commit.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
2026-07-28 10:55:18 +00:00
Oliver Anderson
2aff169533 hypervisor: Add get_msr_index_list method to the hypervisor trait
CPU profiles will describe a list of MSRs they require when applying
the profile we want to check that the host has all the required MSRs
otherwise we have an incompatibility issue.

In order to check which MSRs the host supports we start by exposing the
hypervisor's get_msr_index_list method.

The MSRs required by a chosen CPU profile will be checked against the
output of the get_msr_index_list and get_feature_msrs on the hypervisor
in a follow up commit.

The get_msr_index_list method does not have an obvious implementation
for MSHV, because in that case one needs to obtain MSR indices from
the VM fd, after the VM has been initialized.

Since CPU profiles are only intended for the KVM hypervisor to begin
with, we leave the MSHV implementation as unimplemented for now. A
proper solution for MSHV should rather be found if/when CPU profiles
are also desired in that context.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
2026-07-28 10:55:18 +00:00
Oliver Anderson
9f5590fe6c vmm: Add KVM_GET_MSR_FEATURE_INDEX_LIST to seccomp rules
We need to update the seccomp filter to permit
KVM_GET_MSR_FEATURE_INDEX_LIST which we introduced in the previous
commit.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
2026-07-28 10:55:18 +00:00
Oliver Anderson
9a2661a9c8 hypervisor: Add get_feature_msrs method
KVM defines feature MSRs as MSRs that expose host capabilities and
processor features.

CPU profiles will describe how to adjust such feature MSRs similarly to
how they describe CPUID modifications.

We thus introduce a method on the hypervisor trait that queries the
hypervisor for the supported feature MSRs.

This will later be used to obtain the feature MSRs that need to be
adjusted when a CPU profile is applied.

The method will also be used by the upcoming CPU profile generation
tool which will be introduced in a follow up PR.

Signed-off-by: Oliver Anderson <oliver.anderson@cyberus-technology.de>
On-behalf-of: SAP oliver.anderson@sap.com
2026-07-28 10:55:18 +00:00
Anatol Belski
ebcf81d6ff ci: Update virtio-villain to v0.6.4
Bump the pinned virtio-villain tag to v0.6.4. This release fixes
runtime behavior in the batch runner so it no longer reports spurious
WEDGED when a batch times out or a VMM writes to stderr.

With those fixes and the new retries flag the excludes for the flaky
tests are no longer needed and are dropped. A flaky failure is retried
a couple of times rather than suppressed, while a consistent failure
still surfaces. This mimics the nextest approach.

It also adds a large batch of block and net conformance tests, so the
run covers more of the device model.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-28 07:06:06 +00:00
Anatol Belski
616bafbe8e block: io: Drop the redundant unsafe around the aio submit
vmm_sys_util marks IoContext::submit as a safe function, so the unsafe
block was inert and only silenced by allow(unused_unsafe). Call submit
directly.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-27 13:07:07 +00:00
Anatol Belski
ce9b49d98f block: io: Share the completion queue between the async backends
AioDataIo and UringDataIo each carried their own eventfd, their own
completion queue, and the same enqueue and signal idiom. Route both
through the existing CompletionCommon and keep each backend's own in
flight map.

The aio drain enqueues fetched events with complete rather than a
silent push, so a drain can leave the eventfd signaled and cause one
extra harmless device wake. The eventfd is a counter, so the extra
signal is safe and the syscall batching stays the same.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-27 13:07:07 +00:00
Anatol Belski
636d8a83ca block: io: Rename SyncCompletionQueue to CompletionCommon
The Sync prefix is too narrow because the queue is not tied to
synchronous execution. Rename it to CompletionCommon, following the
Common suffix the codebase already uses for shared helper types such
as VirtioCommon. The queue holds no engine specific state, so it can
be reused more widely across backends.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-27 13:07:07 +00:00
Stepan Rabotkin
5e01807fa2 vmm: api: Return 404 (not 500) for unknown device/disk id
Map NoDeviceToRemove and DeviceManager(UnknownDeviceId) to 404 Not
Found, update the OpenAPI 404 descriptions, and add unit tests.

Signed-off-by: Stepan Rabotkin <epicstyt@gmail.com>
Assisted-by: Claude:Opus-4.8
2026-07-27 13:05:26 +00:00
doge
a5e145bdef block: Fix QCOW double allocation after a failed L2 relocation
The relocate-on-write path in update_cluster_addr() pushes the old L2
table cluster onto unref_clusters before allocating the relocation
target. When that allocation fails at allocator exhaustion, the error
unwinds with the still-referenced table on the free list, its deferred
refcount update dropped, the L1 entry unchanged and the cached table
still clean. The next metadata flush publishes the cluster to the
allocator, and a later allocation hands the live L2 table to a new
writer, which overwrites it with a refcount block, another L2 table or
guest data. Retried writes against the same L1 slot re-enter the
clean-table branch and push further duplicates, so one cluster can also
be handed out to two writers at once.

Images holding compressed clusters reach this constantly: writing to a
compressed cluster always takes the decompress -> append_data_cluster
-> update_cluster_addr path, so every such write relocates its L2
table.

Allocate the relocation target first and release the old table only
once the allocation has succeeded. A failed relocation now leaves the
old table referenced, off the free lists and intact.

Add deterministic regression coverage for both entry points: a plain
write that exhausts the allocator at the L2 relocation step, and a
compressed-cluster write that triggers the same relocation.

Signed-off-by: doge <me@crackerben.com>
2026-07-27 11:19:34 +00:00
Julian Schindel
76c0d8204e main: use LazyCell instead of Option for logger time computation
Use `LazyCell` instead of `Option` to avoid repeating the initialization
code.

On-behalf-of: SAP julian.schindel@sap.com
Signed-off-by: Julian Schindel <julian.schindel@cyberus-technology.de>
2026-07-27 09:45:10 +00:00
Lily Goscha
8bd96078a9 virtio-devices: Release vsock local ports only to their owner
The vsock muxer tracked host-allocated local ports in a set, and
`remove_connection()` released `key.local_port` from it for every
connection it removed. Only host-initiated connections take their local
port from `allocate_local_port()`, though: guest-initiated ones use the
guest-chosen `dst_port` verbatim, and never hold an allocation.

Removal was therefore able to release a port its connection did not own.
A guest-initiated connection whose destination port collides with a
host-allocated ephemeral port dropped that port from the allocator's
free list on teardown, while the host-initiated connection that owned it
was still live and using it. The allocator could then hand the same port
out twice.

Track the owning peer (guest) port alongside each allocation, and
release an allocation only when the connection being removed matches the
recorded owner. Guest-initiated connections never match, so they can no
longer disturb host-side port accounting.

Reaching this from the guest additionally requires a host process
listening on the AF_UNIX path for a port in the host ephemeral range,
which is not how host services are normally deployed. Hitting the
duplicate allocation would further require the allocator to wrap its
~2^30 port range. This is a correctness fix rather than a fix for a
practically exploitable issue.

Add a regression test that drives the muxer through the colliding-port
sequence and checks the host connection keeps its allocation.

Signed-off-by: Lily Goscha <lilygoscha@gmail.com>
2026-07-24 23:02:06 +00:00
Sebastien Boeuf
4eb49e6ea8 ci: Add integration tests for snapshot preserving the source VM
Add a test for verifying that snapshotting a VM while preserving the
source VM works as expected.

Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>
Assisted-by: Claude:claude-opus-4-8
2026-07-24 16:40:39 +00:00
Sebastien Boeuf
7c190413ad vhost_user_block: Add DEVICE_STATE support
Advertise VHOST_USER_PROTOCOL_F_DEVICE_STATE and implement the
associated callbacks for the vhost-user-block backend.

Given there's no specific state that needs to be saved through these
operations, this a blank implementation.

This support will be useful for testing the snapshot case where the
source VM is preserved after the snapshot is complete.

Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>
Assisted-by: Claude:claude-opus-4-8
2026-07-24 16:40:39 +00:00
Sebastien Boeuf
17b5deeaed vmm: Allow preserving the source VM after snapshot
Extend the migration protocol with a `preserve_source` option so that a
source VM can be preserved. This benefits the snapshot case where the
offload daemon can now snapshot a VM without tearing it down.

Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>
Assisted-by: Claude:claude-opus-4-8
2026-07-24 16:40:39 +00:00
Sebastien Boeuf
b47c26fa56 virtio-devices: Resume vhost-user devices after snapshot
For vhost-user devices, a snapshot involved the vrings to be stopped,
but they couldn't be resumed. This commit aims at fixing this by saving
the vrings base so that it can be safely reset after the snapshot has
succeeded.

This will allow VMs where snapshots are taken from internal CH
implementation and from an offload daemon to be resumed once the
snapshot is complete.

Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>
Assisted-by: Claude:claude-opus-4-8
2026-07-24 16:40:39 +00:00
Stepan Rabotkin
aa19811139 vmm: openapi: Add missing 404 responses to spec
PR #8320 changed several endpoints to return 404 (Not Found) when the VM
has not been created yet, but the OpenAPI specification was not updated
to document these responses. Add the missing 404 entries for vm.info,
resize, resize-zone and the (cold) add-disk/device/pmem/net/vsock/vdpa
endpoints so the spec matches the implemented HTTP status codes.

Signed-off-by: Stepan Rabotkin <epicstyt@gmail.com>
Assisted-by: Claude:Opus-4.8
2026-07-24 15:16:11 +00:00
dependabot[bot]
249b9cf26d build(deps): bump the rust-vmm group across 2 directories with 1 update
Bumps the rust-vmm group with 1 update in the / directory: [micro_http](https://github.com/firecracker-microvm/micro-http).
Bumps the rust-vmm group with 1 update in the /fuzz directory: [micro_http](https://github.com/firecracker-microvm/micro-http).


Updates `micro_http` from `5c2254d` to `876f3fe`
- [Commits](5c2254d6cf...876f3feccc)

Updates `micro_http` from `5c2254d` to `876f3fe`
- [Commits](5c2254d6cf...876f3feccc)

---
updated-dependencies:
- dependency-name: micro_http
  dependency-version: 876f3feccc30e09225f2c77bf95a6b2d46a9259e
  dependency-type: direct:production
  dependency-group: rust-vmm
- dependency-name: micro_http
  dependency-version: 876f3feccc30e09225f2c77bf95a6b2d46a9259e
  dependency-type: direct:production
  dependency-group: rust-vmm
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 12:02:54 +00:00
Wei Liu
db4fbeee4b tests: add a memory prefault=on test case
Assisted-by: Opencode:GPT-5.6-Sol
Signed-off-by: Wei Liu <liuwe@microsoft.com>
2026-07-24 07:46:51 +00:00
dependabot[bot]
d4a37051a8 build(deps): bump the non-rust-vmm group across 2 directories with 36 updates
Bumps the non-rust-vmm group with 19 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [serde](https://github.com/serde-rs/serde) | `1.0.228` | `1.0.229` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.150` | `1.0.151` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.103` | `1.0.104` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.13.0` | `2.13.1` |
| [clap](https://github.com/clap-rs/clap) | `4.6.1` | `4.6.3` |
| [jiff](https://github.com/BurntSushi/jiff) | `0.2.32` | `0.2.34` |
| [libc](https://github.com/rust-lang/libc) | `0.2.186` | `0.2.187` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.18` | `2.0.19` |
| [zerocopy](https://github.com/google/zerocopy) | `0.8.54` | `0.8.55` |
| [remain](https://github.com/dtolnay/remain) | `0.2.15` | `0.2.16` |
| [futures](https://github.com/rust-lang/futures-rs) | `0.3.32` | `0.3.33` |
| [async-trait](https://github.com/dtolnay/async-trait) | `0.1.89` | `0.1.91` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.106` | `1.0.107` |
| [quote](https://github.com/dtolnay/quote) | `1.0.46` | `1.0.47` |
| [serde_repr](https://github.com/dtolnay/serde-repr) | `0.1.20` | `0.1.21` |
| [simd-adler32](https://github.com/mcountryman/simd-adler32) | `0.3.9` | `0.3.10` |
| [syn](https://github.com/dtolnay/syn) | `2.0.118` | `2.0.119` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.25.12+spec-1.1.0` | `0.25.13+spec-1.1.0` |
| [zbus_names](https://github.com/z-galaxy/zbus) | `4.3.3` | `4.3.4` |

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

| Package | From | To |
| --- | --- | --- |
| [serde](https://github.com/serde-rs/serde) | `1.0.228` | `1.0.229` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.150` | `1.0.151` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.103` | `1.0.104` |
| [bitflags](https://github.com/bitflags/bitflags) | `2.13.0` | `2.13.1` |
| [clap](https://github.com/clap-rs/clap) | `4.6.1` | `4.6.3` |
| [libc](https://github.com/rust-lang/libc) | `0.2.186` | `0.2.187` |
| [thiserror](https://github.com/dtolnay/thiserror) | `2.0.18` | `2.0.19` |
| [zerocopy](https://github.com/google/zerocopy) | `0.8.54` | `0.8.55` |
| [remain](https://github.com/dtolnay/remain) | `0.2.15` | `0.2.16` |
| [futures-core](https://github.com/rust-lang/futures-rs) | `0.3.32` | `0.3.33` |
| [futures-sink](https://github.com/rust-lang/futures-rs) | `0.3.32` | `0.3.33` |
| [futures-task](https://github.com/rust-lang/futures-rs) | `0.3.32` | `0.3.33` |
| [futures-util](https://github.com/rust-lang/futures-rs) | `0.3.32` | `0.3.33` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.106` | `1.0.107` |
| [quote](https://github.com/dtolnay/quote) | `1.0.46` | `1.0.47` |
| [simd-adler32](https://github.com/mcountryman/simd-adler32) | `0.3.9` | `0.3.10` |
| [syn](https://github.com/dtolnay/syn) | `2.0.118` | `2.0.119` |
| [toml_edit](https://github.com/toml-rs/toml) | `0.25.12+spec-1.1.0` | `0.25.13+spec-1.1.0` |



Updates `serde` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

Updates `serde_json` from 1.0.150 to 1.0.151
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.150...v1.0.151)

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

Updates `bitflags` from 2.13.0 to 2.13.1
- [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.13.0...2.13.1)

Updates `clap` from 4.6.1 to 4.6.3
- [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.6.1...clap_complete-v4.6.3)

Updates `jiff` from 0.2.32 to 0.2.34
- [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.32...jiff-static-0.2.34)

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

Updates `thiserror` from 2.0.18 to 2.0.19
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.18...2.0.19)

Updates `zerocopy` from 0.8.54 to 0.8.55
- [Release notes](https://github.com/google/zerocopy/releases)
- [Commits](https://github.com/google/zerocopy/compare/v0.8.54...v0.8.55)

Updates `remain` from 0.2.15 to 0.2.16
- [Release notes](https://github.com/dtolnay/remain/releases)
- [Commits](https://github.com/dtolnay/remain/compare/0.2.15...0.2.16)

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

Updates `async-trait` from 0.1.89 to 0.1.91
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.89...0.1.91)

Updates `clap_builder` from 4.6.0 to 4.6.2
- [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.6.0...v4.6.2)

Updates `clap_derive` from 4.6.1 to 4.6.4
- [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.6.1...v4.6.4)

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

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

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

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

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

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

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

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

Updates `jiff-static` from 0.2.32 to 0.2.34
- [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.32...jiff-static-0.2.34)

Updates `proc-macro2` from 1.0.106 to 1.0.107
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.106...1.0.107)

Updates `quote` from 1.0.46 to 1.0.47
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.46...1.0.47)

Updates `serde_core` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

Updates `serde_derive` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

Updates `serde_repr` from 0.1.20 to 0.1.21
- [Release notes](https://github.com/dtolnay/serde-repr/releases)
- [Commits](https://github.com/dtolnay/serde-repr/compare/0.1.20...0.1.21)

Updates `simd-adler32` from 0.3.9 to 0.3.10
- [Changelog](https://github.com/mcountryman/simd-adler32/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mcountryman/simd-adler32/compare/v0.3.9...v0.3.10)

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

Updates `thiserror-impl` from 2.0.18 to 2.0.19
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.18...2.0.19)

Updates `toml_edit` from 0.25.12+spec-1.1.0 to 0.25.13+spec-1.1.0
- [Commits](https://github.com/toml-rs/toml/compare/v0.25.12...v0.25.13)

Updates `zbus_names` from 4.3.3 to 4.3.4
- [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_names-4.3.3...zbus_names-4.3.4)

Updates `zerocopy-derive` from 0.8.54 to 0.8.55
- [Release notes](https://github.com/google/zerocopy/releases)
- [Commits](https://github.com/google/zerocopy/compare/v0.8.54...v0.8.55)

Updates `zvariant` from 5.13.0 to 5.13.1
- [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.13.0...zvariant-5.13.1)

Updates `zvariant_derive` from 5.13.0 to 5.13.1
- [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.13.0...zvariant_derive-5.13.1)

Updates `serde` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

Updates `serde_json` from 1.0.150 to 1.0.151
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.150...v1.0.151)

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

Updates `bitflags` from 2.13.0 to 2.13.1
- [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.13.0...2.13.1)

Updates `clap` from 4.6.1 to 4.6.3
- [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.6.1...clap_complete-v4.6.3)

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

Updates `thiserror` from 2.0.18 to 2.0.19
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.18...2.0.19)

Updates `zerocopy` from 0.8.54 to 0.8.55
- [Release notes](https://github.com/google/zerocopy/releases)
- [Commits](https://github.com/google/zerocopy/compare/v0.8.54...v0.8.55)

Updates `remain` from 0.2.15 to 0.2.16
- [Release notes](https://github.com/dtolnay/remain/releases)
- [Commits](https://github.com/dtolnay/remain/compare/0.2.15...0.2.16)

Updates `clap_builder` from 4.6.0 to 4.6.2
- [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.6.0...v4.6.2)

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

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

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

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

Updates `proc-macro2` from 1.0.106 to 1.0.107
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.106...1.0.107)

Updates `quote` from 1.0.46 to 1.0.47
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.46...1.0.47)

Updates `serde_core` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

Updates `serde_derive` from 1.0.228 to 1.0.229
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.228...v1.0.229)

Updates `simd-adler32` from 0.3.9 to 0.3.10
- [Changelog](https://github.com/mcountryman/simd-adler32/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mcountryman/simd-adler32/compare/v0.3.9...v0.3.10)

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

Updates `thiserror-impl` from 2.0.18 to 2.0.19
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/2.0.18...2.0.19)

Updates `toml_edit` from 0.25.12+spec-1.1.0 to 0.25.13+spec-1.1.0
- [Commits](https://github.com/toml-rs/toml/compare/v0.25.12...v0.25.13)

Updates `zerocopy-derive` from 0.8.54 to 0.8.55
- [Release notes](https://github.com/google/zerocopy/releases)
- [Commits](https://github.com/google/zerocopy/compare/v0.8.54...v0.8.55)

---
updated-dependencies:
- dependency-name: serde
  dependency-version: 1.0.229
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde_json
  dependency-version: 1.0.151
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: anyhow
  dependency-version: 1.0.104
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: bitflags
  dependency-version: 2.13.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.6.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff
  dependency-version: 0.2.34
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libc
  dependency-version: 0.2.187
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: thiserror
  dependency-version: 2.0.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zerocopy
  dependency-version: 0.8.55
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: remain
  dependency-version: 0.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures
  dependency-version: 0.3.33
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: async-trait
  dependency-version: 0.1.91
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.6.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_derive
  dependency-version: 4.6.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-channel
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-core
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-executor
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-io
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-macro
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-sink
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-task
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-util
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: jiff-static
  dependency-version: 0.2.34
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: proc-macro2
  dependency-version: 1.0.107
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: quote
  dependency-version: 1.0.47
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde_core
  dependency-version: 1.0.229
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde_derive
  dependency-version: 1.0.229
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde_repr
  dependency-version: 0.1.21
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: simd-adler32
  dependency-version: 0.3.10
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.119
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: thiserror-impl
  dependency-version: 2.0.19
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: toml_edit
  dependency-version: 0.25.13+spec-1.1.0
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zbus_names
  dependency-version: 4.3.4
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zerocopy-derive
  dependency-version: 0.8.55
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zvariant
  dependency-version: 5.13.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zvariant_derive
  dependency-version: 5.13.1
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde
  dependency-version: 1.0.229
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde_json
  dependency-version: 1.0.151
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: anyhow
  dependency-version: 1.0.104
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: bitflags
  dependency-version: 2.13.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap
  dependency-version: 4.6.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: libc
  dependency-version: 0.2.187
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: thiserror
  dependency-version: 2.0.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zerocopy
  dependency-version: 0.8.55
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: remain
  dependency-version: 0.2.16
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: clap_builder
  dependency-version: 4.6.2
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-core
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-sink
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-task
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: futures-util
  dependency-version: 0.3.33
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: proc-macro2
  dependency-version: 1.0.107
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: quote
  dependency-version: 1.0.47
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde_core
  dependency-version: 1.0.229
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: serde_derive
  dependency-version: 1.0.229
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: simd-adler32
  dependency-version: 0.3.10
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: syn
  dependency-version: 2.0.119
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: thiserror-impl
  dependency-version: 2.0.19
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: toml_edit
  dependency-version: 0.25.13+spec-1.1.0
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
- dependency-name: zerocopy-derive
  dependency-version: 0.8.55
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: non-rust-vmm
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-24 01:02:45 +00:00
Rob Bradford
ea8e6cf8b5 docs: Update CONTRIBUTING.md for feature request process
Opening an issue and establishing agreement is now mandatory for
feature PRs. For bug fixes opening an issue if one does not already
exist may be beneficial.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-23 18:40:09 +00:00
Rob Bradford
7638b37ea5 docs: Add a feature request template
Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-23 18:40:09 +00:00
Rob Bradford
bca3cb12ec docs: Add type field to bug report template
This will setup the issue type to "Bug" which is relatively new GitHub
concept.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-23 18:40:09 +00:00
Julian Schindel
4b5e2ef3a0 vmm: Lock disks after validating state change
On `VM::boot` call, lock disks only after the state change has been
checked for validity. Otherwise, on invalid state change, boot is
aborted, but file locks aren't rolled back.

On-behalf-of: SAP julian.schindel@sap.com
Signed-off-by: Julian Schindel <julian.schindel@cyberus-technology.de>
2026-07-23 15:27:30 +00:00
Yi Wang
e0f2d99d6f virtio-devices: Test sparse queue indices on resume
Filtered activation queues can hide regressions where resume treats
their positions as transport queue indices. Such regressions route
interrupts to unrelated MSI-X vectors while eventfd notifications still
reach the correct workers.

Add a VirtioCommon regression test with queue indices one and three.
Verify resume signals both queue eventfds and records interrupts for the
original sparse indices.

Assisted-by: OpenAI:GPT-5.6-Sol
Signed-off-by: Yi Wang <foxywang@tencent.com>
2026-07-23 12:00:11 +00:00
Yi Wang
e4f0744521 virtio-devices: Preserve queue indices across resume
VirtioCommon stores only activated queue eventfds, so filtered queues
are renumbered when resume injects interrupts. A sparse queue set can
therefore wake the wrong MSI-X vectors and leave completed requests
stalled after restore.

Retain each queue index alongside its eventfd during activate(). Use
the saved index for resume interrupts so each notification reaches the
queue's original vector.

Assisted-by: OpenAI:GPT-5.6-Sol
Signed-off-by: Yi Wang <foxywang@tencent.com>
2026-07-23 12:00:11 +00:00
doge
64c1bb3bfc block: Prevent QCOW data loss from stale punch-hole
QCOW metadata published a fully deallocated cluster before the
caller performed the host punch-hole. Under multi-queue load, a
concurrent metadata flush could make the cluster allocatable, and
another queue could reuse it before the delayed punch ran. If reused as
an L2 table, the stale punch erased live metadata and made guest data
unreachable.

This was observed in production as confirmed guest data loss, with
allocated guest clusters becoming refcounted but unreachable from the
QCOW mapping.

Keep punch-pending clusters out of both free lists. Publish a cluster
only after the host punch succeeds, so another metadata flush is
required before reuse.

Add deterministic coverage for the cross-queue schedule and for host
operation failures.

Signed-off-by: doge <me@crackerben.com>
2026-07-23 11:58:11 +00:00
doge
e737d61a0a block: Propagate QCOW dealloc action errors to the guest
apply_dealloc_action() discarded the result of the host punch-hole
and write-zeroes operations, so a guest DISCARD or WRITE ZEROES
request completed successfully even when the host operation failed.

Return the error to the per-queue engine and complete the request
with an error instead, in both the synchronous and io_uring QCOW
engines. A failure does not abort the remaining actions of the
request: they are still applied, and the first error is reported.

Signed-off-by: doge <me@crackerben.com>
2026-07-23 11:58:11 +00:00
Peter Delevoryas
d3d83dcbd8 virtio-devices: Retry complete vhost-user reconnect
A Unix stream connection can succeed while the process owning the
listener is exiting. The resulting connection can then fail during
SET_OWNER, GET_FEATURES, or later reinitialization.

Retry the complete connect and reinitialization transaction when it
returns a transport failure within a 60-second retry window. Each retry
uses a fresh frontend. Connection errors retain their existing handling,
non-transport errors fail immediately, and waits remain interruptible by
the worker kill event.

Signed-off-by: Peter Delevoryas <pdel@meta.com>
Assisted-by: Codex:GPT-5
2026-07-23 07:11:33 +00:00
Demi Marie Obenour
20d13cee15 misc: Add security policy
This adds a threat model and security policy.  It is loosely based on
the Xen Project Security Policy, but with many changes to fit Cloud
Hypervisor better.

The threat model is comprehensive and includes:

- Which entities are fully trusted.
- What untrusted entities are and are not allowed to do.
- What Cloud Hypervisor expects from its deployment environment.
- What trusted entities can safely do on behalf of untrusted entities.

Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
2026-07-23 01:02:04 +00:00
Rob Bradford
eaabb0e1ec virtio-devices: balloon: Fix use of usize for virtio queue index
This should be a u16 for consistency (as the number of queues is limited
to u16).

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-22 19:11:11 +00:00
Rob Bradford
5f86e58775 virtio-devices: Use u16 for the queue index
The number of queues is limited to a u16 so this most consistent. The
vm-virtio crate API unfortunately uses usize but its safe to convert up
from u16 to usize.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-22 19:11:11 +00:00
Rob Bradford
ab6afc21ec vmm: Generate common cpuid as part of CpuManager::new()
This removes a need to expose a method from the CpuManager back out to
the Vm which is called immediately after creating the CpuManager.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-22 17:47:28 +01:00
Isaku Yamahata
1260d99e1e arch: Fix duplicate l3-cache FDT node names for multi-package guests
create_cpu_nodes() emits one shared-L3 cache node per package when the
host reports a shared L3, but names every node with the constant
"l3-cache0". For a guest topology with packages >= 2 the generated
device tree carries the same name siblings.

Fixes: 5857d4851
Assisted-by: Claude:Opus-4.8 (1M context)
Signed-off-by: Isaku Yamahata <iyamahata@crusoe.ai>
2026-07-22 11:02:24 +00:00
Anatol Belski
331b2bba53 block: Add a SyncCompletionQueue for the sync engines
The raw, qcow, and vhdx sync engines each carried an EventFd and a
VecDeque of completions and repeated the same push and signal idiom at
every completion site. Bundle the two into a SyncCompletionQueue with
complete, notifier, and next_completed, and route the three engines
through it. The repeated eventfd signal now lives in one place.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-22 09:43:56 +00:00
Isaku Yamahata
9d3451a56a vmm: Fix aarch64 vmm::vm::unit_tests::test_create_fdt_with_devices()
test_create_fdt_with_devices() fails with a divide by zero.  The caller
passes Some((0, 0, 0, 0)) for CPU topology as (threads_per_core,
cores_per_die, dies_per_package, packages).  The valid default is
(1, 1, 1, 1), not all zero. Pass None because the eventual callee,
create_cpu_nodes(), checks None to get the right default value.

This affects the unit test only.  A real VM never hits it because
VmConfig::validate() rejects zero with an error.

Fixes: 7fb980f17 ("arch, vmm: Pass cpu topology configuation to FDT")
Assisted-by: Claude:Opus-4.8 (1M context)
Signed-off-by: Isaku Yamahata <iyamahata@crusoe.ai>
2026-07-22 08:53:04 +00:00
Alexander Lvov
013604319d block: vhdx: validate buffer length against logical sector size
Reject buf.len() that isn't sector_count * logical_sector_size in
io::read/write (VhdxIoError::InvalidBufferLength), and reject buf.len()
not a multiple of the sector size in Vhdx's Read/Write impl, before it's
converted to a sector count/index.

Signed-off-by: Alexander Lvov <alexander.lvov.git@gmail.com>
2026-07-21 13:36:25 +00:00
Alexander Lvov
8d6a38770f block: vhdx: restrict logical sector size to 512 bytes
cloud-hypervisor always advertises a 512-byte logical block size over
virtio-blk, so a 4096-byte-sector VHDx image could never be addressed
correctly. Reject it at metadata parse time, matching QEMU's VHDx
support.

Signed-off-by: Alexander Lvov <alexander.lvov.git@gmail.com>
2026-07-21 13:36:25 +00:00
Alexander Lvov
d414127b08 block: vhdx: fix I/O slice length to use the real logical sector size
io::read/write sliced buf using free_sectors * SECTOR_SIZE, a hardcoded
512-byte constant, instead of the file's real logical sector size
([MS-VHDX] allows 512 or 4,096). On a 4096-byte-sector image, only the
first 512 bytes of each sector were transferred while the full 4096 was
reported as done.

Use sector.free_bytes instead.

Signed-off-by: Alexander Lvov <alexander.lvov.git@gmail.com>
2026-07-21 13:36:25 +00:00
Anatol Belski
4f9fcfa22b block: raw: Route aio and uring bounce through the vectored API
Reimplement run_unaligned_operation over AlignedFile read_vectored_at
and write_vectored_at instead of scattering and gathering through the
per operation write_bytes_at and read_bytes_at closures. The aio and
uring engines already reach this helper for the O_DIRECT misaligned
case, so both now share the same vectored bounce path as the sync
engine and the scatter gather logic lives only in AlignedFile.

The operation iovecs point at the same memory that write_bytes_at and
read_bytes_at reach, and the aligned fast path already hands those
iovecs to the kernel, so the direct vectored call is equivalent. For
guest memory read targets the destination pages are marked dirty by
mark_read_dirty in execute_async before the operation is submitted,
independent of how the bounce copies bytes, so the raw iovec path
preserves dirty tracking. Drop the now unneeded mut bindings at the
call sites.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-21 08:37:00 +00:00
Anatol Belski
441eb0671a block: Test AlignedFile vectored positioned I/O
Cover the empty iovec noop, the fast path where iovecs go straight to
preadv or pwritev, and misaligned O_DIRECT scatter and gather across
multiple iovecs including a partial block read-modify-write.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-21 08:37:00 +00:00
Anatol Belski
206cb1e100 block: raw: Add vectored positioned I/O to AlignedFile
Add read_vectored_at and write_vectored_at to AlignedFile. They take
the aligned fast path with a single preadv or pwritev when the offset
and every iovec base and length satisfy the O_DIRECT alignment, and
otherwise bounce through an AlignedBuffer, scattering on read and
gathering with a read-modify-write on write.

Convert the raw sync engine to these methods and drop its raw preadv
and pwritev block. The methods are unsafe because their soundness
depends on the caller passing iovecs that describe valid memory for
iov_len bytes.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
2026-07-21 08:37:00 +00:00
Rob Bradford
3cd8abcd8c vmm: cpu: Ensure guest eject is for expected vCPU
CPU unplug requires co-operation between the guest and the VMM. Ensure
that the CPU the guest marks for eject is the one the VMM expects to be
removed. If the guest were to remove a different vCPU there would be
unexpected behaviour. Further ensure that the boot vCPU is never
unplugged.

Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-21 08:36:37 +00:00
dependabot[bot]
061b2cda60 build(deps): bump actions/setup-python from 6 to 7
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6 to 7.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v6...v7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 00:39:06 +00:00
Alyssa Ross
cd2089eb69 build: Bump vm-memory and dependents
vm-memory 0.18 has renamed GuestMemory to GuestMemoryBackend, and made
GuestMemory refer to something less specific.  For simplicity, we keep
using GuestMemoryBackend (formerly GuestMemory) everywhere for now.  We
can adjust bounds to be less specific later if we find ourselves needing
the newly enabled flexibility.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Rob Bradford <rbradford@meta.com>
2026-07-20 17:51:23 +00:00
Pascal Scholz
1a1c21024a docs: Include description for zone_updates parameter
Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
On-behalf-of: SAP pascal.scholz@sap.com
2026-07-20 16:06:55 +00:00
Pascal Scholz
69e7d53a5f openapi: Update OpenAPI doc to include zone_updates parameter
Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
On-behalf-of: SAP pascal.scholz@sap.com
2026-07-20 16:06:55 +00:00
Pascal Scholz
ec304f6d50 vmm: Improve VmReceiveMigrationConfigError with additional variants
All error cases used `ValidationError` with a String containing context
about the error. This is suboptimal as the error kind itself does not
contain any context about the actual failure cause. Furthermore, this
does not allow to build error chains as underlaying errors are replaced
with the respective message string.

We improve the situation by introducing specific error variants for
failure case. This also allows us to test the respective code paths
more easily.

Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
On-behalf-of: SAP pascal.scholz@sap.com
2026-07-20 16:06:55 +00:00
Pascal Scholz
d419338a47 vmm: Add parsing logic for zone_updates
This commit adds support for parsing `zone_updates` from the CLI
for the live migration and restore paths.

Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
On-behalf-of: SAP pascal.scholz@sap.
2026-07-20 16:06:55 +00:00
Pascal Scholz
ad3790a0ea vmm: Update memory zones
We consume `zone_updates` from `VmReceiveMigrationData` and
`RestoreConfig` to remap already existing `MemoryZone`s to different
host NUMA nodes. For now, we do not support further changes, such as
altering the size of the respective `MemoryZone`s.

These changes allow to migrate a VM to a host that has the capacity to
host the same `MemoryZone`s on a different NUMA layout.

Signed-off-by: Pascal Scholz <pascal.scholz@cyberus-technology.de>
On-behalf-of: SAP pascal.scholz@sap.com
2026-07-20 16:06:55 +00:00