]> Git Repo - qemu.git/commitdiff
hw/block/nvme: fix the nsid 'invalid' value
authorKlaus Jensen <[email protected]>
Wed, 24 Mar 2021 09:11:55 +0000 (10:11 +0100)
committerKlaus Jensen <[email protected]>
Tue, 6 Apr 2021 18:44:56 +0000 (20:44 +0200)
The `nvme_nsid()` function returns '-1' (FFFFFFFFh) when the given
namespace is NULL. Since FFFFFFFFh is actually a valid namespace
identifier (the "broadcast" value), change this to be '0' since that
actually *is* the invalid value.

Signed-off-by: Klaus Jensen <[email protected]>
Reviewed-by: Gollu Appalanaidu <[email protected]>
Reviewed-by: Keith Busch <[email protected]>
hw/block/nvme-ns.h

index 9ab7894fc83e6b96be41ac913adc92401c65b407..82340c4b257428757f51f922b2282a08b927c4ac 100644 (file)
@@ -96,7 +96,7 @@ static inline uint32_t nvme_nsid(NvmeNamespace *ns)
         return ns->params.nsid;
     }
 
-    return -1;
+    return 0;
 }
 
 static inline bool nvme_ns_shared(NvmeNamespace *ns)
This page took 0.026433 seconds and 4 git commands to generate.