hw/block/nvme: fix legacy namespace registration
PATCH 1/1 hw/block/nvme: fix legacy namespace registration
From: Klaus Jensen <[email protected]>
Moving namespace registration to the nvme-ns realization function had the unintended side-effect of breaking legacy namespace registration. Fix this.
Fixes 15d024d4aa9b ("hw/block/nvme: split setup and register for namespace")
Reported-by Alexander Graf <[email protected]>
Cc Minwoo Im <[email protected]>
Signed-off-by Klaus Jensen <[email protected]>
--- hw/block/nvme.c | 6 ++++++ 1 file changed, 6 insertions(+)
hw/block/nvme.c +6 -0
@@ -4507,6 +4507,12 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)if (nvme_ns_setup (ns, errp)) {return ; } + +if (nvme_register_namespace (n, ns, errp)) { +error_propagate_prepend (errp, local_err, +"could not register namespace: " ); +return ; + } } }
Signature · 1 line
2.30.0
Quoted 10 lines · Klaus Jensen
From: Klaus Jensen <[email protected]>
Moving namespace registration to the nvme-ns realization function had the unintended side-effect of breaking legacy namespace registration. Fix this.
Fixes 15d024d4aa9b ("hw/block/nvme: split setup and register for namespace")Reported-by Alexander Graf <[email protected]>Cc Minwoo Im <[email protected]>Signed-off-by Klaus Jensen <[email protected]>
I can confirm that this fixes the upstream regression. Thanks a lot. Please work on a way with Peter to pull this into the tree as quickly as possible, so that we maintain a working master branch with NVMe.
Tested-by Alexander Graf <[email protected]>
Thanks!
Alex
Quoted 21 lines
--- hw/block/nvme.c | 6 ++++++ 1 file changed, 6 insertions(+)hw/block/nvme.c +6
-0@@ -4507,6 +4507,12 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp)if (nvme_ns_setup (ns, errp)) {return ; } + +if (nvme_register_namespace (n, ns, errp)) { +error_propagate_prepend (errp, local_err, +"could not register namespace: " ); +return ; + } } }
Thanks Klaus,
Reviewed-by Minwoo Im <[email protected]>