mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
qemuSecurityRestoreAllLabel: Don't use transactions
Because of the nature of security driver transactions, it is impossible to use them properly. The thing is, transactions enter the domain namespace and commit all the seclabel changes. However, in RestoreAllLabel() this is impossible - the qemu process, the only process running in the namespace, is gone. And thus is the namespace. Therefore we shouldn't use the transactions as there is no namespace to enter. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
0a4652381f
commit
3e6839d4e8
@ -73,22 +73,15 @@ qemuSecurityRestoreAllLabel(virQEMUDriverPtr driver,
|
|||||||
virDomainObjPtr vm,
|
virDomainObjPtr vm,
|
||||||
bool migrated)
|
bool migrated)
|
||||||
{
|
{
|
||||||
if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) &&
|
/* In contrast to qemuSecuritySetAllLabel, do not use
|
||||||
virSecurityManagerTransactionStart(driver->securityManager) < 0)
|
* secdriver transactions here. This function is called from
|
||||||
goto cleanup;
|
* qemuProcessStop() which is meant to do cleanup after qemu
|
||||||
|
* process died. If it did do, the namespace is gone as qemu
|
||||||
if (virSecurityManagerRestoreAllLabel(driver->securityManager,
|
* was the only process running there. We would not succeed
|
||||||
vm->def,
|
* in entering the namespace then. */
|
||||||
migrated) < 0)
|
virSecurityManagerRestoreAllLabel(driver->securityManager,
|
||||||
goto cleanup;
|
vm->def,
|
||||||
|
migrated);
|
||||||
if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT) &&
|
|
||||||
virSecurityManagerTransactionCommit(driver->securityManager,
|
|
||||||
vm->pid) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virSecurityManagerTransactionAbort(driver->securityManager);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user