From: Jiri Denemark Date: Tue, 5 Jan 2021 22:53:25 +0000 (+0100) Subject: qemu: The TSC tolerance interval should be closed X-Git-Tag: v7.0.0-rc1~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f7c40b5c716fea5d2a4179569146307ebebc76ba;p=thirdparty%2Flibvirt.git qemu: The TSC tolerance interval should be closed The kernel refuses to set guest TSC frequency less than a minimum frequency or greater than maximum frequency (both computed based on the host TSC frequency). When writing the libvirt code with a reversed logic (return success when the requested frequency falls within the tolerance interval) I forgot to include the boundaries. Fixes: d8e5b4560006590668d4669f54a46b08ec14c1a2 https://bugzilla.redhat.com/show_bug.cgi?id=1839095 Signed-off-by: Jiri Denemark Reviewed-by: Peter Krempa --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 414e9327d2..69c517f7a9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -5403,7 +5403,7 @@ qemuProcessStartValidateTSC(virQEMUDriverPtr driver, tsc->frequency, virTristateBoolTypeToString(tsc->scaling), tolerance); - if (freq > minFreq && freq < maxFreq) { + if (freq >= minFreq && freq <= maxFreq) { VIR_DEBUG("Requested TSC frequency is within tolerance interval"); return 0; }