qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hw/nvme: force nvme-ns param 'shared' to false if no nvme-su


From: Klaus Jensen
Subject: Re: [PATCH] hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node
Date: Thu, 7 Jul 2022 08:02:26 +0200

On Jun 28 14:22, Niklas Cassel wrote:
> Since commit 916b0f0b5264 ("hw/nvme: change nvme-ns 'shared' default")
> the default value of nvme-ns param 'shared' is set to true, regardless
> if there is a nvme-subsys node or not.
> 
> On a system without a nvme-subsys node, a namespace will never be able
> to be attached to more than one controller, so for this configuration,
> it is counterintuitive for this parameter to be set by default.
> 
> Force the nvme-ns param 'shared' to false for configurations where
> there is no nvme-subsys node, as the namespace will never be able to
> attach to more than one controller anyway.
> 
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> ---
>  hw/nvme/ns.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/hw/nvme/ns.c b/hw/nvme/ns.c
> index 870c3ca1a2..62a1f97be0 100644
> --- a/hw/nvme/ns.c
> +++ b/hw/nvme/ns.c
> @@ -546,6 +546,8 @@ static void nvme_ns_realize(DeviceState *dev, Error 
> **errp)
>      int i;
>  
>      if (!n->subsys) {
> +        /* If no subsys, the ns cannot be attached to more than one ctrl. */
> +        ns->params.shared = false;
>          if (ns->params.detached) {
>              error_setg(errp, "detached requires that the nvme device is "
>                         "linked to an nvme-subsys device");
> -- 
> 2.36.1
> 

Thanks Niklas,

Applied to nvme-next.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]