Skip to content

Generate ACPI for newer QEMU versions instead of rejecting them - #1052

Merged
kvinwang merged 1 commit into
nextfrom
feat/qemu-acpi-version-clamp
Aug 13, 2026
Merged

Generate ACPI for newer QEMU versions instead of rejecting them#1052
kvinwang merged 1 commit into
nextfrom
feat/qemu-acpi-version-clamp

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Problem

QemuVersion::compatibility() returns None for any QEMU major past the newest modeled profile, and tables::build turns that into Error::UnsupportedVersion. So the day QEMU 12.0 ships, every CVM that reports it stops producing expected ACPI blobs at all — dstack-mr's Machine::build_tables() errors out, and with it the whole TDX measurement path that depends on it.

That is the wrong default for a compatibility model. Most QEMU releases do not touch the Q35 ACPI ABI: the profiles here already collapse whole majors ((9, _), (10, _), (11, 1..)) precisely because nothing observable changed across them. Refusing to generate assumes the opposite — that every unseen release broke the ABI — and the assumption costs more than it saves, because "cannot generate" and "generated something that does not match" both end in a failed verification. Only one of the two tells the operator what actually differs.

Fix

Versions newer than the newest modeled profile now generate with that profile:

(11, 1..) => Some(Compatibility::V11_1),
(12.., _) => Some(Compatibility::LATEST),
  • If the new release left the ACPI ABI alone, generation matches and verification keeps working across a QEMU upgrade with no verifier release.
  • If it did change the ABI, the blobs mismatch and the caller reports a digest mismatch rather than an opaque "unsupported version" — same failure, more information.

Versions older than 8.0 still return None. Clamping downward would be a guess in the direction where QEMU's ACPI output is known to differ, and dstack-mr rejects < 8.0.0 before it gets here anyway.

Compatibility::LATEST is the single place that has to move when a profile is added; both the Layout doc comment and fixtures/README.md now say so, next to the existing "generate the four base fixtures" instructions.

Verification

cargo test -p qemu-acpi — 18 passed. New tests:

  • versions_map_to_their_own_profile — pins the existing mapping (8.2.2, 9.1.0, 9.2.1, 10.0.0, 11.0.3, 11.1.0) so the clamp arm cannot swallow a version that has its own profile.
  • versions_newer_than_the_newest_profile_clamp_to_it — 11.9.0, 12.0.0, 99.4.1 resolve to LATEST.
  • versions_older_than_the_oldest_profile_are_rejected — 7.2.0 and 0.0.0 stay None.
  • unmodeled_newer_versions_generate_with_the_latest_profile — end-to-end: build() with 12.0.0 returns blobs byte-identical to the 11.1 output, so the clamp reaches actual generation and is not just a mapping detail.

No fixture changes; the byte-for-byte differential fixtures are untouched.

Copilot AI lite review requested due to automatic review settings August 13, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates qemu-acpi’s QEMU version-to-compatibility mapping so that future QEMU major releases (beyond the newest modeled profile) still generate ACPI tables using the latest known profile, avoiding hard failures on upgrade and turning ABI changes into actionable blob mismatches.

Changes:

  • Clamp QEMU versions newer than the newest modeled profile to Compatibility::LATEST instead of returning None.
  • Add/extend documentation explaining the clamping behavior and the need to update Compatibility::LATEST when adding a new profile.
  • Add tests covering version mapping and an end-to-end “newer QEMU still generates” case.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
dstack/crates/qemu-acpi/src/profile.rs Adds Compatibility::LATEST, updates version mapping to clamp newer majors, and introduces mapping tests.
dstack/crates/qemu-acpi/src/tables.rs Adds an end-to-end test ensuring unmodeled newer QEMU versions still generate identical blobs under the latest profile.
dstack/crates/qemu-acpi/src/lib.rs Updates crate docs and improves the unsupported-version error message for pre-8.0 QEMU.
dstack/crates/qemu-acpi/fixtures/README.md Documents the “newer than newest profile” behavior and the need to move Compatibility::LATEST when adding profiles.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread dstack/crates/qemu-acpi/src/profile.rs
@kvinwang
kvinwang merged commit 38b6d6b into next Aug 13, 2026
16 checks passed
@kvinwang
kvinwang deleted the feat/qemu-acpi-version-clamp branch August 13, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants