All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL v2 0/3] emulated nvme fixes
@ 2021-02-11 15:21 Klaus Jensen
  2021-02-11 15:21 ` [PULL v2 1/3] hw/block/nvme: fix legacy namespace registration Klaus Jensen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Klaus Jensen @ 2021-02-11 15:21 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Kevin Wolf, qemu-block, Klaus Jensen, Max Reitz, Keith Busch,
	Klaus Jensen

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

Hi Peter,

Two small fixes for emulated nvme for regressions reported by Alexander
Graf and Bin Meng.

Sorry for the noise with v1. This should be good and also got the full
CI treatment.

The following changes since commit 83339e21d05c824ebc9131d644f25c23d0e41ecf:

  Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/block-pull-request' into staging (2021-02-10 15:42:20 +0000)

are available in the Git repository at:

  git://git.infradead.org/qemu-nvme.git tags/nvme-fixes-pull-request

for you to fetch changes up to 832a59e43b5d8b8a9c2b2565008ebea1059d539d:

  hw/block/nvme: fix error handling in nvme_ns_realize (2021-02-11 14:23:08 +0100)

----------------------------------------------------------------
Two small fixes for regressions reported by Alexander Graf and Bin Meng.

v2: spotted one bug in the error handling.

----------------------------------------------------------------

Bin Meng (1):
  hw/block/nvme: Fix a build error in nvme_get_feature()

Klaus Jensen (2):
  hw/block/nvme: fix legacy namespace registration
  hw/block/nvme: fix error handling in nvme_ns_realize

 hw/block/nvme-ns.c | 7 +------
 hw/block/nvme.c    | 5 +++++
 2 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.30.0



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

* [PULL v2 1/3] hw/block/nvme: fix legacy namespace registration
  2021-02-11 15:21 [PULL v2 0/3] emulated nvme fixes Klaus Jensen
@ 2021-02-11 15:21 ` Klaus Jensen
  2021-02-11 15:21 ` [PULL v2 2/3] hw/block/nvme: Fix a build error in nvme_get_feature() Klaus Jensen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Klaus Jensen @ 2021-02-11 15:21 UTC (permalink / raw)
  To: Peter Maydell, 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>
Tested-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/block/nvme.c | 4 ++++
 1 file changed, 4 insertions(+)

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



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

* [PULL v2 2/3] hw/block/nvme: Fix a build error in nvme_get_feature()
  2021-02-11 15:21 [PULL v2 0/3] emulated nvme fixes Klaus Jensen
  2021-02-11 15:21 ` [PULL v2 1/3] hw/block/nvme: fix legacy namespace registration Klaus Jensen
@ 2021-02-11 15:21 ` Klaus Jensen
  2021-02-11 15:21 ` [PULL v2 3/3] hw/block/nvme: fix error handling in nvme_ns_realize Klaus Jensen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Klaus Jensen @ 2021-02-11 15:21 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Kevin Wolf, qemu-block, Klaus Jensen, Bin Meng, Max Reitz,
	Keith Busch, Klaus Jensen

From: Bin Meng <bin.meng@windriver.com>

Current QEMU HEAD nvme.c does not compile with the default GCC 5.4
on a Ubuntu 16.04 host:

  hw/block/nvme.c:3242:9: error: ‘result’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         trace_pci_nvme_getfeat_vwcache(result ? "enabled" : "disabled");
         ^
  hw/block/nvme.c:3150:14: note: ‘result’ was declared here
     uint32_t result;
              ^

Explicitly initialize the result to fix it.

Fixes: aa5e55e3b07e ("hw/block/nvme: open code for volatile write cache")
Fixes: Coverity CID 1446371
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/block/nvme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 02390f1f5230..fb83636abdc1 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -3228,6 +3228,7 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeRequest *req)
         result = ns->features.err_rec;
         goto out;
     case NVME_VOLATILE_WRITE_CACHE:
