summaryrefslogtreecommitdiffstats
path: root/hw/block
diff options
context:
space:
mode:
authorKlaus Jensen2020-08-24 13:32:06 +0200
committerKlaus Jensen2020-10-27 07:24:46 +0100
commit92a10ec17f3ae7221b23f3eaefa29066e10d7973 (patch)
treed74115cd7bccc174d24a1ac8a0ab658a60858aa4 /hw/block
parenthw/block/nvme: refactor aio submission (diff)
downloadqemu-92a10ec17f3ae7221b23f3eaefa29066e10d7973.tar.gz
qemu-92a10ec17f3ae7221b23f3eaefa29066e10d7973.tar.xz
qemu-92a10ec17f3ae7221b23f3eaefa29066e10d7973.zip
hw/block/nvme: default request status to success
Make the default request status NVME_SUCCESS so only error status codes have to be set. Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/nvme.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 84cde40fad..0e916d48d7 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -230,6 +230,7 @@ static void nvme_req_clear(NvmeRequest *req)
{
req->ns = NULL;
memset(&req->cqe, 0x0, sizeof(req->cqe));
+ req->status = NVME_SUCCESS;
}
static void nvme_req_exit(NvmeRequest *req)
@@ -546,8 +547,6 @@ static void nvme_process_aers(void *opaque)
result->log_page = event->result.log_page;
g_free(event);
- req->status = NVME_SUCCESS;
-
trace_pci_nvme_aer_post_cqe(result->event_type, result->event_info,
result->log_page);
@@ -626,7 +625,6 @@ static void nvme_rw_cb(void *opaque, int ret)
if (!ret) {
block_acct_done(stats, acct);
- req->status = NVME_SUCCESS;
} else {
uint16_t status;