]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Assume QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 3 Nov 2022 15:24:49 +0000 (16:24 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Nov 2022 14:27:43 +0000 (15:27 +0100)
Introduced in QEMU's commit of v2.12.0-rc0~148^2~4 the .align
attribute of memory-backend-file is always available for all QEMU
versions we support (4.2.0, currently). Therefore, we can assume
the capability is always set and thus doesn't need to be checked
for.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_command.c

index 395b2e0a8f1d37ec9b24a4b52af40218271d3364..256ef4912cc56911222f4e040b88c6deef52884e 100644 (file)
@@ -3410,16 +3410,8 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps,
     if (virJSONValueObjectAdd(&props, "U:size", mem->size * 1024, NULL) < 0)
         return -1;
 
-    if (mem->alignsize) {
-        if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN)) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
-                           _("nvdimm align property is not available "
-                             "with this QEMU binary"));
-            return -1;
-        }
-        if (virJSONValueObjectAdd(&props, "U:align", mem->alignsize * 1024, NULL) < 0)
-            return -1;
-    }
+    if (virJSONValueObjectAdd(&props, "P:align", mem->alignsize * 1024, NULL) < 0)
+        return -1;
 
     if (mem->nvdimmPmem) {
         if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE_PMEM)) {