aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2024-09-04 13:18:28 +0200
committerMarkus Armbruster <armbru@redhat.com>2024-09-10 14:02:16 +0200
commitef834aa2b2b52ac44ca97d70d5ef5e975a229034 (patch)
treed175decc323ac64104b4243d6c3389affe1d0804 /block
parent5f4059ef33e927ce9f72cb60000efa156566cd5c (diff)
qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix
QAPI's 'prefix' feature can make the connection between enumeration type and its constants less than obvious. It's best used with restraint. QCryptoHashAlgorithm has a 'prefix' that overrides the generated enumeration constants' prefix to QCRYPTO_HASH_ALG. We could simply drop 'prefix', but then the prefix becomes QCRYPTO_HASH_ALGORITHM, which is rather long. We could additionally rename the type to QCryptoHashAlg, but I think the abbreviation "alg" is less than clear. Rename the type to QCryptoHashAlgo instead. The prefix becomes to QCRYPTO_HASH_ALGO. Signed-off-by: Markus Armbruster <armbru@redhat.com> Acked-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20240904111836.3273842-12-armbru@redhat.com> [Conflicts with merge commit 7bbadc60b58b resolved]
Diffstat (limited to 'block')
-rw-r--r--block/parallels-ext.c2
-rw-r--r--block/quorum.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/block/parallels-ext.c b/block/parallels-ext.c
index b4e14c88f2..778b8f684e 100644
--- a/block/parallels-ext.c
+++ b/block/parallels-ext.c
@@ -206,7 +206,7 @@ parallels_parse_format_extension(BlockDriverState *bs, uint8_t *ext_cluster,
goto fail;
}
- ret = qcrypto_hash_bytes(QCRYPTO_HASH_ALG_MD5, (char *)pos, remaining,
+ ret = qcrypto_hash_bytes(QCRYPTO_HASH_ALGO_MD5, (char *)pos, remaining,
&hash, &hash_len, errp);
if (ret < 0) {
goto fail;
diff --git a/block/quorum.c b/block/quorum.c
index db8fe891c4..46be65a95f 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -393,7 +393,7 @@ static int quorum_compute_hash(QuorumAIOCB *acb, int i, QuorumVoteValue *hash)
/* XXX - would be nice if we could pass in the Error **
* and propagate that back, but this quorum code is
* restricted to just errno values currently */
- if (qcrypto_hash_bytesv(QCRYPTO_HASH_ALG_SHA256,
+ if (qcrypto_hash_bytesv(QCRYPTO_HASH_ALGO_SHA256,
qiov->iov, qiov->niov,
&data, &len,
NULL) < 0) {
@@ -1308,7 +1308,7 @@ static BlockDriver bdrv_quorum = {
static void bdrv_quorum_init(void)
{
- if (!qcrypto_hash_supports(QCRYPTO_HASH_ALG_SHA256)) {
+ if (!qcrypto_hash_supports(QCRYPTO_HASH_ALGO_SHA256)) {
/* SHA256 hash support is required for quorum device */
return;
}