mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-31 18:15:25 +00:00
qemu: domain: Inline qemuDomainDiskHasEncryptionSecret
Since we are already checking that the encryption format can be only _LUKS and _LUKS2 this wrapper function doesn't make much sense any more. The only one caller can do this internally. The move of virStorageSourceIsEmpty is correct as there are no secrets to setup if the disk is empty anyways. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
6fe2ca9ac1
commit
3172b0ed3f
@ -1243,19 +1243,6 @@ qemuDomainStorageSourceHasAuth(virStorageSource *src)
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
qemuDomainDiskHasEncryptionSecret(virStorageSource *src)
|
||||
{
|
||||
if (!virStorageSourceIsEmpty(src) && src->encryption &&
|
||||
(src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS ||
|
||||
src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS2) &&
|
||||
src->encryption->nsecrets > 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static qemuDomainSecretInfo *
|
||||
qemuDomainSecretStorageSourcePrepareCookies(qemuDomainObjPrivate *priv,
|
||||
virStorageSource *src,
|
||||
@ -1291,7 +1278,10 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjPrivate *priv,
|
||||
{
|
||||
qemuDomainStorageSourcePrivate *srcPriv;
|
||||
bool hasAuth = qemuDomainStorageSourceHasAuth(src);
|
||||
bool hasEnc = qemuDomainDiskHasEncryptionSecret(src);
|
||||
bool hasEnc = src->encryption && src->encryption->nsecrets > 0;
|
||||
|
||||
if (virStorageSourceIsEmpty(src))
|
||||
return 0;
|
||||
|
||||
if (!hasAuth && !hasEnc && src->ncookies == 0)
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user