render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
acda74
From fbf5f9bce43e19f8827e5cdef0e456b74ccc2f7d Mon Sep 17 00:00:00 2001
acda74
Message-Id: <fbf5f9bce43e19f8827e5cdef0e456b74ccc2f7d@dist-git>
acda74
From: Pavel Hrdina <phrdina@redhat.com>
acda74
Date: Tue, 17 Jan 2023 10:08:08 +0100
acda74
Subject: [PATCH] domain_validate: drop cpu.shares cgroup check
acda74
acda74
This check is done when VM is defined but doesn't take into account what
acda74
cgroups version is currently used on the host system so it doesn't work
acda74
correctly.
acda74
acda74
To make proper check at this point we would have to figure out cgroups
acda74
version while defining a VM but that will still not guarantee that the
acda74
VM will start correctly in the future as the host may be rebooted with
acda74
different cgroups version.
acda74
acda74
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
acda74
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
acda74
(cherry picked from commit 38af6497610075e5fe386734b87186731d4c17ac)
acda74
acda74
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2037998
acda74
acda74
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
acda74
---
acda74
 src/conf/domain_validate.c | 10 ----------
acda74
 1 file changed, 10 deletions(-)
acda74
acda74
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
acda74
index 5a9bf20d3f..39d924d4ed 100644
acda74
--- a/src/conf/domain_validate.c
acda74
+++ b/src/conf/domain_validate.c
acda74
@@ -1725,16 +1725,6 @@ virDomainDefOSValidate(const virDomainDef *def,
acda74
 static int
acda74
 virDomainDefCputuneValidate(const virDomainDef *def)
acda74
 {
acda74
-    if (def->cputune.shares > 0 &&
acda74
-        (def->cputune.shares < VIR_CGROUP_CPU_SHARES_MIN ||
acda74
-         def->cputune.shares > VIR_CGROUP_CPU_SHARES_MAX)) {
acda74
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
acda74
-                       _("Value of cputune 'shares' must be in range [%llu, %llu]"),
acda74
-                         VIR_CGROUP_CPU_SHARES_MIN,
acda74
-                         VIR_CGROUP_CPU_SHARES_MAX);
acda74
-        return -1;
acda74
-    }
acda74
-
acda74
     CPUTUNE_VALIDATE_PERIOD(period);
acda74
     CPUTUNE_VALIDATE_PERIOD(global_period);
acda74
     CPUTUNE_VALIDATE_PERIOD(emulator_period);
acda74
-- 
acda74
2.39.1
acda74