From: Klaus Jensen Date: Thu, 11 Feb 2021 10:50:19 +0000 (+0100) Subject: hw/block/nvme: fix legacy namespace registration X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=886188a9c11ff9518c8f20e265e7a98439c14d32;p=qemu.git hw/block/nvme: fix legacy namespace registration 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 Cc: Minwoo Im Tested-by: Alexander Graf Reviewed-by: Minwoo Im Signed-off-by: Klaus Jensen --- diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 5ce21b7100..02390f1f52 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -4507,6 +4507,10 @@ static void nvme_realize(PCIDevice *pci_dev, Error **errp) if (nvme_ns_setup(ns, errp)) { return; } + + if (nvme_register_namespace(n, ns, errp)) { + return; + } } }