]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Add check for needed paths for memory devices
authorKristina Hanicova <khanicov@redhat.com>
Thu, 20 May 2021 14:29:05 +0000 (16:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 21 May 2021 06:51:11 +0000 (08:51 +0200)
When building a commandline for a DIMM memory device with
non-default access mode, the qemuBuildMemoryBackendProps() will
tell QEMU to allocate memory from per-domain memory backing dir.
But later, when preparing the host, the
qemuProcessNeedMemoryBackingPath() does not check for memory
devices at all resulting in per-domain memory backing dir not
being created which upsets QEMU.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1961114

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c

index b69a9d1927d0b818ad738b59c890eacf798b5c3a..35213f81ec4e70a3dabbf9103a518fdf03fcf4b3 100644 (file)
@@ -3938,6 +3938,11 @@ qemuProcessNeedMemoryBackingPath(virDomainDef *def,
             return true;
     }
 
+    for (i = 0; i < def->nmems; i++) {
+        if (def->mems[i]->access != VIR_DOMAIN_MEMORY_ACCESS_DEFAULT)
+            return true;
+    }
+
     if (mem) {
         switch (mem->model) {
         case VIR_DOMAIN_MEMORY_MODEL_DIMM: