[PATCHv2 0/5] qemu: Introduce nvme disk emulation support

From: hongleiwang <honglei.wang@smartx.com> QEMU has supported nvme disk emulation for a long time, see: https://qemu-project.gitlab.io/qemu/system/devices/nvme.html. The following patches introduce nvme-ns disk bus type: A disk with nvme-ns as bus is represented as an nvme namespace and needs to be attached to an nvme controller. In XML, it can be used like this: <devices> ... <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/data.img'/> <target dev='nvmensa' bus='nvme-ns'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='nvme' index='0'> <serial>nvme-controller-serial-value</serial> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </controller> ... </devices> Signed-off-by: ray <honglei.wang@smartx.com> --- Compared to patch v1, this version removes the nvme bus type implementation and keeps only the nvme controller + nvme-ns bus approach. ray (5): qemu: Add support for NVMe namespace disk bus type qemu_capabilities: Add support for nvme-ns bus capabilities schema: Add nvme controller and nvme-ns bus defination tests: Add test case for nvme-ns device configuration NEWS: Document qemu nvme disk emulation feature NEWS.rst | 17 +++++++++ src/conf/domain_conf.c | 39 ++++++++++++++++++++ src/conf/domain_conf.h | 7 ++++ src/conf/domain_postparse.c | 2 ++ src/conf/domain_validate.c | 4 ++- src/conf/schemas/domaincommon.rng | 11 +++++- src/conf/virconftypes.h | 2 ++ src/hyperv/hyperv_driver.c | 2 ++ src/qemu/qemu_alias.c | 1 + src/qemu/qemu_capabilities.c | 5 +++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 26 ++++++++++++++ src/qemu/qemu_domain_address.c | 5 +++ src/qemu/qemu_hotplug.c | 14 ++++++-- src/qemu/qemu_postparse.c | 1 + src/qemu/qemu_validate.c | 18 ++++++++++ src/test/test_driver.c | 2 ++ src/util/virutil.c | 2 +- src/vbox/vbox_common.c | 2 ++ src/vmx/vmx.c | 1 + .../qemu_10.0.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 1 + .../qemu_10.0.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + .../domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.1.0.sparc.xml | 1 + tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml | 1 + tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml | 1 + tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0.ppc.xml | 1 + tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 1 + .../qemu_8.2.0-tcg-virt.loongarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml | 1 + .../domaincapsdata/qemu_8.2.0-virt.loongarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 1 + tests/domaincapsdata/qemu_8.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 1 + .../domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_9.1.0.s390x.xml | 1 + tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 1 + .../domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml | 1 + .../qemu_9.2.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 1 + .../qemu_9.2.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml | 1 + .../caps_10.0.0_x86_64+amdsev.xml | 1 + tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 1 + .../qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 1 + tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml | 1 + .../caps_8.2.0_loongarch64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 + .../caps_9.2.0_aarch64+hvf.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 1 + .../caps_9.2.0_x86_64+amdsev.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 1 + .../disk-nvme-ns-device.x86_64-latest.args | 36 +++++++++++++++++++ .../disk-nvme-ns-device.x86_64-latest.xml | 42 ++++++++++++++++++++++ tests/qemuxmlconfdata/disk-nvme-ns-device.xml | 41 +++++++++++++++++++++ tests/qemuxmlconftest.c | 1 + 117 files changed, 370 insertions(+), 5 deletions(-) create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.xml -- 2.11.0

