qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v6 11/18] qcow2: convert QCow2 to use QCryptoBlo


From: Alberto Garcia
Subject: Re: [Qemu-block] [PATCH v6 11/18] qcow2: convert QCow2 to use QCryptoBlock for encryption
Date: Thu, 11 May 2017 16:29:11 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Tue 25 Apr 2017 05:38:51 PM CEST, Daniel P. Berrange wrote:
> +    switch (s->crypt_method_header) {
> +    case QCOW_CRYPT_NONE:
> +        if (encryptfmt) {
> +            error_setg(errp, "No encryption in image header, but options "
> +                       "specified format '%s'", encryptfmt);
> +            goto fail;
> +        }
> +        break;

You forgot to set the return value here (it is undefined at this
point)...

> +
> +    case QCOW_CRYPT_AES:
> +        if (encryptfmt && !g_str_equal(encryptfmt, "aes")) {
> +            error_setg(errp,
> +                       "Header reported 'aes' encryption format but "
> +                       "options specify '%s'", encryptfmt);
> +            ret = -EINVAL;
> +            goto fail;
> +        }

...and here you could break instead, the condition immediately after the
switch sets ret to -EINVAL and returns.

> +##
> +# @BlockdevQcow2EncryptionFormat:
> +# @qcow: AES-CBC with plain64 initialization venctors
> +#
> +# Since: 2.10
> +##
> +{ 'enum': 'BlockdevQcow2EncryptionFormat',
> +  'data': [ 'qcow' ] }
> +

Same question here, isn't this supposed to be 'aes' ?

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]