On Wed 24 May 2017 06:46:31 PM CEST, Daniel P. Berrange wrote:

>> > +    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.
>
> In thi case I think its clearer to set it right here, rather than
> having to follow the code paths through & read the later logic

Ok, works for me! :)

Berto

Reply via email to