From: ray <honglei.wang@smartx.com> This patch extends the disk bus support by introducing a new nvme-ns bus type. The nvme-ns bus disk needs to be attached to nvme controller. A controller can contain multiple nvme-ns disk devices. Signed-off-by: ray <honglei.wang@smartx.com> --- src/conf/domain_conf.c | 39 +++++++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 7 +++++++ src/conf/domain_postparse.c | 2 ++ src/conf/domain_validate.c | 4 +++- src/conf/virconftypes.h | 2 ++ src/hyperv/hyperv_driver.c | 2 ++ src/qemu/qemu_alias.c | 1 + src/qemu/qemu_command.c | 26 ++++++++++++++++++++++++++ src/qemu/qemu_domain_address.c | 5 +++++ src/qemu/qemu_hotplug.c | 14 ++++++++++++-- src/qemu/qemu_postparse.c | 1 + src/qemu/qemu_validate.c | 12 ++++++++++++ src/test/test_driver.c | 2 ++ src/util/virutil.c | 2 +- src/vbox/vbox_common.c | 2 ++ src/vmx/vmx.c | 1 + 16 files changed, 118 insertions(+), 4 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 542d6ade91..e4b3bf8720 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -372,6 +372,7 @@ VIR_ENUM_IMPL(virDomainDiskBus, "uml", "sata", "sd", + "nvme-ns", ); VIR_ENUM_IMPL(virDomainDiskCache, @@ -420,6 +421,7 @@ VIR_ENUM_IMPL(virDomainController, "pci", "xenbus", "isa", + "nvme", ); VIR_ENUM_IMPL(virDomainControllerModelPCI, @@ -2563,6 +2565,7 @@ virDomainControllerDefNew(virDomainControllerType type) case VIR_DOMAIN_CONTROLLER_TYPE_SATA: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; } @@ -6869,6 +6872,14 @@ virDomainDiskDefAssignAddress(virDomainXMLOption *xmlopt G_GNUC_UNUSED, def->info.addr.drive.unit = idx % 2; break; + case VIR_DOMAIN_DISK_BUS_NVME_NS: + /* For NVME-NS, each nvme controller has a maximum of 256 nvme-ns */ + def->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE; + def->info.addr.drive.controller = idx / 256; + def->info.addr.drive.bus = 0; + def->info.addr.drive.unit = idx % 256; + break; + case VIR_DOMAIN_DISK_BUS_NONE: case VIR_DOMAIN_DISK_BUS_VIRTIO: case VIR_DOMAIN_DISK_BUS_XEN: @@ -8784,6 +8795,7 @@ virDomainControllerModelTypeFromString(const virDomainControllerDef *def, case VIR_DOMAIN_CONTROLLER_TYPE_SATA: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: return -1; } @@ -8812,6 +8824,7 @@ virDomainControllerModelTypeToString(virDomainControllerDef *def, case VIR_DOMAIN_CONTROLLER_TYPE_SATA: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: return NULL; } @@ -8832,6 +8845,8 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, int ntargetNodes = 0; g_autofree xmlNodePtr *modelNodes = NULL; int nmodelNodes = 0; + g_autofree xmlNodePtr *serialNodes = NULL; + int nserialNodes = 0; int numaNode = -1; int ports; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -8969,6 +8984,18 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, if (virXMLPropInt(node, "ports", 10, VIR_XML_PROP_NONNEGATIVE, &ports, -1) < 0) return NULL; + if ((nserialNodes = virXPathNodeSet("./serial", ctxt, &serialNodes)) > 1) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Multiple <serial> elements in controller definition not allowed")); + return NULL; + } + + if (nserialNodes == 1) { + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_NVME) { + def->opts.nvmeopts.serial = virXMLNodeContentString(serialNodes[0]); + } + } + switch (def->type) { case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: { if (virXMLPropInt(node, "vectors", 10, VIR_XML_PROP_NONNEGATIVE, @@ -9054,6 +9081,7 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, case VIR_DOMAIN_CONTROLLER_TYPE_SATA: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: default: break; @@ -14998,6 +15026,10 @@ virDomainDiskControllerMatch(int controller_type, int disk_bus) disk_bus == VIR_DOMAIN_DISK_BUS_SATA) return true; + if (controller_type == VIR_DOMAIN_CONTROLLER_TYPE_NVME && + disk_bus == VIR_DOMAIN_DISK_BUS_NVME_NS) + return true; + return false; } @@ -24028,6 +24060,12 @@ virDomainControllerDefFormat(virBuffer *buf, } break; + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: + if (def->opts.nvmeopts.serial != NULL) { + virBufferAsprintf(&childBuf, "<serial>%s</serial>\n", def->opts.nvmeopts.serial); + } + break; + case VIR_DOMAIN_CONTROLLER_TYPE_PCI: if (virDomainControllerDefFormatPCI(&childBuf, def, flags) < 0) return -1; @@ -29662,6 +29700,7 @@ virDiskNameToBusDeviceIndex(virDomainDiskDef *disk, case VIR_DOMAIN_DISK_BUS_NONE: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_UML: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_LAST: default: *busIdx = 0; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 58b97a2b54..e9db1ea896 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -401,6 +401,7 @@ typedef enum { VIR_DOMAIN_DISK_BUS_UML, VIR_DOMAIN_DISK_BUS_SATA, VIR_DOMAIN_DISK_BUS_SD, + VIR_DOMAIN_DISK_BUS_NVME_NS, VIR_DOMAIN_DISK_BUS_LAST } virDomainDiskBus; @@ -611,6 +612,7 @@ typedef enum { VIR_DOMAIN_CONTROLLER_TYPE_PCI, VIR_DOMAIN_CONTROLLER_TYPE_XENBUS, VIR_DOMAIN_CONTROLLER_TYPE_ISA, + VIR_DOMAIN_CONTROLLER_TYPE_NVME, VIR_DOMAIN_CONTROLLER_TYPE_LAST } virDomainControllerType; @@ -766,6 +768,10 @@ struct _virDomainXenbusControllerOpts { int maxEventChannels; /* -1 == undef */ }; +struct _virDomainNVMeControllerOpts { + char *serial; +}; + /* Stores the virtual disk controller configuration */ struct _virDomainControllerDef { virDomainControllerType type; @@ -782,6 +788,7 @@ struct _virDomainControllerDef { virDomainPCIControllerOpts pciopts; virDomainUSBControllerOpts usbopts; virDomainXenbusControllerOpts xenbusopts; + virDomainNVMeControllerOpts nvmeopts; } opts; virDomainDeviceInfo info; virDomainVirtioOptions *virtio; diff --git a/src/conf/domain_postparse.c b/src/conf/domain_postparse.c index bf33f29638..68d99f3c81 100644 --- a/src/conf/domain_postparse.c +++ b/src/conf/domain_postparse.c @@ -523,6 +523,8 @@ virDomainDiskDefPostParse(virDomainDiskDef *disk, disk->bus = VIR_DOMAIN_DISK_BUS_XEN; else if (STRPREFIX(disk->dst, "ubd")) disk->bus = VIR_DOMAIN_DISK_BUS_UML; + else if (STRPREFIX(disk->dst, "nvmens")) + disk->bus = VIR_DOMAIN_DISK_BUS_NVME_NS; } } diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index d0d4bc0bf4..1ad8350117 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -267,6 +267,7 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SD: case VIR_DOMAIN_DISK_BUS_NONE: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_LAST: return true; } @@ -948,7 +949,8 @@ virDomainDiskDefValidate(const virDomainDef *def, !STRPREFIX(disk->dst, "sd") && !STRPREFIX(disk->dst, "vd") && !STRPREFIX(disk->dst, "xvd") && - !STRPREFIX(disk->dst, "ubd")) { + !STRPREFIX(disk->dst, "ubd") && + !STRPREFIX(disk->dst, "nvmens")) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid harddisk device name: %1$s"), disk->dst); return -1; diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index c70437bc05..8c6fcdbeaa 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -276,6 +276,8 @@ typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCallback typedef struct _virDomainXenbusControllerOpts virDomainXenbusControllerOpts; +typedef struct _virDomainNVMeControllerOpts virDomainNVMeControllerOpts; + typedef enum { VIR_DOMAIN_DISK_IO_DEFAULT = 0, VIR_DOMAIN_DISK_IO_NATIVE, diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 0d1e388c08..aefb48923b 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -948,6 +948,7 @@ hypervDomainAttachStorage(virDomainPtr domain, virDomainDef *def, const char *ho case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_LAST: default: virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unsupported controller type")); @@ -3078,6 +3079,7 @@ hypervDomainAttachDeviceFlags(virDomainPtr domain, const char *xml, unsigned int case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_LAST: default: virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid disk bus in definition")); diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 3e6bced4a8..5cffd9e5c8 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -258,6 +258,7 @@ qemuAssignDeviceDiskAlias(virDomainDef *def, case VIR_DOMAIN_DISK_BUS_IDE: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SCSI: + case VIR_DOMAIN_DISK_BUS_NVME_NS: diskPriv->qomName = g_strdup(disk->info.alias); break; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e6d308534f..d5f75fb3f4 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -531,6 +531,17 @@ qemuBuildDeviceAddresDriveProps(virJSONValue *props, } break; + case VIR_DOMAIN_DISK_BUS_NVME_NS: + if (!(controllerAlias = virDomainControllerAliasFind(domainDef, + VIR_DOMAIN_CONTROLLER_TYPE_NVME, + info->addr.drive.controller))) + return -1; + + if (virJSONValueObjectAdd(&props, + "s:bus", controllerAlias, + NULL) < 0) + return -1; + break; case VIR_DOMAIN_DISK_BUS_VIRTIO: case VIR_DOMAIN_DISK_BUS_USB: @@ -1722,6 +1733,10 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, driver = "floppy"; break; + case VIR_DOMAIN_DISK_BUS_NVME_NS: + driver = "nvme-ns"; + break; + case VIR_DOMAIN_DISK_BUS_XEN: case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SD: @@ -2851,6 +2866,16 @@ qemuBuildControllerDevProps(const virDomainDef *domainDef, break; + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: + if (virJSONValueObjectAdd(&props, + "s:driver", "nvme", + "s:id", def->info.alias, + "s:serial", def->opts.nvmeopts.serial, + NULL) < 0) + return -1; + + break; + case VIR_DOMAIN_CONTROLLER_TYPE_IDE: case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: @@ -3013,6 +3038,7 @@ qemuBuildControllersCommandLine(virCommand *cmd, VIR_DOMAIN_CONTROLLER_TYPE_IDE, VIR_DOMAIN_CONTROLLER_TYPE_SATA, VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL, + VIR_DOMAIN_CONTROLLER_TYPE_NVME, }; for (i = 0; i < G_N_ELEMENTS(contOrder); i++) { diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index e89cdee487..a4d0c0d0d5 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -616,6 +616,9 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev, } break; + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: + return pciFlags; + case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: @@ -738,6 +741,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_NONE: case VIR_DOMAIN_DISK_BUS_LAST: return 0; @@ -1919,6 +1923,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDef *def, case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; } diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5326aba281..844cfc2e02 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -848,7 +848,8 @@ qemuDomainAttachControllerDevice(virDomainObj *vm, bool releaseaddr = false; if (controller->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI && \ - controller->type != VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) { + controller->type != VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL && \ + controller->type != VIR_DOMAIN_CONTROLLER_TYPE_NVME) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("'%1$s' controller cannot be hot plugged."), virDomainControllerTypeToString(controller->type)); @@ -1058,6 +1059,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver, /* Note that SD card hotplug support should be added only once * they support '-device' (don't require -drive only). * See also: qemuDiskBusIsSD */ + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_NONE: case VIR_DOMAIN_DISK_BUS_LAST: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -5782,6 +5784,7 @@ qemuDomainDetachPrepDisk(virDomainObj *vm, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("This type of disk cannot be hot unplugged")); return -1; @@ -5856,6 +5859,11 @@ qemuDomainDiskControllerIsBusy(virDomainObj *vm, continue; break; + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: + if (disk->bus != VIR_DOMAIN_DISK_BUS_NVME_NS) + continue; + break; + case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: /* xenbus is not supported by the qemu driver */ continue; @@ -5905,6 +5913,7 @@ qemuDomainControllerIsBusy(virDomainObj *vm, case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_SCSI: case VIR_DOMAIN_CONTROLLER_TYPE_SATA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: return qemuDomainDiskControllerIsBusy(vm, detach); case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: @@ -5934,7 +5943,8 @@ qemuDomainDetachPrepController(virDomainObj *vm, int idx; virDomainControllerDef *controller = NULL; - if (match->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { + if (match->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI && + match->type != VIR_DOMAIN_CONTROLLER_TYPE_NVME) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("'%1$s' controller cannot be hot unplugged."), virDomainControllerTypeToString(match->type)); diff --git a/src/qemu/qemu_postparse.c b/src/qemu/qemu_postparse.c index ed4af9ca8e..8150dffac6 100644 --- a/src/qemu/qemu_postparse.c +++ b/src/qemu/qemu_postparse.c @@ -429,6 +429,7 @@ qemuDomainControllerDefPostParse(virDomainControllerDef *cont, case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; } diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b2c3c9e2f6..9985b2e2c1 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -2945,6 +2945,7 @@ qemuValidateDomainDeviceDefDiskIOThreads(const virDomainDef *def, case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: case VIR_DOMAIN_DISK_BUS_NONE: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_LAST: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("IOThreads not available for bus %1$s target %2$s"), @@ -3079,6 +3080,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("disk device='lun' is not supported for bus='%1$s'"), virDomainDiskBusTypeToString(disk->bus)); @@ -3194,6 +3196,14 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, break; + case VIR_DOMAIN_DISK_BUS_NVME_NS: + if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected address type for nvme-ns disk")); + return -1; + } + break; + case VIR_DOMAIN_DISK_BUS_XEN: case VIR_DOMAIN_DISK_BUS_SD: case VIR_DOMAIN_DISK_BUS_NONE: @@ -3382,6 +3392,7 @@ qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk, case VIR_DOMAIN_DISK_BUS_USB: case VIR_DOMAIN_DISK_BUS_VIRTIO: case VIR_DOMAIN_DISK_BUS_SCSI: + case VIR_DOMAIN_DISK_BUS_NVME_NS: break; case VIR_DOMAIN_DISK_BUS_IDE: @@ -4399,6 +4410,7 @@ qemuValidateDomainDeviceDefController(const virDomainControllerDef *controller, case VIR_DOMAIN_CONTROLLER_TYPE_USB: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; } diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 6f18b2b2c8..95ab1cac8f 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -10344,6 +10344,7 @@ testDomainAttachDeviceDiskLiveInternal(testDriver *driver G_GNUC_UNUSED, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_NONE: case VIR_DOMAIN_DISK_BUS_LAST: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -10792,6 +10793,7 @@ testDomainDetachPrepDisk(virDomainObj *vm, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("This type of disk cannot be hot unplugged")); return -1; diff --git a/src/util/virutil.c b/src/util/virutil.c index 2abcb282fe..02494f1061 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -327,7 +327,7 @@ int virDiskNameParse(const char *name, int *disk, int *partition) const char *ptr = NULL; char *rem; int idx = 0; - static char const* const drive_prefix[] = {"fd", "hd", "vd", "sd", "xvd", "ubd"}; + static char const* const drive_prefix[] = {"fd", "hd", "vd", "sd", "xvd", "ubd", "nvmens"}; size_t i; size_t n_digits; diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 349ac832dc..703150d3c6 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -494,6 +494,7 @@ vboxSetStorageController(virDomainControllerDef *controller, case VIR_DOMAIN_CONTROLLER_TYPE_PCI: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("The vbox driver does not support %1$s controller type"), @@ -1238,6 +1239,7 @@ vboxAttachDrives(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) case VIR_DOMAIN_DISK_BUS_USB: case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: case VIR_DOMAIN_DISK_BUS_NONE: case VIR_DOMAIN_DISK_BUS_LAST: vboxReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 0dd03c1a88..31878c7399 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -2245,6 +2245,7 @@ virVMXGenerateDiskTarget(virDomainDiskDef *def, case VIR_DOMAIN_DISK_BUS_USB: case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Unsupported bus type '%1$s' for device type '%2$s'"), virDomainDiskBusTypeToString(def->bus), -- 2.11.0

On Sun, Apr 27, 2025 at 19:48:03 +0800, honglei.wang@smartx.com wrote:
From: ray <honglei.wang@smartx.com>
This patch extends the disk bus support by introducing a new nvme-ns bus type.
The nvme-ns bus disk needs to be attached to nvme controller. A controller can contain multiple nvme-ns disk devices.
Signed-off-by: ray <honglei.wang@smartx.com> --- src/conf/domain_conf.c | 39 +++++++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 7 +++++++ src/conf/domain_postparse.c | 2 ++ src/conf/domain_validate.c | 4 +++- src/conf/virconftypes.h | 2 ++ src/hyperv/hyperv_driver.c | 2 ++ src/qemu/qemu_alias.c | 1 + src/qemu/qemu_command.c | 26 ++++++++++++++++++++++++++ src/qemu/qemu_domain_address.c | 5 +++++ src/qemu/qemu_hotplug.c | 14 ++++++++++++-- src/qemu/qemu_postparse.c | 1 + src/qemu/qemu_validate.c | 12 ++++++++++++ src/test/test_driver.c | 2 ++ src/util/virutil.c | 2 +- src/vbox/vbox_common.c | 2 ++ src/vmx/vmx.c | 1 + 16 files changed, 118 insertions(+), 4 deletions(-)
Reviewing this would likely be simpler if addition of the controller was split from the addition of the disk. [...]
@@ -2563,6 +2565,7 @@ virDomainControllerDefNew(virDomainControllerType type) case VIR_DOMAIN_CONTROLLER_TYPE_SATA: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME: case VIR_DOMAIN_CONTROLLER_TYPE_LAST: break; }
[....]
@@ -8832,6 +8845,8 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, int ntargetNodes = 0; g_autofree xmlNodePtr *modelNodes = NULL; int nmodelNodes = 0; + g_autofree xmlNodePtr *serialNodes = NULL; + int nserialNodes = 0; int numaNode = -1; int ports; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -8969,6 +8984,18 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, if (virXMLPropInt(node, "ports", 10, VIR_XML_PROP_NONNEGATIVE, &ports, -1) < 0) return NULL;
+ if ((nserialNodes = virXPathNodeSet("./serial", ctxt, &serialNodes)) > 1) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("Multiple <serial> elements in controller definition not allowed"));
We ususally defer validation of minor infractions such as this to the schema rather than having code for it.
+ return NULL; + } + + if (nserialNodes == 1) { + if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_NVME) {
You have a switch statement checking type right below ...
+ def->opts.nvmeopts.serial = virXMLNodeContentString(serialNodes[0]); + } + } + switch (def->type) { case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL: { if (virXMLPropInt(node, "vectors", 10, VIR_XML_PROP_NONNEGATIVE, @@ -9054,6 +9081,7 @@ virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, case VIR_DOMAIN_CONTROLLER_TYPE_SATA: case VIR_DOMAIN_CONTROLLER_TYPE_CCID: case VIR_DOMAIN_CONTROLLER_TYPE_ISA: + case VIR_DOMAIN_CONTROLLER_TYPE_NVME:
... so remove all of the above for: def->opts.nvmeopts.serial = virXPathString("string(./serial)", ctxt);
case VIR_DOMAIN_CONTROLLER_TYPE_LAST: default: break;
[...]
@@ -24028,6 +24060,12 @@ virDomainControllerDefFormat(virBuffer *buf, } break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_NVME: + if (def->opts.nvmeopts.serial != NULL) { + virBufferAsprintf(&childBuf, "<serial>%s</serial>\n", def->opts.nvmeopts.serial);
User provided strings must be formatted using 'virBufferEscapeString' to ensure proper XML entity escaping. That function also skips the formatting if the string argument is NULL so no check will be needed.
+ } + break; + case VIR_DOMAIN_CONTROLLER_TYPE_PCI: if (virDomainControllerDefFormatPCI(&childBuf, def, flags) < 0) return -1;
[...]
@@ -766,6 +768,10 @@ struct _virDomainXenbusControllerOpts { int maxEventChannels; /* -1 == undef */ };
+struct _virDomainNVMeControllerOpts { + char *serial;
I don't see a corresponding change to free this field so it will likely be leaked.
+}; + /* Stores the virtual disk controller configuration */ struct _virDomainControllerDef { virDomainControllerType type;
[...]
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index d0d4bc0bf4..1ad8350117 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -267,6 +267,7 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SD: case VIR_DOMAIN_DISK_BUS_NONE: + case VIR_DOMAIN_DISK_BUS_NVME_NS:
Since you are using a 'drive' address type here I think this is wrong. As in you know that if the disk is of VIR_DOMAIN_DISK_BUS_NVME_NS type it ought to use the 'drive' address type and thus should be categorized same as SCSI disks.
case VIR_DOMAIN_DISK_BUS_LAST: return true; }
[...]
diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 3e6bced4a8..5cffd9e5c8 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -258,6 +258,7 @@ qemuAssignDeviceDiskAlias(virDomainDef *def, case VIR_DOMAIN_DISK_BUS_IDE: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SCSI: + case VIR_DOMAIN_DISK_BUS_NVME_NS: diskPriv->qomName = g_strdup(disk->info.alias); break;
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index e6d308534f..d5f75fb3f4 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -531,6 +531,17 @@ qemuBuildDeviceAddresDriveProps(virJSONValue *props, }
break; + case VIR_DOMAIN_DISK_BUS_NVME_NS:
Please keep the spacing consistent ...
+ if (!(controllerAlias = virDomainControllerAliasFind(domainDef, + VIR_DOMAIN_CONTROLLER_TYPE_NVME, + info->addr.drive.controller)))
Also the alignment here ..
+ return -1; + + if (virJSONValueObjectAdd(&props, + "s:bus", controllerAlias, + NULL) < 0)
... and here is broken.
+ return -1; + break;
case VIR_DOMAIN_DISK_BUS_VIRTIO: case VIR_DOMAIN_DISK_BUS_USB: @@ -1722,6 +1733,10 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, driver = "floppy"; break;
+ case VIR_DOMAIN_DISK_BUS_NVME_NS: + driver = "nvme-ns"; + break; + case VIR_DOMAIN_DISK_BUS_XEN: case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SD: @@ -2851,6 +2866,16 @@ qemuBuildControllerDevProps(const virDomainDef *domainDef,
break;
+ case VIR_DOMAIN_CONTROLLER_TYPE_NVME: + if (virJSONValueObjectAdd(&props, + "s:driver", "nvme", + "s:id", def->info.alias, + "s:serial", def->opts.nvmeopts.serial,
According to the parser 'serial' seems to be optional. Use of the 's:' converter makes it mandatory. You likely need 'S:' if it's optional.
+ NULL) < 0) + return -1; + + break; + case VIR_DOMAIN_CONTROLLER_TYPE_IDE: case VIR_DOMAIN_CONTROLLER_TYPE_FDC: case VIR_DOMAIN_CONTROLLER_TYPE_XENBUS:
[...]
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5326aba281..844cfc2e02 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -848,7 +848,8 @@ qemuDomainAttachControllerDevice(virDomainObj *vm, bool releaseaddr = false;
if (controller->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI && \ - controller->type != VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) { + controller->type != VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL && \ + controller->type != VIR_DOMAIN_CONTROLLER_TYPE_NVME) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("'%1$s' controller cannot be hot plugged."), virDomainControllerTypeToString(controller->type)); @@ -1058,6 +1059,7 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver, /* Note that SD card hotplug support should be added only once * they support '-device' (don't require -drive only). * See also: qemuDiskBusIsSD */ + case VIR_DOMAIN_DISK_BUS_NVME_NS:
So what is the story regarding hotplug here? I presume that the individual namespace devices need to exist before the controller is attached, right?
case VIR_DOMAIN_DISK_BUS_NONE: case VIR_DOMAIN_DISK_BUS_LAST: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -5782,6 +5784,7 @@ qemuDomainDetachPrepDisk(virDomainObj *vm, case VIR_DOMAIN_DISK_BUS_UML: case VIR_DOMAIN_DISK_BUS_SATA: case VIR_DOMAIN_DISK_BUS_SD: + case VIR_DOMAIN_DISK_BUS_NVME_NS: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("This type of disk cannot be hot unplugged")); return -1;
Hmm, so if you unplug the controller we'd have to remove all the disks. Which IMO could work although IIRC the disk unplug code would not be able to handle this properly yet. Either way it's okay to forbid libvirt-initiated unplug requests. Also guest-initiated unplug requests should be complied with and thus the code for unplug will need to be fixed. Although that is not strictly required for your series because we have the same kind of issue when unplugging SCSI controller. [...]
@@ -5934,7 +5943,8 @@ qemuDomainDetachPrepController(virDomainObj *vm, int idx; virDomainControllerDef *controller = NULL;
- if (match->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { + if (match->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI && + match->type != VIR_DOMAIN_CONTROLLER_TYPE_NVME) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("'%1$s' controller cannot be hot unplugged."), virDomainControllerTypeToString(match->type));
[...]
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index b2c3c9e2f6..9985b2e2c1 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c
[...]
@@ -3194,6 +3196,14 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk,
break;
+ case VIR_DOMAIN_DISK_BUS_NVME_NS: + if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("unexpected address type for nvme-ns disk"));
Based on the error message this is not an _INTERNAL_ERROR, but rather one of those stating that the user messed up with the configuration.
+ return -1; + } + break; + case VIR_DOMAIN_DISK_BUS_XEN: case VIR_DOMAIN_DISK_BUS_SD: case VIR_DOMAIN_DISK_BUS_NONE:
[...]
diff --git a/src/util/virutil.c b/src/util/virutil.c index 2abcb282fe..02494f1061 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -327,7 +327,7 @@ int virDiskNameParse(const char *name, int *disk, int *partition) const char *ptr = NULL; char *rem; int idx = 0; - static char const* const drive_prefix[] = {"fd", "hd", "vd", "sd", "xvd", "ubd"}; + static char const* const drive_prefix[] = {"fd", "hd", "vd", "sd", "xvd", "ubd", "nvmens"};
I'm not sure I like the 'nvmens' prefix. Let's discuss that in the patch adding the XML
size_t i; size_t n_digits;

Thanks a lot for the detailed review and suggestions.
Reviewing this would likely be simpler if addition of the controller was split from the addition of the disk.
Okay, I will split the patch into two parts as suggested—one for introducing the controller and another for the disk.
We ususally defer validation of minor infractions such as this to the schema rather than having code for it.
I will remove the validation logic and keep only the logic for retrieving the 'serial' value.
You have a switch statement checking type right below ...
... so remove all of the above for:
def->opts.nvmeopts.serial = virXPathString("string(./serial)", ctxt);
ACK
User provided strings must be formatted using 'virBufferEscapeString' to ensure proper XML entity escaping. That function also skips the formatting if the string argument is NULL so no check will be needed.
ACK
I don't see a corresponding change to free this field so it will likely be leaked.
That was my oversight—I will make sure to free the memory in virDomainControllerDefFree, and I’ll also check if there are other places where this is needed.
Since you are using a 'drive' address type here I think this is wrong. As in you know that if the disk is of VIR_DOMAIN_DISK_BUS_NVME_NS type it ought to use the 'drive' address type and thus should be categorized same as SCSI disks.
Yes, you're right.
Please keep the spacing consistent ...
Also the alignment here ..
... and here is broken.
ACK
According to the parser 'serial' seems to be optional. Use of the 's:' converter makes it mandatory. You likely need 'S:' if it's optional.
The 'serial' field is required—not optional—because the QEMU implementation mandates its presence.
So what is the story regarding hotplug here? I presume that the individual namespace devices need to exist before the controller is attached, right?
In QEMU, the NVMe controller device supports hotplug, but nvme-ns devices do not, so the current behavior is aligned with QEMU.
Hmm, so if you unplug the controller we'd have to remove all the disks. Which IMO could work although IIRC the disk unplug code would not be able to handle this properly yet.
Either way it's okay to forbid libvirt-initiated unplug requests. Also guest-initiated unplug requests should be complied with and thus the code for unplug will need to be fixed. Although that is not strictly required for your series because we have the same kind of issue when unplugging SCSI controller.
Yes, since nvme-ns devices do not support hot-unplug, controllers with attached namespaces cannot be hot-unplugged either.
Based on the error message this is not an _INTERNAL_ERROR, but rather one of those stating that the user messed up with the configuration.
Yes, we should use VIR_ERR_CONFIG_UNSUPPORTED for this case.
I'm not sure I like the 'nvmens' prefix. Let's discuss that in the patch adding the XML
I agree the nvmens prefix feels a bit odd. Ideally, the naming should resemble something like nvme0n1, but that would introduce more complexity and tightly couple the name to a specific controller. As a compromise, maybe we can use nvme as the prefix. Also, I’d like to discuss whether nvme-ns is the appropriate choice for the disk bus type.

On Fri, May 09, 2025 at 08:32:42 -0000, ray wang wrote:
Thanks a lot for the detailed review and suggestions.
Please for the next time include more context to your replies. I've already forgotten what I was refering to in most contexts that you are replying below so I'll have hard time following up. In general making review harder is detremental to your series because it will take longer.
Reviewing this would likely be simpler if addition of the controller was split from the addition of the disk.
Okay, I will split the patch into two parts as suggested—one for introducing the controller and another for the disk.
We ususally defer validation of minor infractions such as this to the schema rather than having code for it.
I will remove the validation logic and keep only the logic for retrieving the 'serial' value.
[...]
According to the parser 'serial' seems to be optional. Use of the 's:' converter makes it mandatory. You likely need 'S:' if it's optional.
The 'serial' field is required—not optional—because the QEMU implementation mandates its presence.
Okay; you then need a validation check that mandates it.

From: ray <honglei.wang@smartx.com> Signed-off-by: ray <honglei.wang@smartx.com> --- src/qemu/qemu_capabilities.c | 5 +++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_validate.c | 6 ++++++ tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.1.0.sparc.xml | 1 + tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_6.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_7.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.1.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_7.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml | 1 + tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml | 1 + tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_7.2.0.ppc.xml | 1 + tests/domaincapsdata/qemu_7.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_8.2.0.armv7l.xml | 1 + tests/domaincapsdata/qemu_8.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_8.2.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.0.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_9.1.0.s390x.xml | 1 + tests/domaincapsdata/qemu_9.1.0.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml | 1 + tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_9.2.0.s390x.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_9.2.0.x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml | 1 + tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml | 1 + tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 1 + tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 1 + tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml | 1 + tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 1 + tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml | 1 + tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 1 + 96 files changed, 105 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index a804335c85..42e211ce2e 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -732,6 +732,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 475 */ "virtio-scsi.iothread-mapping", /* QEMU_CAPS_VIRTIO_SCSI_IOTHREAD_MAPPING */ + "nvme-ns", /* QEMU_CAPS_DEVICE_NVME_NS */ ); @@ -1419,6 +1420,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "sev-snp-guest", QEMU_CAPS_SEV_SNP_GUEST }, { "acpi-erst", QEMU_CAPS_DEVICE_ACPI_ERST }, { "virtio-mem-ccw", QEMU_CAPS_DEVICE_VIRTIO_MEM_CCW }, + { "nvme-ns", QEMU_CAPS_DEVICE_NVME_NS }, }; @@ -6464,6 +6466,9 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCaps *qemuCaps, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ICH9_AHCI)) VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_SATA); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVME_NS)) + VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_NVME_NS); + /* disk->model values */ VIR_DOMAIN_CAPS_ENUM_SET(disk->model, VIR_DOMAIN_DISK_MODEL_VIRTIO); if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL)) { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ea7c14daa9..f6637abff0 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -713,6 +713,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 475 */ QEMU_CAPS_VIRTIO_SCSI_IOTHREAD_MAPPING, /* virtio-scsi supports per-virtqueue iothread mapping */ + QEMU_CAPS_DEVICE_NVME_NS, /* -device nvme-ns */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 9985b2e2c1..389d0c9fb6 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3197,6 +3197,12 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, break; case VIR_DOMAIN_DISK_BUS_NVME_NS: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_NVME_NS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("This QEMU doesn't support '-device nvme-ns'")); + return -1; + } + if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unexpected address type for nvme-ns disk")); diff --git a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml index b7fa8daa15..1d13979be0 100644 --- a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml @@ -686,6 +686,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml index e1ff01a7a8..df074c987a 100644 --- a/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml @@ -1547,6 +1547,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml index d8a6fe8354..7505b4f064 100644 --- a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml @@ -1655,6 +1655,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml index 3ce5c0c412..4c6daf0595 100644 --- a/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml @@ -1655,6 +1655,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_10.0.0.s390x.xml b/tests/domaincapsdata/qemu_10.0.0.s390x.xml index d66240307e..b228b90adc 100644 --- a/tests/domaincapsdata/qemu_10.0.0.s390x.xml +++ b/tests/domaincapsdata/qemu_10.0.0.s390x.xml @@ -242,6 +242,7 @@ <value>scsi</value> <value>virtio</value> <value>usb</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml b/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml index 1f852adfae..dd189d570f 100644 --- a/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml @@ -686,6 +686,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml b/tests/domaincapsdata/qemu_10.0.0.x86_64.xml index 66c4dfed9f..c2fffc58c1 100644 --- a/tests/domaincapsdata/qemu_10.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_10.0.0.x86_64.xml @@ -1547,6 +1547,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml index a7c2e0baee..a19efb71c6 100644 --- a/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml @@ -98,6 +98,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml index a7c2e0baee..a19efb71c6 100644 --- a/tests/domaincapsdata/qemu_4.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.aarch64.xml @@ -98,6 +98,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml index 2c41777e73..1671ee778f 100644 --- a/tests/domaincapsdata/qemu_4.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_4.2.0.ppc64.xml @@ -64,6 +64,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml b/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml index c487d467ef..4fef30307d 100644 --- a/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml @@ -50,6 +50,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml index 2466dda755..7d66fc54ad 100644 --- a/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml @@ -99,6 +99,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml b/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml index b0e4aafcd5..317c6e45a0 100644 --- a/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml +++ b/tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml @@ -53,6 +53,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml index 2466dda755..7d66fc54ad 100644 --- a/tests/domaincapsdata/qemu_5.0.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.aarch64.xml @@ -99,6 +99,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml index c66d0645fc..a7f238a698 100644 --- a/tests/domaincapsdata/qemu_5.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_5.0.0.ppc64.xml @@ -65,6 +65,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_5.1.0.sparc.xml b/tests/domaincapsdata/qemu_5.1.0.sparc.xml index a471a937d7..4456794588 100644 --- a/tests/domaincapsdata/qemu_5.1.0.sparc.xml +++ b/tests/domaincapsdata/qemu_5.1.0.sparc.xml @@ -51,6 +51,7 @@ <value>fdc</value> <value>scsi</value> <value>virtio</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml index d1a8399812..d9a0873c45 100644 --- a/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-q35.x86_64.xml @@ -1012,6 +1012,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml index 8c8f016233..969d3e9114 100644 --- a/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0-tcg.x86_64.xml @@ -1814,6 +1814,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml index 39b07955dd..789cef7989 100644 --- a/tests/domaincapsdata/qemu_6.2.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.ppc64.xml @@ -65,6 +65,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml index 1f21b8be4e..3cf4e9bd9b 100644 --- a/tests/domaincapsdata/qemu_6.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_6.2.0.x86_64.xml @@ -1012,6 +1012,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml index 8fa50785b7..b7ae9697db 100644 --- a/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-q35.x86_64.xml @@ -1039,6 +1039,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml index 2686989d64..71dc655d8a 100644 --- a/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0-tcg.x86_64.xml @@ -1838,6 +1838,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml index 52c73d10a4..a758dc1cc2 100644 --- a/tests/domaincapsdata/qemu_7.0.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.ppc64.xml @@ -65,6 +65,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml index 6ab3774452..ddfe9e434e 100644 --- a/tests/domaincapsdata/qemu_7.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.0.0.x86_64.xml @@ -1039,6 +1039,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml index 75565c4495..611528d3ef 100644 --- a/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-q35.x86_64.xml @@ -1006,6 +1006,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml index 4e44dbaf65..0aeebfbe7b 100644 --- a/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0-tcg.x86_64.xml @@ -1786,6 +1786,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.1.0.ppc64.xml b/tests/domaincapsdata/qemu_7.1.0.ppc64.xml index ca0bc6f0b5..7f0e0b251d 100644 --- a/tests/domaincapsdata/qemu_7.1.0.ppc64.xml +++ b/tests/domaincapsdata/qemu_7.1.0.ppc64.xml @@ -60,6 +60,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml index 898b081df0..a708397e1d 100644 --- a/tests/domaincapsdata/qemu_7.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.1.0.x86_64.xml @@ -1006,6 +1006,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml b/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml index 0fbbc8118c..664f6a13b0 100644 --- a/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml +++ b/tests/domaincapsdata/qemu_7.2.0-hvf.x86_64+hvf.xml @@ -1011,6 +1011,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml index cfbe7e5dd1..c1bb50ed3d 100644 --- a/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0-q35.x86_64.xml @@ -1011,6 +1011,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml index 805a636ec6..cfd23a7a70 100644 --- a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml +++ b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64+hvf.xml @@ -1491,6 +1491,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml index 805a636ec6..cfd23a7a70 100644 --- a/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0-tcg.x86_64.xml @@ -1491,6 +1491,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.2.0.ppc.xml b/tests/domaincapsdata/qemu_7.2.0.ppc.xml index 21dbe730c5..7469cdf4ec 100644 --- a/tests/domaincapsdata/qemu_7.2.0.ppc.xml +++ b/tests/domaincapsdata/qemu_7.2.0.ppc.xml @@ -54,6 +54,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml b/tests/domaincapsdata/qemu_7.2.0.x86_64.xml index 2b402f59c8..d673f0e971 100644 --- a/tests/domaincapsdata/qemu_7.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_7.2.0.x86_64.xml @@ -1011,6 +1011,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml index c1f7b96465..ebcab29d7e 100644 --- a/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml @@ -1093,6 +1093,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml index 4d8d4c7702..ef63e1dda8 100644 --- a/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml @@ -1586,6 +1586,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml index 7db506386c..128dfdb364 100644 --- a/tests/domaincapsdata/qemu_8.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.0.0.x86_64.xml @@ -1093,6 +1093,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml index 4c9b674c1e..3b10885cf3 100644 --- a/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0-q35.x86_64.xml @@ -1352,6 +1352,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml index 52f0d339bb..ee67c1a1ae 100644 --- a/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0-tcg.x86_64.xml @@ -1608,6 +1608,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml index 8389909b74..94d3cb6315 100644 --- a/tests/domaincapsdata/qemu_8.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.1.0.x86_64.xml @@ -1352,6 +1352,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml index dcb46e06ea..02c22418fd 100644 --- a/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-q35.x86_64.xml @@ -1353,6 +1353,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml b/tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml index 18979cf280..9fbffcc355 100644 --- a/tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-tcg-virt.loongarch64.xml @@ -61,6 +61,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml index fae61e8955..507ac9a29c 100644 --- a/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-tcg.x86_64.xml @@ -1574,6 +1574,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml b/tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml index ce17865e24..312bdab3c9 100644 --- a/tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-virt.aarch64.xml @@ -109,6 +109,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml b/tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml index 8f4ebbc107..fa9c8fe73b 100644 --- a/tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0-virt.loongarch64.xml @@ -65,6 +65,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0.aarch64.xml b/tests/domaincapsdata/qemu_8.2.0.aarch64.xml index ce17865e24..312bdab3c9 100644 --- a/tests/domaincapsdata/qemu_8.2.0.aarch64.xml +++ b/tests/domaincapsdata/qemu_8.2.0.aarch64.xml @@ -109,6 +109,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0.armv7l.xml b/tests/domaincapsdata/qemu_8.2.0.armv7l.xml index ee653c0c49..9170a8de02 100644 --- a/tests/domaincapsdata/qemu_8.2.0.armv7l.xml +++ b/tests/domaincapsdata/qemu_8.2.0.armv7l.xml @@ -58,6 +58,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0.s390x.xml b/tests/domaincapsdata/qemu_8.2.0.s390x.xml index 78f91736d6..7f0dbcf554 100644 --- a/tests/domaincapsdata/qemu_8.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_8.2.0.s390x.xml @@ -331,6 +331,7 @@ <value>scsi</value> <value>virtio</value> <value>usb</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_8.2.0.x86_64.xml b/tests/domaincapsdata/qemu_8.2.0.x86_64.xml index 97b3795b5a..1af27c2f34 100644 --- a/tests/domaincapsdata/qemu_8.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_8.2.0.x86_64.xml @@ -1353,6 +1353,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml index d55bc239a9..d23896b45c 100644 --- a/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0-q35.x86_64.xml @@ -1353,6 +1353,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml index 48300b14f5..cfead94eb8 100644 --- a/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0-tcg.x86_64.xml @@ -1503,6 +1503,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.0.0.x86_64.xml b/tests/domaincapsdata/qemu_9.0.0.x86_64.xml index 52f01a7cfc..e99c98dc33 100644 --- a/tests/domaincapsdata/qemu_9.0.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.0.0.x86_64.xml @@ -1353,6 +1353,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml index 5449244329..299fcb5b26 100644 --- a/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-q35.x86_64.xml @@ -1489,6 +1489,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml b/tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml index b236ecbac4..954d2cfaaf 100644 --- a/tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-tcg-virt.riscv64.xml @@ -71,6 +71,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml index 927a5a6d36..f8fbf0562b 100644 --- a/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-tcg.x86_64.xml @@ -1608,6 +1608,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml b/tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml index 1399b980fd..4bcc70fecc 100644 --- a/tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml +++ b/tests/domaincapsdata/qemu_9.1.0-virt.riscv64.xml @@ -60,6 +60,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.1.0.s390x.xml b/tests/domaincapsdata/qemu_9.1.0.s390x.xml index b73e0d0688..706be59c21 100644 --- a/tests/domaincapsdata/qemu_9.1.0.s390x.xml +++ b/tests/domaincapsdata/qemu_9.1.0.s390x.xml @@ -194,6 +194,7 @@ <value>scsi</value> <value>virtio</value> <value>usb</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.1.0.x86_64.xml b/tests/domaincapsdata/qemu_9.1.0.x86_64.xml index dc2521135c..aecd378356 100644 --- a/tests/domaincapsdata/qemu_9.1.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.1.0.x86_64.xml @@ -1489,6 +1489,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml b/tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml index b8615a0986..0ba77ec33d 100644 --- a/tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml +++ b/tests/domaincapsdata/qemu_9.2.0-hvf.aarch64+hvf.xml @@ -108,6 +108,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml index 62c61b9de5..47ddb957e0 100644 --- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64+amdsev.xml @@ -686,6 +686,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml index 49f5e64bfa..39ff3fad5c 100644 --- a/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0-q35.x86_64.xml @@ -1547,6 +1547,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml index 265680b197..e9a89aea19 100644 --- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64+amdsev.xml @@ -1655,6 +1655,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml index 884228db72..e5faf28e19 100644 --- a/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0-tcg.x86_64.xml @@ -1655,6 +1655,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0.s390x.xml b/tests/domaincapsdata/qemu_9.2.0.s390x.xml index 605a3af5c7..41b4460210 100644 --- a/tests/domaincapsdata/qemu_9.2.0.s390x.xml +++ b/tests/domaincapsdata/qemu_9.2.0.s390x.xml @@ -194,6 +194,7 @@ <value>scsi</value> <value>virtio</value> <value>usb</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml b/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml index ee82f2905b..427b7c6cd6 100644 --- a/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml +++ b/tests/domaincapsdata/qemu_9.2.0.x86_64+amdsev.xml @@ -686,6 +686,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml index d587c1316a..31f30cc339 100644 --- a/tests/domaincapsdata/qemu_9.2.0.x86_64.xml +++ b/tests/domaincapsdata/qemu_9.2.0.x86_64.xml @@ -1547,6 +1547,7 @@ <value>virtio</value> <value>usb</value> <value>sata</value> + <value>nvme-ns</value> </enum> <enum name='model'> <value>virtio</value> diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml index be2e91ed92..42ce599b7f 100644 --- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml @@ -133,6 +133,7 @@ <flag name='migrate-incoming.exit-on-error'/> <flag name='virtio-mem-ccw'/> <flag name='shim'/> + <flag name='nvme-ns'/> <version>9002050</version> <microcodeVersion>39100285</microcodeVersion> <package>v9.2.0-1203-gd6430c17d7</package> diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml index 00afc61a5b..fc98cd9ff6 100644 --- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml +++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml @@ -205,6 +205,7 @@ <flag name='blockdev-set-active'/> <flag name='shim'/> <flag name='virtio-scsi.iothread-mapping'/> + <flag name='nvme-ns'/> <version>10000000</version> <microcodeVersion>43100285</microcodeVersion> <package>v10.0.0</package> diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml index cee4cc3252..3fcd827358 100644 --- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml @@ -204,6 +204,7 @@ <flag name='blockdev-set-active'/> <flag name='shim'/> <flag name='virtio-scsi.iothread-mapping'/> + <flag name='nvme-ns'/> <version>10000000</version> <microcodeVersion>43100285</microcodeVersion> <package>v10.0.0</package> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml b/tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml index f61d2263c7..401a30f6ca 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0_ppc64.xml @@ -130,6 +130,7 @@ <flag name='display-reload'/> <flag name='usb-mtp'/> <flag name='netdev.user'/> + <flag name='nvme-ns'/> <version>6002000</version> <microcodeVersion>42900244</microcodeVersion> <package>v6.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml index e780850c8d..3b6cc0e1a4 100644 --- a/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_6.2.0_x86_64.xml @@ -172,6 +172,7 @@ <flag name='display-reload'/> <flag name='usb-mtp'/> <flag name='netdev.user'/> + <flag name='nvme-ns'/> <version>6002000</version> <microcodeVersion>43100244</microcodeVersion> <package>v6.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml b/tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml index d78c239372..08dbb6c09a 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_ppc64.xml @@ -149,6 +149,7 @@ <flag name='usb-mtp'/> <flag name='netdev.user'/> <flag name='acpi-erst'/> + <flag name='nvme-ns'/> <version>7000000</version> <microcodeVersion>42900243</microcodeVersion> <package>v7.0.0</package> diff --git a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml index f8fab98961..3667892751 100644 --- a/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.0.0_x86_64.xml @@ -180,6 +180,7 @@ <flag name='netdev.user'/> <flag name='acpi-erst'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>7000000</version> <microcodeVersion>43100243</microcodeVersion> <package>v7.0.0</package> diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml b/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml index d6edb65e96..9e9ce9f0bc 100644 --- a/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml @@ -150,6 +150,7 @@ <flag name='usb-mtp'/> <flag name='netdev.user'/> <flag name='acpi-erst'/> + <flag name='nvme-ns'/> <version>7001000</version> <microcodeVersion>42900244</microcodeVersion> <package>v7.1.0</package> diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml index 17c662421d..23494272bb 100644 --- a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml @@ -185,6 +185,7 @@ <flag name='acpi-erst'/> <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>7001000</version> <microcodeVersion>43100244</microcodeVersion> <package>v7.1.0</package> diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml b/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml index fe318e0a52..2dcb0e0dba 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml @@ -145,6 +145,7 @@ <flag name='usb-mtp'/> <flag name='netdev.user'/> <flag name='acpi-erst'/> + <flag name='nvme-ns'/> <version>7002000</version> <microcodeVersion>0</microcodeVersion> <package>qemu-7.2.0-6.fc37</package> diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml index 0dd9d60be3..4f94e7f0f0 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml @@ -189,6 +189,7 @@ <flag name='acpi-erst'/> <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>7002000</version> <microcodeVersion>43100245</microcodeVersion> <package>v7.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml index 1f526ebc54..0bac037bc7 100644 --- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml @@ -189,6 +189,7 @@ <flag name='acpi-erst'/> <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>7002000</version> <microcodeVersion>43100245</microcodeVersion> <package>v7.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml index 44ff63d236..c20a49aab4 100644 --- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml @@ -193,6 +193,7 @@ <flag name='acpi-erst'/> <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>8000000</version> <microcodeVersion>43100244</microcodeVersion> <package>v8.0.0</package> diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml index eee166b1ea..00eaa2e321 100644 --- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml @@ -195,6 +195,7 @@ <flag name='acpi-erst'/> <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>8001000</version> <microcodeVersion>43100245</microcodeVersion> <package>v8.1.0</package> diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml index 837502c336..5c73dce2bf 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml @@ -160,6 +160,7 @@ <flag name='virtio-sound'/> <flag name='netdev.user'/> <flag name='acpi-erst'/> + <flag name='nvme-ns'/> <version>8002000</version> <microcodeVersion>61700246</microcodeVersion> <package>v8.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml b/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml index f062f31abc..a4bada05bc 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml @@ -167,6 +167,7 @@ <flag name='virtio-sound'/> <flag name='netdev.user'/> <flag name='acpi-erst'/> + <flag name='nvme-ns'/> <version>8002000</version> <microcodeVersion>0</microcodeVersion> <package>qemu-8.2.0-7.fc39</package> diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml index 2a37631381..9972f987f0 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml @@ -150,6 +150,7 @@ <flag name='virtio-sound'/> <flag name='netdev.user'/> <flag name='acpi-erst'/> + <flag name='nvme-ns'/> <version>8002000</version> <microcodeVersion>106300246</microcodeVersion> <package>v8.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml index 086fa2c715..ced9b96b09 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml @@ -114,6 +114,7 @@ <flag name='usb-mtp'/> <flag name='virtio-sound'/> <flag name='netdev.user'/> + <flag name='nvme-ns'/> <version>8002000</version> <microcodeVersion>39100246</microcodeVersion> <package>v8.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml index 3f8fa926c8..fba540a323 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml @@ -198,6 +198,7 @@ <flag name='acpi-erst'/> <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>8002000</version> <microcodeVersion>43100246</microcodeVersion> <package>v8.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml index 7824fd3f5e..ed3e682415 100644 --- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml @@ -200,6 +200,7 @@ <flag name='acpi-erst'/> <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> + <flag name='nvme-ns'/> <version>9000000</version> <microcodeVersion>43100245</microcodeVersion> <package>v9.0.0</package> diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml index 3b1445718a..edb2afc2bd 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml @@ -160,6 +160,7 @@ <flag name='acpi-erst'/> <flag name='migrate-incoming.exit-on-error'/> <flag name='machine.virt.aia'/> + <flag name='nvme-ns'/> <version>9001000</version> <microcodeVersion>0</microcodeVersion> <package>v9.1.0</package> diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml index 0d566d13d5..b0ba610ceb 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml @@ -125,6 +125,7 @@ <flag name='netdev.user'/> <flag name='query-cpu-model-expansion.deprecated-props'/> <flag name='migrate-incoming.exit-on-error'/> + <flag name='nvme-ns'/> <version>9001000</version> <microcodeVersion>39100246</microcodeVersion> <package>v9.1.0</package> diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml index f2207ee5e3..48cc6fca8c 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml @@ -199,6 +199,7 @@ <flag name='intel-iommu.dma-translation'/> <flag name='machine-i8042-opt'/> <flag name='migrate-incoming.exit-on-error'/> + <flag name='nvme-ns'/> <version>9001000</version> <microcodeVersion>43100246</microcodeVersion> <package>v9.1.0</package> diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml b/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml index ac25159eff..55a57d7659 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml @@ -133,6 +133,7 @@ <flag name='chardev-reconnect-miliseconds'/> <flag name='netdev-stream-reconnect-miliseconds'/> <flag name='migrate-incoming.exit-on-error'/> + <flag name='nvme-ns'/> <version>9002002</version> <microcodeVersion>61700247</microcodeVersion> <package></package> diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml index e1323f9b72..0ee0a16ae8 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml @@ -128,6 +128,7 @@ <flag name='netdev-stream-reconnect-miliseconds'/> <flag name='query-cpu-model-expansion.deprecated-props'/> <flag name='migrate-incoming.exit-on-error'/> + <flag name='nvme-ns'/> <version>9002000</version> <microcodeVersion>39100247</microcodeVersion> <package>v9.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml index 7f6316941b..e95a6d042a 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml @@ -203,6 +203,7 @@ <flag name='chardev-reconnect-miliseconds'/> <flag name='netdev-stream-reconnect-miliseconds'/> <flag name='migrate-incoming.exit-on-error'/> + <flag name='nvme-ns'/> <version>9002000</version> <microcodeVersion>43100247</microcodeVersion> <package>v9.2.0</package> diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml index 12d1928bb7..aa7b880e8b 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml @@ -201,6 +201,7 @@ <flag name='chardev-reconnect-miliseconds'/> <flag name='netdev-stream-reconnect-miliseconds'/> <flag name='migrate-incoming.exit-on-error'/> + <flag name='nvme-ns'/> <version>9002000</version> <microcodeVersion>43100247</microcodeVersion> <package>v9.2.0</package> -- 2.11.0

