On Mon 19 Jun 2017 07:34:42 PM CEST, Daniel P. Berrange wrote:
> Historically the qcow & qcow2 image formats supported a property
> "encryption=on" to enable their built-in AES encryption. We'll
> soon be supporting LUKS for qcow2, so need a more general purpose
> way to enable encryption, with a choice of formats.
>
> This introduces an "encrypt.format" option, which will later be
> joined by a number of other "encrypt.XXX" options. The use of
> a "encrypt." prefix instead of "encrypt-" is done to facilitate
> mapping to a nested QAPI schema at later date.
>
> e.g. the preferred syntax is now
>
>   qemu-img create -f qcow2 -o encrypt.format=aes demo.qcow2
>
> Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
> +    if (encryptfmt) {
> +        buf = qemu_opt_get_del(opts, BLOCK_OPT_ENCRYPT);
> +        if (buf != NULL) {
> +            g_free(buf);

If you use qemu_opt_get() instead then you don't need "buf" at all, do
you?

> +    if (encryptfmt) {
> +        buf = qemu_opt_get_del(opts, BLOCK_OPT_ENCRYPT);
> +        if (buf != NULL) {
> +            g_free(buf);

Same here.

Everything else looks fine.

Reviewed-by: Alberto Garcia <be...@igalia.com>

Berto

Reply via email to