]> Git Repo - qemu.git/commit - hw/scsi/scsi-generic.c
scsi: Unify request unref in scsi_req_cancel
authorFam Zheng <[email protected]>
Wed, 24 Sep 2014 08:27:54 +0000 (16:27 +0800)
committerPaolo Bonzini <[email protected]>
Tue, 30 Sep 2014 11:30:51 +0000 (13:30 +0200)
commit3df9caf88f5c0859ae380101fea47609ba1dbfbd
tree7987f8bae8fad5bec70727ee53ba3ffbfa3ee142
parent6c25fa6cf8b58db72956e880d76e4adc301bb472
scsi: Unify request unref in scsi_req_cancel

Before, scsi_req_cancel will take ownership of the canceled request and unref
it. We did this because we didn't know whether AIO CB will be called or not
during the cancelling, so we set the io_canceled flag before calling it, and
skip unref in the potentially called callbacks, which is not very nice.

Now, bdrv_aio_cancel has a stricter contract that the completion callbacks are
always called, so we can remove the checks of req->io_canceled and just unref
it in callbacks.

It will also make implementing asynchronous cancellation easier.

Signed-off-by: Fam Zheng <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
hw/scsi/scsi-disk.c
hw/scsi/scsi-generic.c
This page took 0.022579 seconds and 4 git commands to generate.