mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
hw/block/nvme: update nsid when registered
If the user does not specify an nsid parameter on the nvme-ns device, nvme_register_namespace will find the first free namespace id and assign that. This fix makes sure the assigned id is saved. Signed-off-by: Klaus Jensen <[email protected]> Reviewed-by: Dmitry Fomichev <[email protected]>
This commit is contained in:
1 parent
6eb7a07129
commit
b20804946b
1 file changed
+1
-1
+1
-1
@@ -2578,7 +2578,7 @@ int nvme_register_namespace(NvmeCtrl *n, NvmeNamespace *ns, Error **errp)
|
||||
for (int i = 1; i <= n->num_namespaces; i++) {
|
||||
NvmeNamespace *ns = nvme_ns(n, i);
|
||||
if (!ns) {
|
||||
nsid = i;
|
||||
nsid = ns->params.nsid = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user