]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
LXC: Change the owner of live attached host devices
authorGao feng <gaofeng@cn.fujitsu.com>
Tue, 16 Jul 2013 02:00:06 +0000 (10:00 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 16 Jul 2013 15:59:41 +0000 (09:59 -0600)
The owner of this host devices should be the root user of container.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
src/lxc/lxc_driver.c

index bd921351a29384f3f257430dc1bb48e861342c17..098051be412c8940449794c0d8662482138fc16c 100644 (file)
@@ -3513,6 +3513,9 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
     }
     created = true;
 
+    if (lxcContainerChown(vm->def, dstfile) < 0)
+        goto cleanup;
+
     if (virSecurityManagerSetHostdevLabel(driver->securityManager,
                                           vm->def, def, vroot) < 0)
         goto cleanup;
@@ -3610,6 +3613,9 @@ lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverPtr driver,
     }
     created = true;
 
+    if (lxcContainerChown(vm->def, dst) < 0)
+        goto cleanup;
+
     if (virSecurityManagerSetHostdevLabel(driver->securityManager,
                                           vm->def, def, vroot) < 0)
         goto cleanup;
@@ -3715,6 +3721,9 @@ lxcDomainAttachDeviceHostdevMiscLive(virLXCDriverPtr driver,
     }
     created = true;
 
+    if (lxcContainerChown(vm->def, dst) < 0)
+        goto cleanup;
+
     if (virSecurityManagerSetHostdevLabel(driver->securityManager,
                                           vm->def, def, vroot) < 0)
         goto cleanup;