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 7bbadc60b5 resolved]
This commit is contained in:
@@ -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;
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user