🐛 Pause a VM where an NVMe or firmware-variable write fills the disk
The fork's nvme device completed a write that found the host disk full to the guest as Write Fault, and pflash_cfi01 logged 'Could not update PFLASH' and dropped the variable. Both now follow the drive's error action: under -drive's default werror=enospc the VM pauses (io-error, the drive's io-status nospace, which reims-ctl reads to name the file), and the resume runs the write again (fork 51d47e28, 1e223049, 0beafad0).
This commit is contained in:
1 parent
81c12ee542
commit
054f8a71d0
3 files changed
+12
-8
No files matched your search
@@ -76,12 +76,13 @@ pub fn running(vm: &Vm) -> bool {
|
||||
}
|
||||
|
||||
/// A running VM that QEMU has paused because the host's disk is full. Each disk of a VM is
|
||||
/// QEMU's `-drive` (or `-blockdev`) on its AHCI or virtio device, whose write errors take
|
||||
/// QEMU's `-drive` (or `-blockdev`) on its AHCI, NVMe or virtio device, whose write errors take
|
||||
/// QEMU's default, `werror=enospc`: a write that fails with ENOSPC stops the VM, and any other
|
||||
/// failure goes to the guest (`blk_error_action`; QEMU's NVMe device gives the guest every
|
||||
/// failure). QEMU's file driver reports a full file system as ENOSPC on every host: file-posix
|
||||
/// on Linux and macOS, and on Windows vendor/qemu's file-win32 and its native AIO, which map
|
||||
/// `ERROR_DISK_FULL` and `ERROR_HANDLE_DISK_FULL` to it. While the VM is paused, QMP's
|
||||
/// failure goes to the guest (`blk_error_action`; vendor/qemu's NVMe device follows it for its
|
||||
/// reads, writes, write zeroes, flushes and deallocations). QEMU's file driver reports a full
|
||||
/// file system as ENOSPC on every host: file-posix on Linux and macOS, and on Windows
|
||||
/// vendor/qemu's file-win32 and its native AIO, which map `ERROR_DISK_FULL` and
|
||||
/// `ERROR_HANDLE_DISK_FULL` to it. While the VM is paused, QMP's
|
||||
/// `query-status` answers `io-error`, and `query-block` gives the disk with `io-status`
|
||||
/// `nospace` and the file QEMU writes for it. QMP's `cont` resumes the VM, and QEMU runs the
|
||||
/// failed writes again, which the guest never saw fail. Read from QEMU's code.
|
||||
@@ -183,8 +184,9 @@ fn full_disk(blocks: &serde_json::Value) -> Option<DiskFull> {
|
||||
}
|
||||
|
||||
/// How long a resume watches the VM after QMP's `cont` for QEMU to pause it again: QEMU runs
|
||||
/// the writes that failed again as the VM resumes (virtio-blk's and IDE's restart of their
|
||||
/// failed requests on the VM's state change), and pauses it again where the disk is still full.
|
||||
/// the writes that failed again as the VM resumes (virtio-blk's, IDE's and NVMe's restart of
|
||||
/// their failed requests on the VM's state change), and pauses it again where the disk is still
|
||||
/// full.
|
||||
const RESUME_WATCH: Duration = Duration::from_secs(2);
|
||||
|
||||
/// Resumes `vm`, whatever paused it, with QMP's `cont`: where the host's disk was full
|
||||
|
||||
@@ -189,6 +189,8 @@ virtio device (`d151bcd9`, upstream's `b501f21312`).
|
||||
| `reims-graphics-pci` populates each Shared pool piece once its add is answered, on a thread of its own in 2 MiB slices, so the guest's first touch of it takes no second-level fault: under KVM with `KVM_PRE_FAULT_MEMORY` on a vCPU of the thread's that never runs, under WHPX with `WHvAdviseGpaRange`'s populate. For that vCPU `KVM_CAP_MAX_VCPU_ID` is one past the guest's APIC ids, its TSC rejoins the guest vCPUs' generation after each of their reset-level puts, and a 20 ms timer ends a call left retrying; under KVM a removed piece's slots are deleted on the library's thread before its removal, off the BQL (`kvm_unmap_before_del`) ("The reims-graphics device", below) | `dd0e0d4a`, `9c95b677`, `a4dfdbf1`, `cfe57e55`, `b561d79c`, `d2de4f94`, `7ad9c809` |
|
||||
| `reims-graphics-pci` tells the library, as `pool_host_memory`, that the hypervisor takes no cacheable mapping of the GPU's own memory as guest memory, under KVM on an arm64 host whose VM does not answer `KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED`, from that query alone (no property or option sets it): KVM takes a cacheable `VM_PFNMAP` mapping, as every host mapping of a Honeykrisp allocation is, as a memory slot only where the CPU has stage-2 forced write-back and `CACHE_DIC`, and an M1 Pro's refused the pool's first piece, where QEMU exited (`docs/lessons.md`); the library's pool blocks are then host memory the GPU imports. The check is in `reims-graphics-pci-kvm.c`, with its stub for targets without KVM; HVF, TCG, WHPX and KVM on x86-64 never set it | `5d0e52bd`, `34d2bb15` |
|
||||
| the x86 CPU's `x-avx512-xstate` property (off by default) lists the AVX-512 state components (opmask, ZMM_Hi256, Hi16_ZMM) in CPUID leaf 0xD whatever leaf 7 says, so a guest may turn them on in XCR0 while its feature bits say no AVX-512; the accelerator's filter drops them where the host lacks them ("x86-64 macOS guests: the CPU model", below) | `c3e40185` |
|
||||
| `nvme` and `nvme-ns` take `rerror` and `werror` (AUTO, so a `-drive`'s apply; they forced report on their drive before), and a failed Read, Write, Write Zeroes, Flush or Dataset Management on an I/O queue of a namespace that is not zoned follows the drive's action: under `-drive`'s default `werror=enospc` a write that finds the host's disk full is held with no completion, QEMU pauses the VM (`io-error`, the drive's `io-status` `nospace`), and the resume runs it again, as AHCI and virtio-blk do; upstream's completed it to the guest with Write Fault. Other commands and errors complete with their error as before (qtests `enospc-pauses`, `enospc-reset`, `eio-reports`) | `51d47e28` |
|
||||
| `pflash_cfi01` (an x86-64 guest's OVMF variables): a program or erase whose write to the drive fails under the drive's stop action (`-drive`'s default `werror=enospc`; `if=pflash` takes no `werror`) marks its bytes and pauses the VM (`io-error`, the drive's `io-status` `nospace`), and the resume writes them again from the flash's memory; upstream's logged "Could not update PFLASH" and went on, so the file lost the change, which was gone at the next start. Other errors log the line as before (qtest `pflash-cfi01-test`) | `1e223049`, `0beafad0` |
|
||||
|
||||
The branch's other commits are the apple-gfx work `96e1b470` removes, and
|
||||
`cfaadbfa09`, an HVF workaround that `478c28ff70` reverts, upstream having
|
||||
|
||||
Vendored
+1
-1
Submodule vendor/qemu updated: 21e663657d...0beafad0d8.
Reference in new issue
Block a user