On Sun, Apr 27, 2025 at 19:48:04 +0800, honglei.wang@smartx.com wrote:
From: ray <honglei.wang@smartx.com>
Signed-off-by: ray <honglei.wang@smartx.com> ---
Generally patches adding a capability flag should only add the capability flag. Thus you'll need to split this patch. 1) capability addition - move it ahead to the beginning of the series (doing that will allow you to do capability checks when adding the code instead when adding the capability - note the full flag name (QEMU_CAPS...) in the summary line of the commit message 2) domain caps addition - that ought to be done after the code addition is compelete, thus after you add the XML schema bits and implementation
src/qemu/qemu_capabilities.c | 5 +++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_validate.c | 6 ++++++
tests/domaincapsdata/qemu_10.0.0-q35.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-q35.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0-tcg.x86_64.xml | 1 + tests/domaincapsdata/qemu_10.0.0.s390x.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64+amdsev.xml | 1 + tests/domaincapsdata/qemu_10.0.0.x86_64.xml | 1 +
tests/domaincapsdata/qemu_4.2.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_4.2.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-tcg-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-virt.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0-virt.riscv64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.aarch64.xml | 1 + tests/domaincapsdata/qemu_5.0.0.ppc64.xml | 1 + tests/domaincapsdata/qemu_5.1.0.sparc.xml | 1 +
All of the above is suspicious. The test files were forgotten after we dropped support for the qemu versions mentioned in them. How did you modify these? Interestingly there are more of the files for unsupported versions but you didnt modify all of them. Anyways I'll send a patch deleting those. The rest of the patch looks good but most of the code additions will need to be moved to corresponding patches.

