File 75a4e016-qemu-validate-prealloc-threads.patch of Package libvirt
xxxxxxxxxx
1
commit 75a4e0165ef199809974e97b507d3953e1de01d1
2
Author: Michal Prívozník <mprivozn@redhat.com>
3
Date: Mon Mar 21 17:09:40 2022 +0100
4
5
qemu_validate: Validate prealloc threads against qemuCpas
6
7
Only fairly new QEMUs are capable of user provided number of
8
preallocation threads. Validate this assumption.
9
10
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
12
13
Index: libvirt-7.1.0/src/qemu/qemu_validate.c
14
===================================================================
15
--- libvirt-7.1.0.orig/src/qemu/qemu_validate.c
16
+++ libvirt-7.1.0/src/qemu/qemu_validate.c
17
18
return -1;
19
}
20
21
+ if (mem->allocation_threads > 0 &&
22
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_MEMORY_BACKEND_PREALLOC_THREADS)) {
23
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
24
+ _("preallocation threads are unsupported with this QEMU"));
25
+ return -1;
26
+ }
27
+
28
if (mem->source == VIR_DOMAIN_MEMORY_SOURCE_ANONYMOUS) {
29
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
30
_("hugepages are not allowed with anonymous "
31