[libvirt] [PATCH RESEND 2/7] LXC: controller: change the owner of disk to the root of container

Gao feng gaofeng at cn.fujitsu.com
Tue Jul 16 02:00:01 UTC 2013


These disk devices are created for container,
the owner should be the root user of container.

Signed-off-by: Gao feng <gaofeng at cn.fujitsu.com>
---
 src/lxc/lxc_controller.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index e9d2848..38b632e 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -1369,6 +1369,9 @@ static int virLXCControllerSetupDisk(virLXCControllerPtr ctrl,
         goto cleanup;
     }
 
+    if (virLXCControllerChown(ctrl, dst) < 0)
+        goto cleanup;
+
     /* Labelling normally operates on src, but we need
      * to actally label the dst here, so hack the config */
     def->src = dst;
-- 
1.8.3.1




More information about the libvir-list mailing list