Generally patches adding a capability flag should only add the capability flag. Thus you'll need to split this patch.
1) capability addition - move it ahead to the beginning of the series (doing that will allow you to do capability checks when adding the code instead when adding the capability - note the full flag name (QEMU_CAPS...) in the summary line of the commit message 2) domain caps addition - that ought to be done after the code addition is compelete, thus after you add the XML schema bits and implementation
Okay, that's a very reasonable suggestion.
All of the above is suspicious. The test files were forgotten after we dropped support for the qemu versions mentioned in them. How did you modify these?
Interestingly there are more of the files for unsupported versions but you didnt modify all of them.
Anyways I'll send a patch deleting those.
Modifying these test files is necessary to ensure the correctness of the unit tests. The changes I made were based on the feedback from the unit tests :) I've seen your patch that removes the deprecated XML—great job! I’ll rebase my patch on top of it, but the other XML test files still need to be updated to include the nvme-ns related content.

On Fri, May 09, 2025 at 08:34:42 -0000, ray wang wrote:
Generally patches adding a capability flag should only add the capability flag. Thus you'll need to split this patch.
1) capability addition - move it ahead to the beginning of the series (doing that will allow you to do capability checks when adding the code instead when adding the capability - note the full flag name (QEMU_CAPS...) in the summary line of the commit message 2) domain caps addition - that ought to be done after the code addition is compelete, thus after you add the XML schema bits and implementation
Okay, that's a very reasonable suggestion.
That is actually a requirement. Patch adding capability flags is kept clean and minimal in cases when it needs to be backported as it greatly simplifies that work.
All of the above is suspicious. The test files were forgotten after we dropped support for the qemu versions mentioned in them. How did you modify these?
Interestingly there are more of the files for unsupported versions but you didnt modify all of them.
Anyways I'll send a patch deleting those.
Modifying these test files is necessary to ensure the correctness of the unit tests.
In the context you trimmed I was refering to test files which were not actually used by unit tests. Thus while your changes were most likely correct (we can't know because the the files were not used) it was suspicious to me that you've modified them because they would not cause a test failure.
The changes I made were based on the feedback from the unit tests :)
I've seen your patch that removes the deprecated XML—great job! I’ll rebase my patch on top of it, but the other XML test files still need to be updated to include the nvme-ns related content.
Sure but those are in fact checked against the existing test data so it is needed and I didn't object to any of that. Rebasing on top of the current tree and thus dropping the modifications to the unused files will satisfy my comment.

