]> xenbits.xensource.com Git - libvirt.git/commitdiff
domain_validate: drop cpu.shares cgroup check
authorPavel Hrdina <phrdina@redhat.com>
Tue, 17 Jan 2023 09:08:08 +0000 (10:08 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Tue, 17 Jan 2023 09:58:04 +0000 (10:58 +0100)
This check is done when VM is defined but doesn't take into account what
cgroups version is currently used on the host system so it doesn't work
correctly.

To make proper check at this point we would have to figure out cgroups
version while defining a VM but that will still not guarantee that the
VM will start correctly in the future as the host may be rebooted with
different cgroups version.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/conf/domain_validate.c

index 5a9bf20d3f4cf267061d4813215f4e69f7cfb422..39d924d4ed3b601424874b385d67f2030892980d 100644 (file)
@@ -1725,16 +1725,6 @@ virDomainDefOSValidate(const virDomainDef *def,
 static int
 virDomainDefCputuneValidate(const virDomainDef *def)
 {
-    if (def->cputune.shares > 0 &&
-        (def->cputune.shares < VIR_CGROUP_CPU_SHARES_MIN ||
-         def->cputune.shares > VIR_CGROUP_CPU_SHARES_MAX)) {
-        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Value of cputune 'shares' must be in range [%llu, %llu]"),
-                         VIR_CGROUP_CPU_SHARES_MIN,
-                         VIR_CGROUP_CPU_SHARES_MAX);
-        return -1;
-    }
-
     CPUTUNE_VALIDATE_PERIOD(period);
     CPUTUNE_VALIDATE_PERIOD(global_period);
     CPUTUNE_VALIDATE_PERIOD(emulator_period);