On Thu Nov 12, 2026 at 10:53 AM CET, Klaus Jensen wrote:
> From: Klaus Jensen <[email protected]>
>
> The Set Features handler for the FDP Events feature asserts that a
> namespace is passed in the command because the feature is
> namespace-specific. An invalid namespace is rejected prior to reaching
> the handler, but the "broadcast nsid" (0xFFFFFFFF) is considered valid
> and causes the assert to abort QEMU.
>
> Reject it with Invalid Field in Command instead as per the
> specification.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4792
> Signed-off-by: Klaus Jensen <[email protected]>
Fixes tag and QEMU stable in cc.
> ---
> hw/nvme/ctrl.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index a0d22dacedfa..71c24dc02b67 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -6636,7 +6636,9 @@ static uint16_t nvme_set_feature_fdp_events(NvmeCtrl
> *n, NvmeNamespace *ns,
> g_autofree uint8_t *events = NULL;
> NvmeRuHandle *ruh = NULL;
>
> - assert(ns);
> + if (!ns) {
> + return NVME_INVALID_FIELD | NVME_DNR;
> + }
>
> if (!n->subsys || !n->subsys->endgrp.fdp.enabled) {
> return NVME_FDP_DISABLED | NVME_DNR;
Thanks,
Tommaso