qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/block/nvme: fix legacy namespace registration
@ 2021-02-11 10:54 Klaus Jensen
  2021-02-11 12:34 ` Alexander Graf
  2021-02-11 13:10 ` Minwoo Im
  0 siblings, 2 replies; 3+ messages in thread
From: Klaus Jensen @ 2021-02-11 10:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, qemu-block, Klaus Jensen, Max Reitz, Keith Busch,
	Alexander Graf, Minwoo Im, Klaus Jensen

From: Klaus Jensen <k.jensen@samsung.com>

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 <agraf@csgraf.de>
Cc: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/block/nvme.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 5ce21b7100b3..d36e14fe13e2 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -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;
+        }
     }
 }
 
-- 
2.30.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/block/nvme: fix legacy namespace registration
  2021-02-11 10:54 [PATCH] hw/block/nvme: fix legacy namespace registration Klaus Jensen
@ 2021-02-11 12:34 ` Alexander Graf
  2021-02-11 13:10 ` Minwoo Im
  1 sibling, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2021-02-11 12:34 UTC (permalink / raw)
  To: Klaus Jensen, qemu-devel
  Cc: Kevin Wolf, Peter Maydell, qemu-block, Klaus Jensen, Max Reitz,
	Minwoo Im, Keith Busch


On 11.02.21 11:54, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
>
> 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 <agraf@csgraf.de>
> Cc: Minwoo Im <minwoo.im.dev@gmail.com>
> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


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 <agraf@csgraf.de>


Thanks!

Alex


> ---
>   hw/block/nvme.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 5ce21b7100b3..d36e14fe13e2 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -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;
> +        }
>       }
>   }
>   


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/block/nvme: fix legacy namespace registration
  2021-02-11 10:54 [PATCH] hw/block/nvme: fix legacy namespace registration Klaus Jensen
  2021-02-11 12:34 ` Alexander Graf
@ 2021-02-11 13:10 ` Minwoo Im
  1 sibling, 0 replies; 3+ messages in thread
From: Minwoo Im @ 2021-02-11 13:10 UTC (permalink / raw)
  To: Klaus Jensen
  Cc: Kevin Wolf, qemu-block, Klaus Jensen, qemu-devel, Max Reitz,
	Alexander Graf, Keith Busch

Thanks Klaus,

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-11 13:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-11 10:54 [PATCH] hw/block/nvme: fix legacy namespace registration Klaus Jensen
2021-02-11 12:34 ` Alexander Graf
2021-02-11 13:10 ` Minwoo Im

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).