qemu_security: Implement qemuSecurityMoveImageMetadata

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik 2019-03-21 16:36:38 +01:00
parent 44a204e674
commit 706e68237f
2 changed files with 24 additions and 0 deletions

View File

@ -162,6 +162,25 @@ qemuSecurityRestoreImageLabel(virQEMUDriverPtr driver,
}
int
qemuSecurityMoveImageMetadata(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virStorageSourcePtr src,
virStorageSourcePtr dst)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
pid_t pid = -1;
if (!priv->rememberOwner)
return 0;
if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
pid = vm->pid;
return virSecurityManagerMoveImageMetadata(driver->securityManager, pid, src, dst);
}
int
qemuSecuritySetHostdevLabel(virQEMUDriverPtr driver,
virDomainObjPtr vm,

View File

@ -42,6 +42,11 @@ int qemuSecurityRestoreImageLabel(virQEMUDriverPtr driver,
virStorageSourcePtr src,
bool backingChain);
int qemuSecurityMoveImageMetadata(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virStorageSourcePtr src,
virStorageSourcePtr dst);
int qemuSecuritySetHostdevLabel(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev);