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

[libvirt] [PATCH 4/7] LXC: Change the owner of live attached disk device



The owner of this disk device should be the root user of container.

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

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 1279edf..bd92135 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3258,6 +3258,10 @@ lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver,
                              dst);
         goto cleanup;
     }
+
+    if (lxcContainerChown(vm->def, dst) < 0)
+        goto cleanup;
+
     created = true;
 
     /* Labelling normally operates on src, but we need
-- 
1.8.3.1


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