From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Allow the load_request method on a bus to fail and error
the migration cleanly.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
hw/scsi/scsi-bus.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index 5905f6bf29..34a29c2ffd 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -1618,6 +1618,11 @@ static int get_scsi_requests(QEMUFile *f, void *pv, size_t size,
req->retry = (sbyte == 1);
if (bus->info->load_request) {
req->hba_private = bus->info->load_request(f, req);
+
+ if (!req->hba_private) {
+ scsi_req_unref(req);
+ return -1;
+ }
}
if (req->ops->load_request) {
req->ops->load_request(f, req);
--
2.17.1