scsi: prepare migration code for usb-storage support
commit18eef3bc4eb80fee2cf4a9f18cb87784854d30c1
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 16 May 2012 12:20:03 +0000 (16 14:20 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 7 Jun 2012 08:02:21 +0000 (7 10:02 +0200)
tree254dca7607a8072117859c1ec32db2d029691a49
parent973002c11460efd3c17fe61a76711a103e30e1f9
scsi: prepare migration code for usb-storage support

usb-storage can't handle requests in one go as the data transfer can be
splitted into lots of usb packets.  Because of that there can be
normal in-flight requests at savevm time and we need to handle that.
With other scsi hba's this happens only in case i/o is stopped due to
errors and there are pending requests which need to be restarted
(req->retry = true).

So, first we need to save req->retry and then handle the req->retry =
false case.  Write requests are handled fine already.  For read requests
we have to save the buffer as we will not restart the request (and thus
not refill the buffer) on the target host.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/scsi-bus.c
hw/scsi-disk.c