Added in QEMU commit of v3.0.0-rc0~48^2~9 QEMU is replacing
'-realtime mlock' with '-overcommit mem-lock'. Add a capability
to tell if we're dealing new new enough qemu to use the
replacement.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 2 ++
src/qemu/qemu_capabilities.h | 1 +
tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 +
tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml | 1 +
tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml | 1 +
tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml | 1 +
tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml | 1 +
7 files changed, 8 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b1085974d5..da90cd666e 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -525,6 +525,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
"nvdimm.unarmed",
"scsi-disk.device_id",
"virtio-pci-non-transitional",
+ "overcommit",
);
@@ -2659,6 +2660,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] =
{
{ "sandbox", "enable", QEMU_CAPS_SECCOMP_SANDBOX },
{ "sandbox", "elevateprivileges", QEMU_CAPS_SECCOMP_BLACKLIST },
{ "chardev", "fd", QEMU_CAPS_CHARDEV_FD_PASS },
+ { "overcommit", NULL, QEMU_CAPS_OVERCOMMIT },
};
static int
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 6e4f6fa42f..fd7bec7589 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -507,6 +507,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check
*/
QEMU_CAPS_DEVICE_NVDIMM_UNARMED, /* -device nvdimm,unarmed= */
QEMU_CAPS_SCSI_DISK_DEVICE_ID, /* 'device_id' property of scsi disk */
QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL, /* virtio *-pci-{non-}transitional devices */
+ QEMU_CAPS_OVERCOMMIT, /* -overcommit */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml
b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml
index 52a2b956e3..ee6921ff92 100644
--- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml
+++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml
@@ -155,6 +155,7 @@
<flag name='machine.pseries.cap-nested-hv'/>
<flag name='memory-backend-file.align'/>
<flag name='memory-backend-file.pmem'/>
+ <flag name='overcommit'/>
<version>3000091</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>42900758</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
index 1b97f65427..6c2a5dcf70 100644
--- a/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_3.1.0.x86_64.xml
@@ -199,6 +199,7 @@
<flag name='memory-backend-file.align'/>
<flag name='memory-backend-file.pmem'/>
<flag name='nvdimm.unarmed'/>
+ <flag name='overcommit'/>
<version>3000092</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100758</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
index 05b6c54710..d6fc996528 100644
--- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv32.xml
@@ -162,6 +162,7 @@
<flag name='memory-backend-file.pmem'/>
<flag name='scsi-disk.device_id'/>
<flag name='virtio-pci-non-transitional'/>
+ <flag name='overcommit'/>
<version>3001091</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
index c87a983b18..fcc34b0ae6 100644
--- a/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.riscv64.xml
@@ -162,6 +162,7 @@
<flag name='memory-backend-file.pmem'/>
<flag name='scsi-disk.device_id'/>
<flag name='virtio-pci-non-transitional'/>
+ <flag name='overcommit'/>
<version>3001091</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>
diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
index 52621dd985..bc8e35e226 100644
--- a/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
+++ b/tests/qemucapabilitiesdata/caps_4.0.0.x86_64.xml
@@ -200,6 +200,7 @@
<flag name='nvdimm.unarmed'/>
<flag name='scsi-disk.device_id'/>
<flag name='virtio-pci-non-transitional'/>
+ <flag name='overcommit'/>
<version>3001050</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>43100758</microcodeVersion>
--
2.21.0