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