Define how Firecracker handles a failed virtio device reset
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 8/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- linux, rust
- Ambito
- backend, infrastructure
Direzione di ricerca
This is a design decision, not a code change yet. Start with VirtioDevice::reset() and the reset path in src/vmm/src/devices/virtio/transport/pci/common_config.rs and transport/mmio.rs, and trace what happens to device_status when a reset fails. Done means a maintainer-agreed behaviour for failed resets, with the options and their trade-offs recorded in the issue, before any implementation starts.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
VirtioDevice::reset() can fail only where Firecracker has handed work to something outside its
own synchronous control: an out-of-process vhost-user backend (#6277) or io_uring operations that
are still in flight (#6278). Every other in-tree device returns true unconditionally. We should
decide what Firecracker ought to do in those cases.
What happens today (main on 2026-10-21)
- PCI: the transport sets
device_statusat0whether or not the reset succeeded
(common_config.rs). That was a deliberate choice, made when no device implemented
reset yet and so every reset failed (dcdcd800): the Linux virtio-pci guest driver
pollsdevice_statusuntil it reads0(virtio_pci_modern.c), and nothing would
ever clearFAILED, so reporting the failure that way would have left the guest stuck in that
loop and unable to complete a shutdown. This does not follow the specification, though: the
device must present0only once the reset is done (spec), and must not touch
the queues afterwards (spec), so everything still in flight has to be drained
beforedevice_statusreads0. Firecracker rejects any subsequent re-initialization instead,
on the grounds that the device is still active. The missing piece is a vhost-user-blk reset that
stops the backend (#6277);
once every device can complete its reset,device_statusno longer needs to read0before
the reset is actually done. - MMIO: the transport sets
FAILEDif the reset fails (mmio.rs). The guest never looks —
once its write of0has completed, the Linux MMIO guest driver returns without reading the
status back (virtio_mmio.c). That is correct for MMIO transport version 2, which
is the version Firecracker implements (mmio.rs): there the device must finish
the reset before the driver's write of0todevice_statushas completed, so the driver has
nothing to wait for. The specification spells this out since a change made after v1.3
(transport-mmio.tex). Firecracker rejects any subsequent re-initialization here
as well, since no status transition out ofFAILEDis valid.
So on either transport the guest treats the reset as complete, tears the device down and reuses the
pages that held the vring and the request buffers. Meanwhile the work Firecracker could not stop —
a vhost-user backend still serving the queue, or an io_uring operation still in flight — may write
into those pages afterwards and corrupt the guest's memory.
Rejecting re-initialization bounds how far the guest can drive the device, but it does nothing about
those writes.
Open questions
Note that the guest is blocked while we handle the reset: the write to device_status traps into
Firecracker and the vCPU does not resume until our handler returns, so whatever we decide to do
happens inside that write. What the guest does not do, at least on MMIO, is check the outcome
afterwards — so we cannot signal the failure and rely on the guest to act on it.
There are at least three failure modes to choose between.
| Option | What is lost | Character |
|---|---|---|
| Keep draining | the vCPU stays blocked until the device is quiesced | silent, potentially indefinite |
| Give up draining and terminate the microVM | the microVM itself | deterministic, immediately visible |
| Give up draining and carry on (today's behaviour) | integrity of guest memory | probabilistic, silent |
Which of these a user would rather have may well depend on their workload, so letting them choose is
itself one of the options, rather than fixing a single behaviour in Firecracker.
It is also worth looking at how other VMMs (e.g. QEMU and Cloud Hypervisor) respond when a device
reset cannot be completed.
- Lingua principale
- Rust
- Stelle
- 38.2k
- Fork
- 2.8k
- Merge medio
- 2g 12h
- PR unite (30g)
- 59
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firecracker-microvm/firecracker
-
[Bug] jailer: misc device minors below 100 are never found in /proc/misc (/dev/nitro_enclaves, /dev/userfaultfd missing from the jail)Forse già presa @Gaspardcode l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
firecracker-microvm/firecracker#6490 ·
I maintainer di solito rispondono entro 1 giorno
-
chore(deps): update libseccomp to v2.6.2Forse già presa @pederbe l’ha presa 2 giorni fa. Apertadependencies
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
firecracker-microvm/firecracker#6460 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
firecracker-microvm/firecracker#6486 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature Request] Restore a chain of Diff snapshots with the `File` memory backend, without mergingAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
firecracker-microvm/firecracker#6485 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] vsock: a guest connection still handshaking when a snapshot is taken can hang forever after restoreForse già presa @not4s l’ha presa 2 giorni fa. ApertaStatus: Awaiting assignee
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
firecracker-microvm/firecracker#6464 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di firecracker-microvm/firecracker
Issue simili
-
Find/Replace panel: "Previous/Next occurrence" labels overlap and overflow their buttons (French)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
obi1kenobi/cargo-semver-checks#1839 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Forse già presa @iliqiliev l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ajeetdsouza/zoxide#1381 ·
I maintainer di solito rispondono entro 5 giorni
-
triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
kornia/kornia-rs#1416 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni