From: Klaus Jensen Date: Wed, 24 Mar 2021 09:11:55 +0000 (+0100) Subject: hw/block/nvme: fix the nsid 'invalid' value X-Git-Tag: v6.0.0-rc3~17^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dae8be368e7b9ad36bc8af1cd365d28b199a6502;p=thirdparty%2Fqemu.git hw/block/nvme: fix the nsid 'invalid' value 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 Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- diff --git a/hw/block/nvme-ns.h b/hw/block/nvme-ns.h index 9ab7894fc83..82340c4b257 100644 --- a/hw/block/nvme-ns.h +++ b/hw/block/nvme-ns.h @@ -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)