mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
LXC: Change the owner of live attached host devices
The owner of this host devices should be the root user of container. Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user