diff options
| author | Klaus Jensen <k.jensen@samsung.com> | 2024-12-16 13:53:08 +0100 |
|---|---|---|
| committer | Klaus Jensen <k.jensen@samsung.com> | 2025-02-26 12:40:35 +0100 |
| commit | 304babd9401d8ce8fe139a70fe464332eef2cee0 (patch) | |
| tree | 2d5e4281c105d5e26345ecfa9c28f9468fd9c245 | |
| parent | 6ccca4b6bb9f994cc04e71004e1767a3476d2b23 (diff) | |
| download | focaccia-qemu-304babd9401d8ce8fe139a70fe464332eef2cee0.tar.gz focaccia-qemu-304babd9401d8ce8fe139a70fe464332eef2cee0.zip | |
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>
| -rw-r--r-- | hw/nvme/ctrl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 21496c6b6b..07cd632985 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -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; |