Change VM cgroup suffix from '{lxc,qemu}.libvirt' to 'libvirt-{lxc,qemu}'

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>
This commit is contained in:
Daniel P. Berrange 2013-04-26 09:52:47 +01:00
parent 7e77f252bd
commit 824e86e723
2 changed files with 8 additions and 8 deletions

View 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;

View 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);