diff options
author | Klaus Jensen <k.jensen@samsung.com> | 2020-10-01 23:37:20 +0200 |
---|---|---|
committer | Klaus Jensen <k.jensen@samsung.com> | 2020-10-27 07:24:47 +0100 |
commit | b20804946bce7545ec9758d82806ee30a21b6211 (patch) | |
tree | de6a9692cae760ddd49d97b44a5962f4bc280ac7 | |
parent | 6eb7a071292a2f11065127ac152fa24248806021 (diff) | |
download | qemu-b20804946bce7545ec9758d82806ee30a21b6211.zip qemu-b20804946bce7545ec9758d82806ee30a21b6211.tar.gz qemu-b20804946bce7545ec9758d82806ee30a21b6211.tar.bz2 |
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 <k.jensen@samsung.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
-rw-r--r-- | hw/block/nvme.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 5768a68..2225b94 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -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; } } |