From: ray <honglei.wang@smartx.com> Signed-off-by: ray <honglei.wang@smartx.com> --- src/conf/schemas/domaincommon.rng | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng index 5597d5a66b..7bdad3c793 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -2518,7 +2518,7 @@ <define name="diskTargetDev"> <data type="string"> - <param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd)[a-zA-Z0-9_]+</param> + <param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd|nvmens)[a-zA-Z0-9_]+</param> </data> </define> @@ -2539,6 +2539,7 @@ <value>uml</value> <!-- NOT USED ANYMORE --> <value>sata</value> <value>sd</value> + <value>nvme-ns</value> </choice> </attribute> </optional> @@ -3044,6 +3045,14 @@ </attribute> </optional> </group> + <group> + <attribute name="type"> + <value>nvme</value> + </attribute> + <element name="serial"> + <ref name="diskSerial"/> + </element> + </group> </choice> <optional> <element name="driver"> -- 2.11.0

On Sun, Apr 27, 2025 at 19:48:05 +0800, honglei.wang@smartx.com wrote:
From: ray <honglei.wang@smartx.com>
Signed-off-by: ray <honglei.wang@smartx.com> --- src/conf/schemas/domaincommon.rng | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng index 5597d5a66b..7bdad3c793 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -2518,7 +2518,7 @@
<define name="diskTargetDev"> <data type="string"> - <param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd)[a-zA-Z0-9_]+</param> + <param name="pattern">(ioemu:)?(fd|hd|sd|vd|xvd|ubd|nvmens)[a-zA-Z0-9_]+</param> </data> </define>
@@ -2539,6 +2539,7 @@ <value>uml</value> <!-- NOT USED ANYMORE --> <value>sata</value> <value>sd</value> + <value>nvme-ns</value> </choice> </attribute> </optional> @@ -3044,6 +3045,14 @@ </attribute> </optional> </group> + <group> + <attribute name="type"> + <value>nvme</value> + </attribute> + <element name="serial"> + <ref name="diskSerial"/> + </element>
So here the 'serial' is declared as mandatory. It's optional in the XML parser/formatter and mandatory in the commandline formatter. With other devices it's optional so it's most likely going to need an <optional> block. This series is also completely lacking documentation (docs/formatdomain.rst) documenting bot the new controller and disk type.

