Define how Firecracker handles a failed virtio device reset
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 8/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- linux, rust
- Lĩnh vực
- backend, infrastructure
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 38.2k
- Fork
- 2.8k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 59
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của 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)Có thể đã có người làm @Gaspardcode đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
firecracker-microvm/firecracker#6490 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore(deps): update libseccomp to v2.6.2Có thể đã có người làm @pederbe đã nhận 2 ngày trước. Đang mởdependencies
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
firecracker-microvm/firecracker#6460 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
firecracker-microvm/firecracker#6486 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature Request] Restore a chain of Diff snapshots with the `File` memory backend, without mergingĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
firecracker-microvm/firecracker#6485 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] vsock: a guest connection still handshaking when a snapshot is taken can hang forever after restoreCó thể đã có người làm @not4s đã nhận 2 ngày trước. Đang mởStatus: Awaiting assignee
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
firecracker-microvm/firecracker#6464 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firecracker-microvm/firecracker
Issue tương tự
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Có thể đã có người làm @iliqiliev đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ajeetdsouza/zoxide#1381 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
kornia/kornia-rs#1416 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
paritytech/revive#749 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
swc-project/swc-next-issues#1043 ·