[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for 3.1 1/4] scsi/migration: Allow bus load request
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH for 3.1 1/4] scsi/migration: Allow bus load request to fail |
Date: |
Mon, 16 Jul 2018 18:37:40 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Allow the load_request method on a bus to fail and error
the migration cleanly.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
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