From e77544fe057895d4b6431a5aa84f7c73ff3e8a31 Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@inria.fr>
Date: Sun, 12 Jan 2014 14:15:40 +0100
Subject: [PATCH] =?utf8?q?add=20a=20possible=20/sys/fs/cgroup=20location?=
 =?utf8?q?=20as=20observed=20on=20toady=E2=80=99s=20f18=20build=20not=20su?=
 =?utf8?q?re=20why=20this=20changed=20though,=20nor=20how=20recent=20it=20?=
 =?utf8?q?is?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 lxcsu | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lxcsu b/lxcsu
index 078d275..3322b69 100755
--- a/lxcsu
+++ b/lxcsu
@@ -112,6 +112,7 @@ def virSystemdMakeScopeName (name, drivername, partition):
 #98}
 
 ### our own additions
+# heuristics to locate /sys/fs/cgroup stuff
 import os.path
 def find_first_dir (candidates):
     for candidate in candidates:
@@ -126,6 +127,7 @@ def find_sysfs_scope (subsystem, slice_name):
     candidates = [ 
         # for f16 and our locally brewed libvirt 1.0.4
         "/sys/fs/cgroup/%s/libvirt/lxc/%s"%(subsystem1, slice_name),
+        "/sys/fs/cgroup/%s/system/libvirtd.service/libvirt/lxc/%s"%(subsystem1, slice_name),
         # f20 and libvirt 1.1.3
         "/sys/fs/cgroup/%s/machine.slice/%s"%(subsystem2, 
                                               virSystemdMakeScopeName(slice_name,'lxc','machine')),
@@ -210,7 +212,7 @@ def main ():
         cmd = '/usr/bin/virsh --connect lxc:/// domid %s'%slice_name
 	pidnum = int(os.popen(cmd).read().rstrip())
     except:
-        print "Error finding slice %s"%slice_name
+        print "Error finding slice %s in virsh"%slice_name
 	exit(1)
 
     pid = '%s'%pidnum
-- 
2.47.0