+        result = 0;
         for (i = 1; i <= n->num_namespaces; i++) {
             ns = nvme_ns(n, i);
             if (!ns) {
-- 
2.30.0



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

* [PULL v2 3/3] hw/block/nvme: fix error handling in nvme_ns_realize
  2021-02-11 15:21 [PULL v2 0/3] emulated nvme fixes Klaus Jensen
  2021-02-11 15:21 ` [PULL v2 1/3] hw/block/nvme: fix legacy namespace registration Klaus Jensen
  2021-02-11 15:21 ` [PULL v2 2/3] hw/block/nvme: Fix a build error in nvme_get_feature() Klaus Jensen
@ 2021-02-11 15:21 ` Klaus Jensen
  2021-02-11 16:53 ` [PULL v2 0/3] emulated nvme fixes Peter Maydell
  2021-02-11 17:30 ` no-reply
  4 siblings, 0 replies; 6+ messages in thread
From: Klaus Jensen @ 2021-02-11 15:21 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel
  Cc: Kevin Wolf, qemu-block, Klaus Jensen, Max Reitz, Keith Busch,
	Minwoo Im, Klaus Jensen

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

nvme_ns_realize passes errp to nvme_register_namespaces, but then try to
prepend errp with local_err.

Just remove the local_err and use errp directly.

Fixes: 15d024d4aa9b ("hw/block/nvme: split setup and register for namespace")
Cc: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/block/nvme-ns.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c
index dfed71a950fa..93ac6e107a09 100644
--- a/hw/block/nvme-ns.c
+++ b/hw/block/nvme-ns.c
@@ -358,17 +358,12 @@ static void nvme_ns_realize(DeviceState *dev, Error **errp)
     NvmeNamespace *ns = NVME_NS(dev);
     BusState *s = qdev_get_parent_bus(dev);
     NvmeCtrl *n = NVME(s->parent);
-    Error *local_err = NULL;
 
-    if (nvme_ns_setup(ns, &local_err)) {
-        error_propagate_prepend(errp, local_err,
-                                "could not setup namespace: ");
+    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] 6+ messages in thread

* Re: [PULL v2 0/3] emulated nvme fixes
  2021-02-11 15:21 [PULL v2 0/3] emulated nvme fixes Klaus Jensen
                   ` (2 preceding siblings ...)
  2021-02-11 15:21 ` [PULL v2 3/3] hw/block/nvme: fix error handling in nvme_ns_realize Klaus Jensen
@ 2021-02-11 16:53 ` Peter Maydell
  2021-02-11 17:30 ` no-reply
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2021-02-11 16:53 UTC (permalink / raw)
  To: Klaus Jensen
  Cc: Kevin Wolf, Qemu-block, Klaus Jensen, QEMU Developers, Max Reitz,
	Keith Busch

On Thu, 11 Feb 2021 at 15:21, Klaus Jensen <its@irrelevant.dk> wrote:
>
> From: Klaus Jensen <k.jensen@samsung.com>
>
> Hi Peter,
>
> Two small fixes for emulated nvme for regressions reported by Alexander
> Graf and Bin Meng.
>
> Sorry for the noise with v1. This should be good and also got the full
> CI treatment.
>
> The following changes since commit 83339e21d05c824ebc9131d644f25c23d0e41ecf:
>
>   Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/block-pull-request' into staging (2021-02-10 15:42:20 +0000)
>
> are available in the Git repository at:
>
>   git://git.infradead.org/qemu-nvme.git tags/nvme-fixes-pull-request
>
> for you to fetch changes up to 832a59e43b5d8b8a9c2b2565008ebea1059d539d:
>
>   hw/block/nvme: fix error handling in nvme_ns_realize (2021-02-11 14:23:08 +0100)
>
> ----------------------------------------------------------------
> Two small fixes for regressions reported by Alexander Graf and Bin Meng.
>
> v2: spotted one bug in the error handling.


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.0
for any user-visible changes.

-- PMM


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

* Re: [PULL v2 0/3] emulated nvme fixes
  2021-02-11 15:21 [PULL v2 0/3] emulated nvme fixes Klaus Jensen
                   ` (3 preceding siblings ...)
  2021-02-11 16:53 ` [PULL v2 0/3] emulated nvme fixes Peter Maydell
@ 2021-02-11 17:30 ` no-reply
  4 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2021-02-11 17:30 UTC (permalink / raw)
  To: its
  Cc: kwolf, peter.maydell, qemu-block, k.jensen, qemu-devel, mreitz,
	its, kbusch

Patchew URL: https://patchew.org/QEMU/20210211152139.1004257-1-its@irrelevant.dk/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210211152139.1004257-1-its@irrelevant.dk
Subject: [PULL v2 0/3] emulated nvme fixes

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20210211152139.1004257-1-its@irrelevant.dk -> patchew/20210211152139.1004257-1-its@irrelevant.dk
Switched to a new branch 'test'

=== OUTPUT BEGIN ===
checkpatch.pl: no revisions returned for revlist 'base..'
=== OUTPUT END ===

Test command exited with code: 255


The full log is available at
http://patchew.org/logs/20210211152139.1004257-1-its@irrelevant.dk/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 15:21 [PULL v2 0/3] emulated nvme fixes Klaus Jensen
2021-02-11 15:21 ` [PULL v2 1/3] hw/block/nvme: fix legacy namespace registration Klaus Jensen
2021-02-11 15:21 ` [PULL v2 2/3] hw/block/nvme: Fix a build error in nvme_get_feature() Klaus Jensen
2021-02-11 15:21 ` [PULL v2 3/3] hw/block/nvme: fix error handling in nvme_ns_realize Klaus Jensen
2021-02-11 16:53 ` [PULL v2 0/3] emulated nvme fixes Peter Maydell
2021-02-11 17:30 ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.