mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
hw/nvme: only set command abort requested when cancelled due to Abort
The Command Abort Requested status code should only be set if the command was explicitly cancelled due to an Abort command. Or, in the case the cancel was due to Submission Queue deletion, set the status code to Command Aborted due to SQ Deletion. Reviewed-by: Jesper Wendel Devantier <foss@defmacro.it> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
parent
6ccca4b6bb
commit
304babd940
1 changed files with 2 additions and 4 deletions
|
@ -1783,10 +1783,6 @@ static void nvme_aio_err(NvmeRequest *req, int ret)
|
|||
break;
|
||||
}
|
||||
|
||||
if (ret == -ECANCELED) {
|
||||
status = NVME_CMD_ABORT_REQ;
|
||||
}
|
||||
|
||||
trace_pci_nvme_err_aio(nvme_cid(req), strerror(-ret), status);
|
||||
|
||||
error_setg_errno(&local_err, -ret, "aio failed");
|
||||
|
@ -4827,6 +4823,7 @@ static uint16_t nvme_del_sq(NvmeCtrl *n, NvmeRequest *req)
|
|||
while (!QTAILQ_EMPTY(&sq->out_req_list)) {
|
||||
r = QTAILQ_FIRST(&sq->out_req_list);
|
||||
assert(r->aiocb);
|
||||
r->status = NVME_CMD_ABORT_SQ_DEL;
|
||||
blk_aio_cancel(r->aiocb);
|
||||
}
|
||||
|
||||
|
@ -6137,6 +6134,7 @@ static uint16_t nvme_abort(NvmeCtrl *n, NvmeRequest *req)
|
|||
QTAILQ_FOREACH_SAFE(r, &sq->out_req_list, entry, next) {
|
||||
if (r->cqe.cid == cid) {
|
||||
if (r->aiocb) {
|
||||
r->status = NVME_CMD_ABORT_REQ;
|
||||
blk_aio_cancel_async(r->aiocb);
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue