qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Klaus Jensen <its@irrelevant.dk>
To: Niklas Cassel <niklas.cassel@wdc.com>
Cc: kbusch@kernel.org, qemu-block@nongnu.org, qemu-devel@nongnu.org,
	hch@infradead.org
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	[thread overview]
Message-ID: <YsZ28nGMPfQTt9h5@apples> (raw)
In-Reply-To: <20220628122209.415725-1-niklas.cassel@wdc.com>

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      parent reply	other threads:[~2022-07-07  6:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 12:22 [PATCH] hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node Niklas Cassel via
2022-06-28 12:43 ` Niklas Cassel via
2022-07-07  6:02 ` Klaus Jensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YsZ28nGMPfQTt9h5@apples \
    --to=its@irrelevant.dk \
    --cc=hch@infradead.org \
    --cc=kbusch@kernel.org \
    --cc=niklas.cassel@wdc.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).