From: Michal Privoznik Date: Mon, 9 Mar 2020 12:14:07 +0000 (+0100) Subject: virCgroupV2DevicesAvailable: Print stringified errno in the debug log X-Git-Tag: v6.2.0-rc1~244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02794cc41dc547c75cd5ac5a3929f5e93bdd7665;p=thirdparty%2Flibvirt.git virCgroupV2DevicesAvailable: Print stringified errno in the debug log In the virCgroupV2DevicesAvailable() function we try to determine whether CGroups version 2 are available. We do this by opening what we believe is the CGroup mount point and issuing a BPF call. When the call fails, a debug message is printed. However, the BPF call sets errno too. Include it in the debug message to help us with debugging. Signed-off-by: Michal Privoznik Reviewed-by: Daniel Henrique Barboza --- diff --git a/src/util/vircgroupv2devices.c b/src/util/vircgroupv2devices.c index 445f9c53fc..d62ee12a05 100644 --- a/src/util/vircgroupv2devices.c +++ b/src/util/vircgroupv2devices.c @@ -55,7 +55,7 @@ virCgroupV2DevicesAvailable(virCgroupPtr group) } if (virBPFQueryProg(cgroupfd, 0, BPF_CGROUP_DEVICE, &progCnt, NULL) < 0) { - VIR_DEBUG("failed to query cgroup progs"); + VIR_DEBUG("failed to query cgroup progs: %s", g_strerror(errno)); return false; }