提交 b2e5de96 编写于 作者: J John Ferlan

qemu: Rename variable

Rename 'secretUsageType' to 'usageType' since it's superfluous in an
API qemu*Secret*
上级 52c846af
...@@ -965,7 +965,7 @@ qemuDomainChrSourcePrivateDispose(void *obj) ...@@ -965,7 +965,7 @@ qemuDomainChrSourcePrivateDispose(void *obj)
/* qemuDomainSecretPlainSetup: /* qemuDomainSecretPlainSetup:
* @conn: Pointer to connection * @conn: Pointer to connection
* @secinfo: Pointer to secret info * @secinfo: Pointer to secret info
* @secretUsageType: The virSecretUsageType * @usageType: The virSecretUsageType
* @username: username to use for authentication (may be NULL) * @username: username to use for authentication (may be NULL)
* @seclookupdef: Pointer to seclookupdef data * @seclookupdef: Pointer to seclookupdef data
* *
...@@ -976,7 +976,7 @@ qemuDomainChrSourcePrivateDispose(void *obj) ...@@ -976,7 +976,7 @@ qemuDomainChrSourcePrivateDispose(void *obj)
static int static int
qemuDomainSecretPlainSetup(virConnectPtr conn, qemuDomainSecretPlainSetup(virConnectPtr conn,
qemuDomainSecretInfoPtr secinfo, qemuDomainSecretInfoPtr secinfo,
virSecretUsageType secretUsageType, virSecretUsageType usageType,
const char *username, const char *username,
virSecretLookupTypeDefPtr seclookupdef) virSecretLookupTypeDefPtr seclookupdef)
{ {
...@@ -984,7 +984,7 @@ qemuDomainSecretPlainSetup(virConnectPtr conn, ...@@ -984,7 +984,7 @@ qemuDomainSecretPlainSetup(virConnectPtr conn,
if (VIR_STRDUP(secinfo->s.plain.username, username) < 0) if (VIR_STRDUP(secinfo->s.plain.username, username) < 0)
return -1; return -1;
return virSecretGetSecretString(conn, seclookupdef, secretUsageType, return virSecretGetSecretString(conn, seclookupdef, usageType,
&secinfo->s.plain.secret, &secinfo->s.plain.secret,
&secinfo->s.plain.secretlen); &secinfo->s.plain.secretlen);
} }
...@@ -995,7 +995,7 @@ qemuDomainSecretPlainSetup(virConnectPtr conn, ...@@ -995,7 +995,7 @@ qemuDomainSecretPlainSetup(virConnectPtr conn,
* @priv: pointer to domain private object * @priv: pointer to domain private object
* @secinfo: Pointer to secret info * @secinfo: Pointer to secret info
* @srcalias: Alias of the disk/hostdev used to generate the secret alias * @srcalias: Alias of the disk/hostdev used to generate the secret alias
* @secretUsageType: The virSecretUsageType * @usageType: The virSecretUsageType
* @username: username to use for authentication (may be NULL) * @username: username to use for authentication (may be NULL)
* @seclookupdef: Pointer to seclookupdef data * @seclookupdef: Pointer to seclookupdef data
* @isLuks: True/False for is for luks (alias generation) * @isLuks: True/False for is for luks (alias generation)
...@@ -1009,7 +1009,7 @@ qemuDomainSecretAESSetup(virConnectPtr conn, ...@@ -1009,7 +1009,7 @@ qemuDomainSecretAESSetup(virConnectPtr conn,
qemuDomainObjPrivatePtr priv, qemuDomainObjPrivatePtr priv,
qemuDomainSecretInfoPtr secinfo, qemuDomainSecretInfoPtr secinfo,
const char *srcalias, const char *srcalias,
virSecretUsageType secretUsageType, virSecretUsageType usageType,
const char *username, const char *username,
virSecretLookupTypeDefPtr seclookupdef, virSecretLookupTypeDefPtr seclookupdef,
bool isLuks) bool isLuks)
...@@ -1038,7 +1038,7 @@ qemuDomainSecretAESSetup(virConnectPtr conn, ...@@ -1038,7 +1038,7 @@ qemuDomainSecretAESSetup(virConnectPtr conn,
goto cleanup; goto cleanup;
/* Grab the unencoded secret */ /* Grab the unencoded secret */
if (virSecretGetSecretString(conn, seclookupdef, secretUsageType, if (virSecretGetSecretString(conn, seclookupdef, usageType,
&secret, &secretlen) < 0) &secret, &secretlen) < 0)
goto cleanup; goto cleanup;
...@@ -1072,7 +1072,7 @@ qemuDomainSecretAESSetup(virConnectPtr conn, ...@@ -1072,7 +1072,7 @@ qemuDomainSecretAESSetup(virConnectPtr conn,
* @priv: pointer to domain private object * @priv: pointer to domain private object
* @secinfo: Pointer to secret info * @secinfo: Pointer to secret info
* @srcalias: Alias of the disk/hostdev used to generate the secret alias * @srcalias: Alias of the disk/hostdev used to generate the secret alias
* @secretUsageType: The virSecretUsageType * @usageType: The virSecretUsageType
* @username: username to use for authentication (may be NULL) * @username: username to use for authentication (may be NULL)
* @seclookupdef: Pointer to seclookupdef data * @seclookupdef: Pointer to seclookupdef data
* @isLuks: True when is luks (generates different alias) * @isLuks: True when is luks (generates different alias)
...@@ -1089,22 +1089,22 @@ qemuDomainSecretSetup(virConnectPtr conn, ...@@ -1089,22 +1089,22 @@ qemuDomainSecretSetup(virConnectPtr conn,
qemuDomainObjPrivatePtr priv, qemuDomainObjPrivatePtr priv,
qemuDomainSecretInfoPtr secinfo, qemuDomainSecretInfoPtr secinfo,
const char *srcalias, const char *srcalias,
virSecretUsageType secretUsageType, virSecretUsageType usageType,
const char *username, const char *username,
virSecretLookupTypeDefPtr seclookupdef, virSecretLookupTypeDefPtr seclookupdef,
bool isLuks) bool isLuks)
{ {
if (virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC) && if (virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC) &&
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_SECRET) && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_SECRET) &&
(secretUsageType == VIR_SECRET_USAGE_TYPE_CEPH || (usageType == VIR_SECRET_USAGE_TYPE_CEPH ||
secretUsageType == VIR_SECRET_USAGE_TYPE_VOLUME || usageType == VIR_SECRET_USAGE_TYPE_VOLUME ||
secretUsageType == VIR_SECRET_USAGE_TYPE_TLS)) { usageType == VIR_SECRET_USAGE_TYPE_TLS)) {
if (qemuDomainSecretAESSetup(conn, priv, secinfo, srcalias, if (qemuDomainSecretAESSetup(conn, priv, secinfo, srcalias,
secretUsageType, username, usageType, username,
seclookupdef, isLuks) < 0) seclookupdef, isLuks) < 0)
return -1; return -1;
} else { } else {
if (qemuDomainSecretPlainSetup(conn, secinfo, secretUsageType, if (qemuDomainSecretPlainSetup(conn, secinfo, usageType,
username, seclookupdef) < 0) username, seclookupdef) < 0)
return -1; return -1;
} }
...@@ -1253,14 +1253,14 @@ qemuDomainSecretDiskPrepare(virConnectPtr conn, ...@@ -1253,14 +1253,14 @@ qemuDomainSecretDiskPrepare(virConnectPtr conn,
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
if (qemuDomainSecretDiskCapable(src)) { if (qemuDomainSecretDiskCapable(src)) {
virSecretUsageType secretUsageType = VIR_SECRET_USAGE_TYPE_ISCSI; virSecretUsageType usageType = VIR_SECRET_USAGE_TYPE_ISCSI;
if (src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD) if (src->protocol == VIR_STORAGE_NET_PROTOCOL_RBD)
secretUsageType = VIR_SECRET_USAGE_TYPE_CEPH; usageType = VIR_SECRET_USAGE_TYPE_CEPH;
if (!(diskPriv->secinfo = if (!(diskPriv->secinfo =
qemuDomainSecretInfoNew(conn, priv, disk->info.alias, qemuDomainSecretInfoNew(conn, priv, disk->info.alias,
secretUsageType, src->auth->username, usageType, src->auth->username,
&src->auth->seclookupdef, false))) &src->auth->seclookupdef, false)))
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册