[PATCH for-6.0 5/7] hw/block/nvme: fix warning about legacy namespace configuration

Klaus Jensen posted 7 patches 4 years, 10 months ago
Maintainers: Keith Busch <kbusch@kernel.org>, Fam Zheng <fam@euphon.net>, Stefan Hajnoczi <stefanha@redhat.com>, Max Reitz <mreitz@redhat.com>, Klaus Jensen <its@irrelevant.dk>, Kevin Wolf <kwolf@redhat.com>
There is a newer version of this series
[PATCH for-6.0 5/7] hw/block/nvme: fix warning about legacy namespace configuration
Posted by Klaus Jensen 4 years, 10 months ago
From: Klaus Jensen <k.jensen@samsung.com>

Remove the unused BlockConf from the controller structure and fix the
constraint checking to actually check the right BlockConf and issue the
warning.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/block/nvme.h | 1 -
 hw/block/nvme.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/block/nvme.h b/hw/block/nvme.h
index c610ab30dc5c..1570f65989a7 100644
--- a/hw/block/nvme.h
+++ b/hw/block/nvme.h
@@ -166,7 +166,6 @@ typedef struct NvmeCtrl {
     NvmeBar      bar;
     NvmeParams   params;
     NvmeBus      bus;
-    BlockConf    conf;
 
     uint16_t    cntlid;
     bool        qs_created;
diff --git a/hw/block/nvme.c b/hw/block/nvme.c
index 7a7e793c6c26..403c8381a498 100644
--- a/hw/block/nvme.c
+++ b/hw/block/nvme.c
@@ -5807,7 +5807,7 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
         params->max_ioqpairs = params->num_queues - 1;
     }
 
-    if (n->conf.blk) {
+    if (n->namespace.blkconf.blk) {
         warn_report("drive property is deprecated; "
                     "please use an nvme-ns device instead");
     }
-- 
2.31.0


Re: [PATCH for-6.0 5/7] hw/block/nvme: fix warning about legacy namespace configuration
Posted by Gollu Appalanaidu 4 years, 10 months ago
On Wed, Mar 24, 2021 at 09:09:05PM +0100, Klaus Jensen wrote:
>From: Klaus Jensen <k.jensen@samsung.com>
>
>Remove the unused BlockConf from the controller structure and fix the
>constraint checking to actually check the right BlockConf and issue the
>warning.
>
>Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
>---
> hw/block/nvme.h | 1 -
> hw/block/nvme.c | 2 +-
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/hw/block/nvme.h b/hw/block/nvme.h
>index c610ab30dc5c..1570f65989a7 100644
>--- a/hw/block/nvme.h
>+++ b/hw/block/nvme.h
>@@ -166,7 +166,6 @@ typedef struct NvmeCtrl {
>     NvmeBar      bar;
>     NvmeParams   params;
>     NvmeBus      bus;
>-    BlockConf    conf;
>
>     uint16_t    cntlid;
>     bool        qs_created;
>diff --git a/hw/block/nvme.c b/hw/block/nvme.c
>index 7a7e793c6c26..403c8381a498 100644
>--- a/hw/block/nvme.c
>+++ b/hw/block/nvme.c
>@@ -5807,7 +5807,7 @@ static void nvme_check_constraints(NvmeCtrl *n, Error **errp)
>         params->max_ioqpairs = params->num_queues - 1;
>     }
>
>-    if (n->conf.blk) {
>+    if (n->namespace.blkconf.blk) {
>         warn_report("drive property is deprecated; "
>                     "please use an nvme-ns device instead");
>     }
>-- 
>2.31.0
>
>

Reviewed-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>