A command whose data takes more than BLOCKIF_IOV_MAX segments is done
in several block requests, the completion of one issuing the next. The
completion of a command also issues the commands that the guest queued
in the meantime. pci_ahci_pause() only called blockif_pause(), which
marks the block device as paused and waits for the requests in flight,
so such a completion issued a request on a paused block device:
Assertion failed: (!bc->bc_paused), function blockif_request, file block_if.c, line 781.
A guest with load on an AHCI disk could not be checkpointed.
When the pause begins, stop issuing commands and wait until the ones
in progress are complete; only then pause the block devices.
pci_ahci_resume() issues the commands that were held back. They are in
PxCI, which is part of the snapshot, so they are issued after a restore
as well.
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by: keelos.dev