mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-24 05:25:22 +00:00
03dd24978e
On the restore path, using the available and used indexes read from memory to fill the Queue structure was a mistake. Indeed, the available index is written from the guest and it reflects the last available index in the descriptor table. But the driver might have queued a lot of buffers which have not yet been used by the device. This leads to a situation where the next_avail from Queue is completely different from the one we can read from memory. Instead, the right way to determine the next_avail index that should be used by the device is by relying on the used index from the memory. This index represents the correct information we're looking for as it has been updated before the snapshot to let the guest know the next index to process. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>