As a part of its checks, virt-host-validate calls virCgroupNew()
to detect CGroup controllers which are then printed out. However,
virCgroupNew() can fail (with appropriate error message set).
Let's print an error onto stderr if that happens.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Fabiano Fidêncio <fabiano@fidencio.org>
int ret = 0;
size_t i;
- if (virCgroupNew("/", -1, &group) < 0)
+ if (virCgroupNew("/", -1, &group) < 0) {
+ fprintf(stderr, "Unable to initialize cgroups: %s\n",
+ virGetLastErrorMessage());
return VIR_HOST_VALIDATE_FAILURE(level);
+ }
for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
int flag = 1 << i;