mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
virt-host-validate: Report an error if failed to detect CGroups
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>
This commit is contained in:
parent
e7ae82dcc5
commit
52d2571b58
@ -290,8 +290,11 @@ int virHostValidateCGroupControllers(const char *hvname,
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user