From: Peter Krempa Date: Tue, 21 Sep 2021 15:58:30 +0000 (+0200) Subject: qemu: domain: Remove qemuDomainSupportsEncryptedSecret X-Git-Tag: v7.8.0-rc1~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d13acc3bc3fd4f7874c52a890541a3590c33728;p=thirdparty%2Flibvirt.git qemu: domain: Remove qemuDomainSupportsEncryptedSecret The answer is now always 'true', so we can remove the function and simplify the logic in places where it's called. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 1340ed0d29..903e86f8dc 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1154,12 +1154,6 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, g_autofree uint8_t *ciphertext = NULL; size_t ciphertextlen = 0; - if (!qemuDomainSupportsEncryptedSecret(priv)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("encrypted secrets are not supported")); - return NULL; - } - secinfo = g_new0(qemuDomainSecretInfo, 1); secinfo->type = VIR_DOMAIN_SECRET_INFO_TYPE_AES; @@ -1235,20 +1229,6 @@ qemuDomainSecretAESSetupFromSecret(qemuDomainObjPrivate *priv, } -/** - * qemuDomainSupportsEncryptedSecret: - * @priv: qemu domain private data - * - * Returns true if libvirt can use encrypted 'secret' objects with VM which - * @priv belongs to. - */ -bool -qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivate *priv) -{ - return !!priv->masterKey; -} - - /* qemuDomainSecretInfoNewPlain: * @usageType: Secret usage type * @username: username @@ -1404,8 +1384,7 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjPrivate *priv, if (src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD) usageType = VIR_SECRET_USAGE_TYPE_CEPH; - if (!qemuDomainSupportsEncryptedSecret(priv) || - (src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI && !iscsiHasPS)) { + if (src->protocol == VIR_STORAGE_NET_PROTOCOL_ISCSI && !iscsiHasPS) { srcPriv->secinfo = qemuDomainSecretInfoNewPlain(usageType, src->auth->username, &src->auth->seclookupdef); @@ -10888,7 +10867,7 @@ qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev, virSecretUsageType usageType = VIR_SECRET_USAGE_TYPE_ISCSI; qemuDomainStorageSourcePrivate *srcPriv = qemuDomainStorageSourcePrivateFetch(src); - if (!qemuDomainSupportsEncryptedSecret(priv) || !iscsiHasPS) { + if (!iscsiHasPS) { srcPriv->secinfo = qemuDomainSecretInfoNewPlain(usageType, src->auth->username, &src->auth->seclookupdef); diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index ae9d76ec4a..08f33f0f9e 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -853,8 +853,6 @@ int qemuDomainMasterKeyCreate(virDomainObj *vm); void qemuDomainMasterKeyRemove(qemuDomainObjPrivate *priv); -bool qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivate *priv); - void qemuDomainSecretInfoFree(qemuDomainSecretInfo *secinfo) ATTRIBUTE_NONNULL(1);