diff options
Diffstat (limited to 'hw/block/nvme-ns.c')
-rw-r--r-- | hw/block/nvme-ns.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index fd73d03211..0e87600204 100644 --- a/hw/block/nvme-ns.c +++ b/hw/block/nvme-ns.c @@ -163,6 +163,18 @@ static int nvme_ns_zoned_check_calc_geometry(NvmeNamespace *ns, Error **errp) return -1; } + if (ns->params.max_active_zones) { + if (ns->params.max_open_zones > ns->params.max_active_zones) { + error_setg(errp, "max_open_zones (%u) exceeds max_active_zones (%u)", + ns->params.max_open_zones, ns->params.max_active_zones); + return -1; + } + + if (!ns->params.max_open_zones) { + ns->params.max_open_zones = ns->params.max_active_zones; + } + } + if (ns->params.zd_extension_size) { if (ns->params.zd_extension_size & 0x3f) { error_setg(errp, |