So here the 'serial' is declared as mandatory. It's optional in the XML parser/formatter and mandatory in the commandline formatter. With other devices it's optional so it's most likely going to need an <optional> block.
This series is also completely lacking documentation (docs/formatdomain.rst) documenting bot the new controller and disk type.
As described earlier, the intention is for the serial field to be mandatory. Perhaps the parser/formatter handling led to some confusion? Any suggestions are very welcome. I'll add documentation for it in docs/formatdomain.rst.

On Fri, May 09, 2025 at 08:38:43 -0000, ray wang wrote:
So here the 'serial' is declared as mandatory. It's optional in the XML parser/formatter and mandatory in the commandline formatter. With other devices it's optional so it's most likely going to need an <optional> block.
This series is also completely lacking documentation (docs/formatdomain.rst) documenting bot the new controller and disk type.
As described earlier, the intention is for the serial field to be mandatory. Perhaps the parser/formatter handling led to some confusion? Any suggestions are very welcome. I'll add documentation for it in docs/formatdomain.rst.
It was unclear due to the discrepancies in the code and the lacking documentation couldn't explain it. It's okay if you need to make it mandatory, in which case add a validation check (src/qemu/qemu_validate.c) reporting a user-friendly error.

From: ray <honglei.wang@smartx.com> Signed-off-by: ray <honglei.wang@smartx.com> --- .../disk-nvme-ns-device.x86_64-latest.args | 36 +++++++++++++++++++ .../disk-nvme-ns-device.x86_64-latest.xml | 42 ++++++++++++++++++++++ tests/qemuxmlconfdata/disk-nvme-ns-device.xml | 41 +++++++++++++++++++++ tests/qemuxmlconftest.c | 1 + 4 files changed, 120 insertions(+) create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.xml diff --git a/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args b/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args new file mode 100644 index 0000000000..d5971a4407 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args @@ -0,0 +1,36 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \ +-accel tcg \ +-cpu qemu64 \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ +-device '{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x3"}' \ +-device '{"driver":"nvme","id":"nvme0","serial":"nvme-controller-abcdef","bus":"pci.0","addr":"0x5"}' \ +-blockdev '{"driver":"file","filename":"/tmp/data-1.img","node-name":"libvirt-1-storage","read-only":false}' \ +-device '{"driver":"nvme-ns","bus":"nvme0","drive":"libvirt-1-storage","id":"nvme-ns0-0-0","bootindex":1}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.xml b/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.xml new file mode 100644 index 0000000000..6074ede8fd --- /dev/null +++ b/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.xml @@ -0,0 +1,42 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='/tmp/data-1.img'/> + <target dev='nvmensa' bus='nvme-ns'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </controller> + <controller type='nvme' index='0'> + <serial>nvme-controller-abcdef</serial> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/disk-nvme-ns-device.xml b/tests/qemuxmlconfdata/disk-nvme-ns-device.xml new file mode 100644 index 0000000000..88bb5956e5 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-nvme-ns-device.xml @@ -0,0 +1,41 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <source file='/tmp/data-1.img'/> + <target dev='nvmensa' bus='nvme-ns'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </controller> + <controller type='nvme' index='0'> + <serial>nvme-controller-abcdef</serial> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </controller> + <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain> diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index be2fba9e4d..580860835b 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -1606,6 +1606,7 @@ mymain(void) DO_TEST_CAPS_LATEST("disk-network-ssh"); DO_TEST_CAPS_LATEST("disk-no-boot"); DO_TEST_CAPS_LATEST("disk-nvme"); + DO_TEST_CAPS_LATEST("disk-nvme-ns-device"); DO_TEST_CAPS_LATEST("disk-vhostuser-numa"); DO_TEST_CAPS_LATEST("disk-vhostuser"); DO_TEST_CAPS_ARCH_LATEST_FULL("disk-vhostvdpa", "x86_64", -- 2.11.0

