mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-08 16:54:49 +00: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:
parent
7a8212aac9
commit
129d25dcd9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user