diff --git a/docs/api.md b/docs/api.md index 26cd7d47d..d74485cf9 100644 --- a/docs/api.md +++ b/docs/api.md @@ -238,9 +238,11 @@ the degradation counts). After a true answer the exit gate's handler still runs writes the counts. QEMU calls it, with a bound of 5 s, at the end of its cleanup (`qemu_cleanup`, through a notifier of -its own run there, `qemu_add_cleanup_notifier`), on every quit that reaches it: a released device, -a device kept by a shutdown action that pauses, a quit of a stopped VM, and a read of a display -that kept it. That runs before `exit` itself, so before every exit handler. It lets the BQL go +its own run there, `qemu_add_cleanup_notifier`), on every quit that reaches it: a device released at +the VM's stop, and a device kept by a read of a display. The notifier first releases each device +whose VM was not running at the quit (a VM paused or stopped before it, a shutdown action that +pauses), so that its quiesce answers true too. That runs before `exit` itself, so before every exit +handler. It lets the BQL go around the call, as around the release. On a false answer it runs what `exit` would run of QEMU's own: its exit notifiers (usb-host's return of host devices to their drivers, a tap's down script, the pidfile's removal), the terminal's restore where a chardev took stdio, and the flush of the C diff --git a/docs/qemu.md b/docs/qemu.md index 7f0f994d4..2d368b05e 100644 --- a/docs/qemu.md +++ b/docs/qemu.md @@ -558,10 +558,14 @@ is its transport: handler tears the device down, BAR 2 out of the guest's address space first, so that the library's release of its last device lets go of the GPU device before the process exits (docs/api.md, "The process's exit"). - A shutdown whose action pauses the VM (`-action shutdown=pause`, - `-no-shutdown`), and a quit of a VM stopped before it, keep the device to - the exit, as before. So does a quit while a read of a display (a - console's, above) still waits for its draw on the GPU: the teardown waits + A quit of a VM that was not running (paused by QMP's `stop` or by a full + disk, never started past `-S`, or paused by a shutdown whose action pauses, + `-action shutdown=pause` or `-no-shutdown`) stops no running VM, so no + VM-state handler hears it: the end of QEMU's cleanup tears such a device + down (the cleanup notifier, `reims_graphics_pci_cleanup`), and QEMU then + ends with `exit()`, as after a running VM's quit. A quit while a read of a + display (a console's, above) still waits for its draw on the GPU keeps the + device to the exit, and QEMU ends with `_exit`: the teardown waits for every display's read at most 5 s, under the BQL, as the reads use the device. A screendump still waiting for the read is answered first, with what the diff --git a/vendor/qemu b/vendor/qemu index 0f7f65aea..21e663657 160000 --- a/vendor/qemu +++ b/vendor/qemu @@ -1 +1 @@ -Subproject commit 0f7f65aea19155ce8cd3b9500cea69308dd0d64b +Subproject commit 21e663657d8eb188de0ae295ab90ea9422db52e5