mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
crypto: report enum strings instead of values in errors
Several error messages print out the raw enum value, which is less than helpful to users, as these values are not documented, nor stable across QEMU releases. Switch to use the enum string instead. The nettle impl also had two typos where it mistakenly said "algorithm" instead of "mode", and actually reported the algorithm value too. Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
@@ -59,7 +59,8 @@ QCryptoBlock *qcrypto_block_open(QCryptoBlockOpenOptions *options,
|
||||
|
||||
if (options->format >= G_N_ELEMENTS(qcrypto_block_drivers) ||
|
||||
!qcrypto_block_drivers[options->format]) {
|
||||
error_setg(errp, "Unsupported block driver %d", options->format);
|
||||
error_setg(errp, "Unsupported block driver %s",
|
||||
QCryptoBlockFormat_lookup[options->format]);
|
||||
g_free(block);
|
||||
return NULL;
|
||||
}
|
||||
@@ -88,7 +89,8 @@ QCryptoBlock *qcrypto_block_create(QCryptoBlockCreateOptions *options,
|
||||
|
||||
if (options->format >= G_N_ELEMENTS(qcrypto_block_drivers) ||
|
||||
!qcrypto_block_drivers[options->format]) {
|
||||
error_setg(errp, "Unsupported block driver %d", options->format);
|
||||
error_setg(errp, "Unsupported block driver %s",
|
||||
QCryptoBlockFormat_lookup[options->format]);
|
||||
g_free(block);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user