Skip to content

Commit

Permalink
hw/block/nvme: fix legacy namespace registration
Browse files Browse the repository at this point in the history
Moving namespace registration to the nvme-ns realization function had
the unintended side-effect of breaking legacy namespace registration.
Fix this.

Fixes: 15d024d ("hw/block/nvme: split setup and register for namespace")
Reported-by: Alexander Graf <agraf@csgraf.de>
Cc: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Alexander Graf <agraf@csgraf.de>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
  • Loading branch information
birkelund committed Feb 11, 2021
1 parent 83339e2 commit 387ec4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hw/block/nvme.c
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 387ec4a

Please sign in to comment.