esp: recreate ESPState current_req after migration
commita7a2208862bee2bc4fe55adfd947dc4a15ad0216
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sat, 5 Mar 2022 15:55:30 +0000 (5 15:55 +0000)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Wed, 9 Mar 2022 09:29:10 +0000 (9 09:29 +0000)
tree3769074f3b5545e5a4c4aca448141c20f1771e45
parenteda59b392d63bf9a766dedcae54ee160e8ce1b57
esp: recreate ESPState current_req after migration

Since PDMA reads/writes are driven by the guest, it is possible that migration
can occur whilst a SCSIRequest is still active. Fortunately active SCSIRequests
are already included in the migration stream and restarted post migration but
this still leaves the reference in ESPState uninitialised.

Implement the SCSIBusInfo .load_request callback to obtain a reference to the
currently active SCSIRequest and use it to recreate ESPState current_req
after migration.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220305155530.9265-11-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
hw/scsi/esp.c