]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Change VM cgroup suffix from '{lxc,qemu}.libvirt' to 'libvirt-{lxc,qemu}'
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 26 Apr 2013 08:52:47 +0000 (09:52 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 26 Apr 2013 12:52:02 +0000 (13:52 +0100)
Recently we changed to create VM cgroups with the naming pattern
$VMNAME.$DRIVER.libvirt. Following discussions with the systemd
community it was decided that only having a single '.' in the
names is preferrable. So this changes the naming scheme to be
$VMNAME.libvirt-$DRIVER. eg for LXC 'mycontainer.libvirt-lxc' or
for KVM 'myvm.libvirt-qemu'.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/util/vircgroup.c
tests/vircgrouptest.c

index 4c836c756996139d72067260f331bc4238718969..0084aead74e4f75a585ed996a7c243f523bb5163 100644 (file)
@@ -1297,7 +1297,7 @@ int virCgroupNewDomainPartition(virCgroupPtr partition,
     int rc;
     char *grpname = NULL;
 
-    if (virAsprintf(&grpname, "%s.%s.libvirt",
+    if (virAsprintf(&grpname, "%s.libvirt-%s",
                     name, driver) < 0)
         return -ENOMEM;
 
index 7445517474e925824626ec8f5e1cbad2a4972069..9c2590f2012c406a668b5381b34fea68d2cbc10b 100644 (file)
@@ -362,13 +362,13 @@ static int testCgroupNewForPartitionDomain(const void *args ATTRIBUTE_UNUSED)
     int ret = -1;
     int rv;
     const char *placement[VIR_CGROUP_CONTROLLER_LAST] = {
-        [VIR_CGROUP_CONTROLLER_CPU] = "/production/foo.lxc.libvirt",
-        [VIR_CGROUP_CONTROLLER_CPUACCT] = "/production/foo.lxc.libvirt",
-        [VIR_CGROUP_CONTROLLER_CPUSET] = "/production/foo.lxc.libvirt",
-        [VIR_CGROUP_CONTROLLER_MEMORY] = "/production/foo.lxc.libvirt",
+        [VIR_CGROUP_CONTROLLER_CPU] = "/production/foo.libvirt-lxc",
+        [VIR_CGROUP_CONTROLLER_CPUACCT] = "/production/foo.libvirt-lxc",
+        [VIR_CGROUP_CONTROLLER_CPUSET] = "/production/foo.libvirt-lxc",
+        [VIR_CGROUP_CONTROLLER_MEMORY] = "/production/foo.libvirt-lxc",
         [VIR_CGROUP_CONTROLLER_DEVICES] = NULL,
-        [VIR_CGROUP_CONTROLLER_FREEZER] = "/production/foo.lxc.libvirt",
-        [VIR_CGROUP_CONTROLLER_BLKIO] = "/production/foo.lxc.libvirt",
+        [VIR_CGROUP_CONTROLLER_FREEZER] = "/production/foo.libvirt-lxc",
+        [VIR_CGROUP_CONTROLLER_BLKIO] = "/production/foo.libvirt-lxc",
     };
 
     if ((rv = virCgroupNewPartition("/production", true, -1, &partitioncgroup)) != 0) {
@@ -381,7 +381,7 @@ static int testCgroupNewForPartitionDomain(const void *args ATTRIBUTE_UNUSED)
         goto cleanup;
     }
 
-    ret = validateCgroup(domaincgroup, "/production/foo.lxc.libvirt", mountsFull, links, placement);
+    ret = validateCgroup(domaincgroup, "/production/foo.libvirt-lxc", mountsFull, links, placement);
 
 cleanup:
     virCgroupFree(&partitioncgroup);