Define how Firecracker handles a failed virtio device reset
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 8/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 活発
- 技術スタック
- linux, rust
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 38.2k
- フォーク
- 2.8k
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 59
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firecracker-microvm/firecracker のほかの issue
-
[Bug] jailer: misc device minors below 100 are never found in /proc/misc (/dev/nitro_enclaves, /dev/userfaultfd missing from the jail)対応中かも @Gaspardcode が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
firecracker-microvm/firecracker#6490 ·
メンテナーはふだん 1 日以内に返信
-
chore(deps): update libseccomp to v2.6.2対応中かも @pederbe が 2 日前に担当しました。 オープンdependencies
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
firecracker-microvm/firecracker#6460 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
firecracker-microvm/firecracker#6486 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[Feature Request] Restore a chain of Diff snapshots with the `File` memory backend, without mergingオープン
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
firecracker-microvm/firecracker#6485 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] vsock: a guest connection still handshaking when a snapshot is taken can hang forever after restore対応中かも @not4s が 2 日前に担当しました。 オープンStatus: Awaiting assignee
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
firecracker-microvm/firecracker#6464 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
firecracker-microvm/firecracker の issue をすべて見る
似ている issue
-
Find/Replace panel: "Previous/Next occurrence" labels overlap and overflow their buttons (French)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
obi1kenobi/cargo-semver-checks#1839 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`対応中かも @iliqiliev が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ajeetdsouza/zoxide#1381 ·
メンテナーはふだん 5 日以内に返信
-
triage
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
kornia/kornia-rs#1416 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信