]> xenbits.xensource.com Git - libvirt.git/commitdiff
resctrl: Account for memory bandwidth of 0 being valid
authorMartin Kletzander <mkletzan@redhat.com>
Tue, 10 Sep 2024 13:22:13 +0000 (15:22 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Fri, 13 Sep 2024 10:55:39 +0000 (12:55 +0200)
In some scenarios the memory bandwidth in the schemata file might be 0
and so can the minimum allocation in other ones.  Remove checks which
were added for extra cautiousness.

Resolves: https://issues.redhat.com/browse/RHEL-54235
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virresctrl.c

index 30ae25c4872657caa6726aab45d34243fa521b48..8ed111c182e728d265ca89784914ab5122cfbfb3 100644 (file)
@@ -1425,8 +1425,7 @@ virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfo *resctrl,
                        _("Invalid bandwidth %1$u"), bandwidth);
         return -1;
     }
-    if (bandwidth < resctrl->membw_info->min_bandwidth ||
-        id > resctrl->membw_info->max_id) {
+    if (id > resctrl->membw_info->max_id) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("Missing or inconsistent resctrl info for memory bandwidth node '%1$u'"),
                        id);
@@ -1463,7 +1462,6 @@ virResctrlAllocParseMemoryBandwidthLine(virResctrlInfo *resctrl,
         return 0;
 
     if (!resctrl || !resctrl->membw_info ||
-        !resctrl->membw_info->min_bandwidth ||
         !resctrl->membw_info->bandwidth_granularity) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                        _("Missing or inconsistent resctrl info for memory bandwidth allocation"));