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

[libvirt] [PATCH 1/3] Change VM cgroup suffix from '{lxc, qemu}.libvirt' to 'libvirt-{lxc, qemu}'



From: "Daniel P. Berrange" <berrange redhat com>

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  |  2 +-
 tests/vircgrouptest.c | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index 4c836c7..0084aea 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -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;
 
diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c
index 7445517..9c2590f 100644
--- a/tests/vircgrouptest.c
+++ b/tests/vircgrouptest.c
@@ -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);
-- 
1.8.1.4


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