diff mbox series

[09/17] hw/block/nvme: default request status to success

Message ID 20200904141956.576630-10-its@irrelevant.dk
State New, archived
Headers show
Series hw/block/nvme: multiple namespaces support | expand

Commit Message

Klaus Jensen Sept. 4, 2020, 2:19 p.m. UTC
From: Klaus Jensen <k.jensen@samsung.com>

Make the default request status NVME_SUCCESS so only error status codes
has to be set.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/block/nvme.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé Sept. 7, 2020, 2:17 a.m. UTC | #1
On 9/4/20 4:19 PM, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> Make the default request status NVME_SUCCESS so only error status codes
> has to be set.

Typo 'has' -> 'have'.

> 
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  hw/block/nvme.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 3e32f39c7c1d..64c8f232e3ea 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -231,6 +231,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)
> @@ -547,8 +548,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);
>  
> @@ -713,7 +712,6 @@ static void nvme_aio_cb(void *opaque, int ret)
>  
>      if (!ret) {
>          block_acct_done(stats, acct);
> -        req->status = NVME_SUCCESS;
>      } else {
>          uint16_t status;
>  
>
diff mbox series

Patch

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 3e32f39c7c1d..64c8f232e3ea 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -231,6 +231,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)
@@ -547,8 +548,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);
 
@@ -713,7 +712,6 @@  static void nvme_aio_cb(void *opaque, int ret)
 
     if (!ret) {
         block_acct_done(stats, acct);
-        req->status = NVME_SUCCESS;
     } else {
         uint16_t status;