On Fri, Jan 31, 2020 at 05:39:51PM +0100, Andrea Bolognani wrote:
Error out if the QEMU binary doesn't support it. Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx> --- 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;
Either qemuDomain.*Validate or qemuProcessVerifyCPU would be a better place for this check. Jano
+ } }
Attachment:
signature.asc
Description: PGP signature