block/nvme: Report warning with warn_report()
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Thu, 29 Oct 2020 09:32:44 +0000 (10:32 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 3 Nov 2020 19:06:20 +0000 (19:06 +0000)
Instead of displaying warning on stderr, use warn_report()
which also displays it on the monitor.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20201029093306.1063879-4-philmd@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Eric Auger <eric.auger@redhat.com>
block/nvme.c

index 739a0a700cb807bc370f56904b5f85aa3c7e21fb..6f1d7f9b2a1c521bc6f17555fc7c9f2ea2775008 100644 (file)
@@ -399,8 +399,8 @@ static bool nvme_process_completion(NVMeQueuePair *q)
         }
         cid = le16_to_cpu(c->cid);
         if (cid == 0 || cid > NVME_QUEUE_SIZE) {
-            fprintf(stderr, "Unexpected CID in completion queue: %" PRIu32 "\n",
-                    cid);
+            warn_report("NVMe: Unexpected CID in completion queue: %"PRIu32", "
+                        "queue size: %u", cid, NVME_QUEUE_SIZE);
             continue;
         }
         trace_nvme_complete_command(s, q->index, cid);