qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH] Wrong error message in block_passwd command


From: Kevin Wolf
Subject: [Qemu-devel] Re: [PATCH] Wrong error message in block_passwd command
Date: Fri, 05 Mar 2010 16:22:55 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Thunderbird/3.0.1

Am 05.03.2010 16:12, schrieb Shahar Havivi:
> Monitor command 'block_passwd' reports a wrong error message when
> drive is not encrypted
> 
> Signed-off-by: Shahar Havivi <address@hidden>
> ---
>  block.c   |    9 ++++++---
>  monitor.c |    7 ++++++-
>  qerror.c  |    4 ++++
>  qerror.h  |    3 +++
>  4 files changed, 19 insertions(+), 4 deletions(-)
> 
> diff --git a/block.c b/block.c
> index 31d1ba4..dd484fa 100644
> --- a/block.c
> +++ b/block.c
> @@ -1132,10 +1132,13 @@ int bdrv_set_key(BlockDriverState *bs, const char 
> *key)
>          if (ret < 0)
>              return ret;
>          if (!bs->encrypted)
> -            return 0;
> +            return -EINVAL;
> +    }

I think this part is wrong actually. Sorry for not catching it when you
sent me the patch first.

The logic here is that it's not an error to set the password for a file
which isn't encrypted itself, but its backing file is. In this case the
key is only set for the backing file and we return success.

The other parts look good to me.

Kevin




reply via email to

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