[PATCH 7/7] LXC: Change the owner of live attached host devices

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

 



The owner of this host devices should be the root user of container.

Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
---
 src/lxc/lxc_driver.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index bd92135..098051b 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -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;
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]