Skip to content

Machine descriptors - #9

Merged
aledbf merged 3 commits into
mainfrom
machine-descriptors
Sep 18, 2026
Merged

aledbf merged 3 commits into
mainfrom
machine-descriptors

Conversation

@aledbf

@aledbf aledbf commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

No description provided.

aledbf and others added 3 commits September 18, 2026 19:57
A disk given by path has QEMU open the image and every backing file its
header names. So QEMU sees the caller's filesystem, and a header decides
what it reads. Disk.Chain is the other form: each image is a descriptor
set (Spec.FDSets, -add-fd), and the images are -blockdev nodes, each
backed by the next and the last by nothing. QEMU opens nothing by path,
and follows no name a header carries. Each descriptor carries an opaque,
the caller's path, which query-fdsets gives back. That is how a caller
still learns which image a device has open.

QMPFD and QMPFD2 put a monitor on a socket the caller already listens on,
for a QEMU that may create no socket where the caller would connect.
-object monitor-qmp, because QEMU 11.1 warns -mon is deprecated.

TestAChainOverDescriptorsIsReadWithoutAPathAndSealedUnderAnOverlay runs
in verify:args. It renames the directory away after opening the images,
seals the top under an overlay handed over the same way, and reads the
opaques back. With the explicit backing reference taken out, QEMU
follows the header to a base that is no longer there. One descriptor per
image is enough: QEMU 11.1.1 keeps the old top's descriptor when it seals
it, rather than reopening it read-only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GHRRFvbnZi5q3KSTvyW5a
A QEMU that may open nothing by path needs its console handed over too,
and the usual console is the write end of a FIFO. "-serial
file:/dev/fdset/<ID>" fails on one with EINVAL: QEMU truncates what it
opens. SerialFDSet puts the console on a descriptor set through
"-chardev file,append=on" instead. It counts as a serial port in the
fingerprint, as Serial does, so a template taken with one form restores
into the other. TestAChainOverDescriptors writes its console into a FIFO
this way, and the fingerprint test puts a machine given descriptors
beside the same machine given paths.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GHRRFvbnZi5q3KSTvyW5a
A QEMU whose root holds no /dev can still run a machine: KVMFDSet moves the
accelerator to -accel kvm,device=/dev/fdset/N, VsockFD and NIC.VhostFD become
vhostfd=. QEMU refuses -accel beside -machine accel= (11.1.1), so the machine
argument drops it; the shape, and so the fingerprint, still says accel=kvm.

Proven against the release build: /dev/null in the place of either device
fails the start, the devices themselves answer on QMP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019GHRRFvbnZi5q3KSTvyW5a
@aledbf
aledbf merged commit 4947281 into main Sep 18, 2026
1 check passed
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.

1 participant