]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Create base hugepages path on memory hotplug
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 11 Oct 2022 14:48:38 +0000 (16:48 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 17 Oct 2022 06:40:58 +0000 (08:40 +0200)
Users can play all sorts of games with mount points. For
instance, they can unmount and mount back a hugetlbfs and only
after that attempt to hotplug memory.

This has an unfortunate consequence though. During memory
hotplug, when qemuProcessBuildDestroyMemoryPaths() is called the
path is created with very restrictive mode (0700) because under
the hood g_mkdir_with_parents(path, 0700) is called.

Therefore, create the driver generic portion of the path
separately.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2134009
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/qemu/qemu_process.c

index e6fd9395dea75e916c09747f7ac0bab03b57c0ea..1a9175f40ffec0d63f582d7ed96cdb9aa3a84a1a 100644 (file)
@@ -4015,6 +4015,10 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *driver,
             if (!path)
                 return -1;
 
+            if (build &&
+                qemuHugepageMakeBasedir(driver, &cfg->hugetlbfs[i]) < 0)
+                return -1;
+
             if (qemuProcessBuildDestroyMemoryPathsImpl(driver, vm,
                                                        path, build) < 0)
                 return -1;