]> xenbits.xensource.com Git - libvirt.git/commitdiff
LXC: Change the owner of live attached disk device
authorGao feng <gaofeng@cn.fujitsu.com>
Tue, 16 Jul 2013 02:00:03 +0000 (10:00 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 16 Jul 2013 15:59:20 +0000 (09:59 -0600)
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

index 1279edfaa677789f2dde91f64cdb0df6828d27b5..bd921351a29384f3f257430dc1bb48e861342c17 100644 (file)
@@ -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