[libvirt PATCH 12/15] cgroup: return directly if there is nothing to remove

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>

This fixes an error path when virCgroupV2DevicesDetectProg() fails but
wasn't needed in the first place on VM shutdown.

Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
---
 src/util/vircgroupv2devices.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/util/vircgroupv2devices.c b/src/util/vircgroupv2devices.c
index d62ee12a05..997ef82964 100644
--- a/src/util/vircgroupv2devices.c
+++ b/src/util/vircgroupv2devices.c
@@ -541,12 +541,13 @@ virCgroupV2DevicesPrepareProg(virCgroupPtr group)
 int
 virCgroupV2DevicesRemoveProg(virCgroupPtr group)
 {
-    if (virCgroupV2DevicesDetectProg(group) < 0)
-        return -1;
-
     if (group->unified.devices.progfd <= 0 && group->unified.devices.mapfd <= 0)
         return 0;
 
+    if (virCgroupV2DevicesDetectProg(group) < 0) {
+        return -1;
+    }
+
     if (group->unified.devices.mapfd >= 0)
         VIR_FORCE_CLOSE(group->unified.devices.mapfd);
 
-- 
2.26.0.rc2.42.g98cedd0233





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux