Error out if the QEMU binary doesn't support it.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_domain.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d3045b4bcd..8b0c91d6c1 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4625,7 +4625,8 @@ qemuDomainDefSetDefaultCPU(virDomainDefPtr def,
static int
-qemuDomainDefCPUPostParse(virDomainDefPtr def)
+qemuDomainDefCPUPostParse(virDomainDefPtr def,
+ virQEMUCapsPtr qemuCaps)
{
virCPUFeatureDefPtr sveFeature = NULL;
bool sveVectorLengthsProvided = false;
@@ -4696,6 +4697,15 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def)
} else if (STRPREFIX(feature->name, "sve")) {
sveVectorLengthsProvided = true;
}
+
+ if (STREQ(feature->name, "kvm-no-adjvtime") &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_KVM_NO_ADJVTIME))
+ {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("The '%s' feature is not supported by this
"
+ "QEMU binary"), feature->name);
+ return -1;
+ }
}
if (sveVectorLengthsProvided) {
@@ -4858,7 +4868,7 @@ qemuDomainDefPostParse(virDomainDefPtr def,
if (qemuDomainDefVcpusPostParse(def) < 0)
return -1;
- if (qemuDomainDefCPUPostParse(def) < 0)
+ if (qemuDomainDefCPUPostParse(def, qemuCaps) < 0)
return -1;
if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0)
--
2.24.1