On Sun, Apr 27, 2025 at 19:48:06 +0800, honglei.wang@smartx.com wrote:
From: ray <honglei.wang@smartx.com>
Signed-off-by: ray <honglei.wang@smartx.com> --- .../disk-nvme-ns-device.x86_64-latest.args | 36 +++++++++++++++++++ .../disk-nvme-ns-device.x86_64-latest.xml | 42 ++++++++++++++++++++++ tests/qemuxmlconfdata/disk-nvme-ns-device.xml | 41 +++++++++++++++++++++ tests/qemuxmlconftest.c | 1 + 4 files changed, 120 insertions(+) create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/disk-nvme-ns-device.xml
diff --git a/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args b/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args new file mode 100644 index 0000000000..d5971a4407 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-nvme-ns-device.x86_64-latest.args @@ -0,0 +1,36 @@
[...]
+-device '{"driver":"nvme","id":"nvme0","serial":"nvme-controller-abcdef","bus":"pci.0","addr":"0x5"}' \ +-blockdev '{"driver":"file","filename":"/tmp/data-1.img","node-name":"libvirt-1-storage","read-only":false}' \ +-device '{"driver":"nvme-ns","bus":"nvme0","drive":"libvirt-1-storage","id":"nvme-ns0-0-0","bootindex":1}' \
Hmm, does bootindex even work here? Shouldn't the bootindex apply to the controller instead? [...]
diff --git a/tests/qemuxmlconfdata/disk-nvme-ns-device.xml b/tests/qemuxmlconfdata/disk-nvme-ns-device.xml new file mode 100644 index 0000000000..88bb5956e5 --- /dev/null +++ b/tests/qemuxmlconfdata/disk-nvme-ns-device.xml @@ -0,0 +1,41 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='x86_64' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu64</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-x86_64</emulator> + <disk type='file' device='disk'> + <source file='/tmp/data-1.img'/> + <target dev='nvmensa' bus='nvme-ns'/>
So since the controller type is 'nvme' the value of 'bus' ought to be 'nvme' as well instead of 'nvme-ns'. Same way as we have with 'scsi'. I also thing that the prefix of dev should be just 'nvme'. Note that the dev prefix is a libvirt identifier which may (and in this case will not) be same as in the guest. Also since the controller supports multiple namespaces please add an example which does so.
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='usb' index='0' model='piix3-uhci'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> + </controller> + <controller type='pci' index='0' model='pci-root'/> + <controller type='scsi' index='0' model='virtio-scsi'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> + </controller> + <controller type='nvme' index='0'> + <serial>nvme-controller-abcdef</serial>
[1] Indentation of the XML is incorrect here.
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </controller>
Also since multiple nvme controllers are possible please add an example without serial. As noted above at least one of the examples ought to have multiple namespaces to show the setup.
+ <input type='mouse' bus='ps2'/> + <input type='keyboard' bus='ps2'/> + <audio id='1' type='none'/> + <memballoon model='none'/> + </devices> +</domain>

