Define how Firecracker handles a failed virtio device reset
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 8/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- linux, rust
- Área
- backend, infrastructure
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 38.2k
- Forks
- 2.8k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 59
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de 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)Posiblemente ocupada @Gaspardcode la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
firecracker-microvm/firecracker#6490 ·
Los mantenedores suelen responder en 1 día
-
chore(deps): update libseccomp to v2.6.2Posiblemente ocupada @pederbe la tomó hace 2 días. Abiertodependencies
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
firecracker-microvm/firecracker#6460 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
firecracker-microvm/firecracker#6486 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Feature Request] Restore a chain of Diff snapshots with the `File` memory backend, without mergingAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
firecracker-microvm/firecracker#6485 ·
Los mantenedores suelen responder en 1 día
-
[Bug] vsock: a guest connection still handshaking when a snapshot is taken can hang forever after restorePosiblemente ocupada @not4s la tomó hace 2 días. AbiertoStatus: Awaiting assignee
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
firecracker-microvm/firecracker#6464 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de firecracker-microvm/firecracker
Issues similares
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Posiblemente ocupada @iliqiliev la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ajeetdsouza/zoxide#1381 ·
Los mantenedores suelen responder en 5 días
-
triage
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
kornia/kornia-rs#1416 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
paritytech/revive#749 ·
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
swc-project/swc-next-issues#1043 ·