1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

qemu: Assume QEMU_CAPS_OBJECT_MEMORY_FILE_ALIGN

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>
This commit is contained in:
Michal Privoznik 2022-11-03 16:24:49 +01:00
parent 536f561d13
commit 8d5c564622

View 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)) {