Hmm, does bootindex even work here? Shouldn't the bootindex apply to the controller instead?
Both nvme and nvme-ns devices can have bootindex specified, and the corresponding fw_cfg entries will be generated. I think it's more appropriate for us to specify the boot order at the disk level in libvirt, just like the original design.
So since the controller type is 'nvme' the value of 'bus' ought to be 'nvme' as well instead of 'nvme-ns'. Same way as we have with 'scsi'.
I also thing that the prefix of dev should be just 'nvme'. Note that the dev prefix is a libvirt identifier which may (and in this case will not) be same as in the guest.
I'm fine with changing the bus naming to use nvme. As for the dev prefix, let's discuss that in Martin Kletzander's thread.
Also since the controller supports multiple namespaces please add an example which does so.
[1]
Indentation of the XML is incorrect here.
Also since multiple nvme controllers are possible please add an example without serial. As noted above at least one of the examples ought to have multiple namespaces to show the setup.
OK, I will add the corresponding configuration.

From: ray <honglei.wang@smartx.com> Signed-off-by: ray <honglei.wang@smartx.com> --- NEWS.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 3c13a84a1b..938c9ba559 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -38,6 +38,23 @@ v11.3.0 (unreleased) At the moment it doesn't provide any new features compared to ``<interface type='bridge'>``, but allows a more flexible configuration. + * qemu: Support emulated NVMe disks with other storage backends + + Domain XMLs can now include emulated NVMe disks backed by other storage + backends such as file. + They are configured with:: + + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='/tmp/data.img'/> + <target dev='nvmensa' bus='nvme-ns'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='nvme' index='0'> + <serial>nvme-controller-serial-value</serial> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </controller> + * **Improvements** * **Bug fixes** -- 2.11.0

On Sun, Apr 27, 2025 at 19:48:07 +0800, honglei.wang@smartx.com wrote:
From: ray <honglei.wang@smartx.com>
Signed-off-by: ray <honglei.wang@smartx.com> --- NEWS.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst index 3c13a84a1b..938c9ba559 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -38,6 +38,23 @@ v11.3.0 (unreleased) At the moment it doesn't provide any new features compared to ``<interface type='bridge'>``, but allows a more flexible configuration.
+ * qemu: Support emulated NVMe disks with other storage backends + + Domain XMLs can now include emulated NVMe disks backed by other storage + backends such as file. + They are configured with:: + + <disk type='file' device='disk'> + <driver name='qemu' type='raw'/> + <source file='/tmp/data.img'/> + <target dev='nvmensa' bus='nvme-ns'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='nvme' index='0'> + <serial>nvme-controller-serial-value</serial> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </controller> +
Don't forget to move this to the 11.4 section. the 11.3 release is already in freeze.

On Sun, Apr 27, 2025 at 07:48:02PM +0800, honglei.wang@smartx.com wrote:
From: hongleiwang <honglei.wang@smartx.com>
QEMU has supported nvme disk emulation for a long time, see: https://qemu-project.gitlab.io/qemu/system/devices/nvme.html.
The following patches introduce nvme-ns disk bus type:
Thanks for the v2. I have some suggestions which I'd like some more feedback on, which might be controversial, hence the added Cc's for people who replied to any of the versions.
A disk with nvme-ns as bus is represented as an nvme namespace and needs to be attached to an nvme controller. In XML, it can be used like this: <devices> ... <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/data.img'/> <target dev='nvmensa' bus='nvme-ns'/>
Since we're not using the bus='nvme', what if we abandoned the qemu naming and not specify the -ns; on top of that it would be nicer to have the device naming same as it actually happens on Linux. That is kind of biased, but we already do that for other disk types. The above would then become: <target dev='nvme0n1' bus='nvme'/> Because that means a slightly bigger change to how we do things currently (bunch of the code depends on the original numbering) I'd be willing to submit the XML part of this series with that change. One of the reasons is that I also need it for support in a different driver. Let me know what you think. Martin

On Wed, May 07, 2025 at 15:56:52 +0200, Martin Kletzander wrote:
On Sun, Apr 27, 2025 at 07:48:02PM +0800, honglei.wang@smartx.com wrote:
From: hongleiwang <honglei.wang@smartx.com>
QEMU has supported nvme disk emulation for a long time, see: https://qemu-project.gitlab.io/qemu/system/devices/nvme.html.
The following patches introduce nvme-ns disk bus type:
Thanks for the v2. I have some suggestions which I'd like some more feedback on, which might be controversial, hence the added Cc's for people who replied to any of the versions.
A disk with nvme-ns as bus is represented as an nvme namespace and needs to be attached to an nvme controller. In XML, it can be used like this: <devices> ... <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/data.img'/> <target dev='nvmensa' bus='nvme-ns'/>
Since we're not using the bus='nvme', what if we abandoned the qemu naming and not specify the -ns; on top of that it would be nicer to have the device naming same as it actually happens on Linux. That is kind of biased, but we already do that for other disk types.
Keep in mind that we explicitly document that 'dev' may not match what the device becomes in the guest ...
The above would then become:
<target dev='nvme0n1' bus='nvme'/>
... in this case it could be more problematic because the disk target/dev doesn't force you to put nvme0n1 and nvme0n2 on the same controller nor does the namespace bit need to correspond to the namespace id. Yes it is true that with other buses you still can mix stuff up if you configure it explicitly.
Because that means a slightly bigger change to how we do things currently (bunch of the code depends on the original numbering) I'd be willing to submit the XML part of this series with that change. One of the reasons is that I also need it for support in a different driver.
I guess that is fair. I still think that just doing 'nvmea', 'nvmeb', 'nvmec' etc should be sufficient here, but the code already has provisions for partition numbers so this shouldn't be much different.

On Wed, May 07, 2025 at 04:43:29PM +0200, Peter Krempa wrote:
On Wed, May 07, 2025 at 15:56:52 +0200, Martin Kletzander wrote:
On Sun, Apr 27, 2025 at 07:48:02PM +0800, honglei.wang@smartx.com wrote:
From: hongleiwang <honglei.wang@smartx.com>
QEMU has supported nvme disk emulation for a long time, see: https://qemu-project.gitlab.io/qemu/system/devices/nvme.html.
The following patches introduce nvme-ns disk bus type:
Thanks for the v2. I have some suggestions which I'd like some more feedback on, which might be controversial, hence the added Cc's for people who replied to any of the versions.
A disk with nvme-ns as bus is represented as an nvme namespace and needs to be attached to an nvme controller. In XML, it can be used like this: <devices> ... <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/data.img'/> <target dev='nvmensa' bus='nvme-ns'/>
Since we're not using the bus='nvme', what if we abandoned the qemu naming and not specify the -ns; on top of that it would be nicer to have the device naming same as it actually happens on Linux. That is kind of biased, but we already do that for other disk types.
Keep in mind that we explicitly document that 'dev' may not match what the device becomes in the guest ...
Yes, I meant "naming it the same way" but specifically not "guaranteeing it will match" =)
The above would then become:
<target dev='nvme0n1' bus='nvme'/>
... in this case it could be more problematic because the disk target/dev doesn't force you to put nvme0n1 and nvme0n2 on the same controller nor does the namespace bit need to correspond to the namespace id.
It does not, but I see our dev= naming as a shortcut for assigning addresses. Of course, that might be a very biased view due to knowing how the code handles that, but still, the expectation should not be any different to the expectation of what happens when you use dev='vdzz'.
Yes it is true that with other buses you still can mix stuff up if you configure it explicitly.
Because that means a slightly bigger change to how we do things currently (bunch of the code depends on the original numbering) I'd be willing to submit the XML part of this series with that change. One of the reasons is that I also need it for support in a different driver.
I guess that is fair. I still think that just doing 'nvmea', 'nvmeb', 'nvmec' etc should be sufficient here, but the code already has provisions for partition numbers so this shouldn't be much different.
The part of the code that needs changing to accommodate the nvme handling would basically be special-cased with a is_this_nvme() condition, but I, personally, see "nvme3n3" as an improvement compared to "nvmeadr". OTOH I'm fine with both because how often will I have to type it manually...

Ideally, we should use names like nvme0n1, which follow the typical naming convention for NVMe devices (even if they don't necessarily match the actual device names inside the guest). However, using this approach in libvirt would tightly couple the device name with the controller relationship, meaning we'd need to handle the corresponding logic. If we can implement that logic, it would be the best outcome, allowing us to adopt the more familiar and user-friendly nvme0n1 style. On the other hand, if we’re okay with using names that don't match the usual convention (nvme0n1), then I think nvme is a more appropriate and concise naming choice. This approach would simplify the handling logic. I think we can evaluate the complexity of implementing the nvme0n1 format. If the scope of changes is acceptable, adopting this format would be more user-friendly.
participants (4)
-
honglei.wang@smartx.com
-
Martin Kletzander
-
Peter Krempa
-
ray wang