diff mbox series

hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node

Message ID 20220628122209.415725-1-niklas.cassel@wdc.com (mailing list archive)
State New, archived
Headers show
Series hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node | expand

Commit Message

Niklas Cassel June 28, 2022, 12:22 p.m. UTC
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(+)

Comments

Niklas Cassel June 28, 2022, 12:43 p.m. UTC | #1
On Tue, Jun 28, 2022 at 02:22:09PM +0200, Niklas Cassel via wrote:

Hello Peter,

It seems that mailman configuration on qemu-devel is rewriting the
"From:" field to "From: Niklas Cassel via <qemu-devel@nongnu.org>"

If found this old thread about the same issue:
https://qemu-devel.nongnu.narkive.com/6hm8Fbvz/mailing-list-vs-dmarc-and-microsoft-com-s-p-reject-policy

Which says that this can happen when using p=reject policy.

However, doing a bcc to another of my personal addresses,
it looks like the SKIM/SPF/DMARC is all passing,
and non of them seem to have p=reject:

ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=TTwPBUcS;
       spf=pass (google.com: domain of prvs=171ad38db=niklas.cassel@wdc.com designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=171ad38db=niklas.cassel@wdc.com";
       dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com
Return-Path: <prvs=171ad38db=niklas.cassel@wdc.com>
Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com. [216.71.153.141])
        by mx.google.com with ESMTPS id sd33-20020a1709076e2100b00711f20051f2si13306645ejc.697.2022.06.28.05.22.25
        for <nks.gnu@gmail.com>
        (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 28 Jun 2022 05:22:26 -0700 (PDT)
Received-SPF: pass (google.com: domain of prvs=171ad38db=niklas.cassel@wdc.com designates 216.71.153.141 as permitted sender) client-ip=216.71.153.141;
Authentication-Results: mx.google.com;
       dkim=pass header.i=@wdc.com header.s=dkim.wdc.com header.b=TTwPBUcS;
       spf=pass (google.com: domain of prvs=171ad38db=niklas.cassel@wdc.com designates 216.71.153.141 as permitted sender) smtp.mailfrom="prvs=171ad38db=niklas.cassel@wdc.com";
       dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE)


Any idea why mailmain is rewriting the "From:" field for my messages?


Kind regards,
Niklas
Klaus Jensen July 7, 2022, 6:02 a.m. UTC | #2
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.
diff mbox series

Patch

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");