On 07/26/2013 09:48 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Make the virCgroupNewMachine method try to use systemd-machined
first. If that fails, then fallback to using the traditional
cgroup setup code path.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_process.c | 10 +--
src/qemu/qemu_cgroup.c | 1 +
src/util/vircgroup.c | 187 ++++++++++++++++++++++++++++++++++++++++++++-----
src/util/vircgroup.h | 1 +
src/util/virsystemd.c | 5 +-
5 files changed, 182 insertions(+), 22 deletions(-)
+/*
+ * Retujrns 0 on success, -1 on fatal error, -2 on systemd not available
+ */
s/Retujrns/Returns/
- *group = NULL;
+ path = (init)->controllers[VIR_CGROUP_CONTROLLER_SYSTEMD].placement;
+ (init)->controllers[VIR_CGROUP_CONTROLLER_SYSTEMD].placement = NULL;
s/(init)/init/ (looks like you refactored, and had (*init) at one point)
+++ b/src/util/virsystemd.c
@@ -225,8 +225,9 @@ int virSystemdCreateMachine(const char *name,
iscontainer ? "container" : "vm",
(unsigned int)pidleader,
rootdir ? rootdir : "",
- 1, "Slice", "s",
- slicename) < 0) {
+ 1,
+ "Slice", "s", slicename
+ ) < 0) {
Spurious reformatting?
ACK with nits fixed.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org