mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemuBuildMemoryBackendProps: Prealloc mem for memfd backend
If a domain was using hugepages through memory-backend-file or via -mem-path, we would turn prealloc on. But we are not doing that for memory-backend-memfd. Fix this, because we need QEMU to fully allocate hugepages. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
0217c5a6b4
commit
a658a4bdf7
@ -3098,10 +3098,13 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps,
|
||||
if (def->mem.source == VIR_DOMAIN_MEMORY_SOURCE_MEMFD) {
|
||||
backendType = "memory-backend-memfd";
|
||||
|
||||
if (useHugepage &&
|
||||
(virJSONValueObjectAdd(props, "b:hugetlb", useHugepage, NULL) < 0 ||
|
||||
virJSONValueObjectAdd(props, "U:hugetlbsize", pagesize << 10, NULL) < 0)) {
|
||||
return -1;
|
||||
if (useHugepage) {
|
||||
if (virJSONValueObjectAdd(props, "b:hugetlb", useHugepage, NULL) < 0 ||
|
||||
virJSONValueObjectAdd(props, "U:hugetlbsize", pagesize << 10, NULL) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
prealloc = true;
|
||||
}
|
||||
|
||||
if (qemuBuildMemoryBackendPropsShare(props, memAccess) < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user