]> xenbits.xensource.com Git - libvirt.git/commitdiff
virCgroupV2DevicesAvailable: Print stringified errno in the debug log
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 9 Mar 2020 12:14:07 +0000 (13:14 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Mar 2020 16:10:21 +0000 (17:10 +0100)
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 <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/util/vircgroupv2devices.c

index 445f9c53fcaaba41bee2f0951832d89105a948f1..d62ee12a05ee7d6e096f35c2619acd9582f3ba39 100644 (file)
@@ -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;
     }