File f7c40b5c71-qemu-tsc-tolerance-interval-closed.patch of Package libvirt.22291

commit f7c40b5c716fea5d2a4179569146307ebebc76ba
Author: Jiri Denemark <jdenemar@redhat.com>
Date:   Tue Jan 5 23:53:25 2021 +0100

    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 <jdenemar@redhat.com>
    Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Index: libvirt-6.0.0/src/qemu/qemu_process.c
===================================================================
--- libvirt-6.0.0.orig/src/qemu/qemu_process.c
+++ libvirt-6.0.0/src/qemu/qemu_process.c
@@ -5295,7 +5295,7 @@ qemuProcessStartValidateTSC(virQEMUDrive
               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;
     }
openSUSE Build Service is sponsored by