[libvirt] [PATCH] Change default resource partition to /machine

From: "Daniel P. Berrange" <berrange@redhat.com> After discussions with systemd developers it was decided that a better default policy for resource partitions is to have 3 default partitions at the top level /system - system services /machine - virtual machines / containers /user - user login session This ensures that the default policy isolates guest from user login sessions & system services, so a mis-behaving guest can't consume 100% of CPU usage if other things are contending for it. Thus we change the default partition from /system to /machine Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/lxc/lxc_cgroup.c | 2 +- src/qemu/qemu_cgroup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index 0a43b61..7311489 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -537,7 +537,7 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def, bool startup) goto cleanup; } - if (!(res->partition = strdup("/system"))) { + if (!(res->partition = strdup("/machine"))) { virReportOOMError(); VIR_FREE(res); goto cleanup; diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 9a7bffb..3a58f24 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -236,7 +236,7 @@ int qemuInitCgroup(virQEMUDriverPtr driver, goto cleanup; } - if (!(res->partition = strdup("/system"))) { + if (!(res->partition = strdup("/machine"))) { virReportOOMError(); VIR_FREE(res); goto cleanup; -- 1.7.11.7

On 04/18/2013 04:11 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
After discussions with systemd developers it was decided that a better default policy for resource partitions is to have 3 default partitions at the top level
/system - system services /machine - virtual machines / containers /user - user login session
This ensures that the default policy isolates guest from user login sessions & system services, so a mis-behaving guest can't consume 100% of CPU usage if other things are contending for it.
Thus we change the default partition from /system to /machine
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/lxc/lxc_cgroup.c | 2 +- src/qemu/qemu_cgroup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
ACK. But is it worth making this configurable in qemu.conf/lxc.conf, in case policy changes yet again? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, 18.04.13 08:33, Eric Blake (eblake@redhat.com) wrote:
On 04/18/2013 04:11 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
After discussions with systemd developers it was decided that a better default policy for resource partitions is to have 3 default partitions at the top level
/system - system services /machine - virtual machines / containers /user - user login session
This ensures that the default policy isolates guest from user login sessions & system services, so a mis-behaving guest can't consume 100% of CPU usage if other things are contending for it.
Thus we change the default partition from /system to /machine
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- src/lxc/lxc_cgroup.c | 2 +- src/qemu/qemu_cgroup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
ACK. But is it worth making this configurable in qemu.conf/lxc.conf, in case policy changes yet again?
Just to provide some context to this: we are confident enough to hardcode these three paths in systemd. Lennart -- Lennart Poettering - Red Hat, Inc.
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Lennart Poettering