From: Joelle van Dyne <j...@getutm.app> The check for `n->namespace.blkconf.blk` always fails because this is in the initialization function.
Signed-off-by: Joelle van Dyne <j...@getutm.app> Reviewed-by: Klaus Jensen <k.jen...@samsung.com> Signed-off-by: Klaus Jensen <k.jen...@samsung.com> --- hw/block/nvme.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 08c204d46c43..7244534a89e9 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -6328,11 +6328,9 @@ static void nvme_instance_init(Object *obj) { NvmeCtrl *n = NVME(obj); - if (n->namespace.blkconf.blk) { - device_add_bootindex_property(obj, &n->namespace.blkconf.bootindex, - "bootindex", "/namespace@1,0", - DEVICE(obj)); - } + device_add_bootindex_property(obj, &n->namespace.blkconf.bootindex, + "bootindex", "/namespace@1,0", + DEVICE(obj)); object_property_add(obj, "smart_critical_warning", "uint8", nvme_get_smart_warning, -- 2.31.1