From 92a10ec17f3ae7221b23f3eaefa29066e10d7973 Mon Sep 17 00:00:00 2001 From: Klaus Jensen Date: Mon, 24 Aug 2020 13:32:06 +0200 Subject: hw/block/nvme: default request status to success MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the default request status NVME_SUCCESS so only error status codes have to be set. Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Keith Busch --- hw/block/nvme.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'hw/block') diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 84cde40..0e916d4 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; -- cgit v1.1