From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NnZtH-0000xI-9I for qemu-devel@nongnu.org; Fri, 05 Mar 2010 10:56:39 -0500 Received: from [199.232.76.173] (port=38282 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NnZtH-0000x0-00 for qemu-devel@nongnu.org; Fri, 05 Mar 2010 10:56:39 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NnZtF-0003Ks-Da for qemu-devel@nongnu.org; Fri, 05 Mar 2010 10:56:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37158) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NnZtF-0003Ka-03 for qemu-devel@nongnu.org; Fri, 05 Mar 2010 10:56:37 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o25FuYMr022280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 5 Mar 2010 10:56:35 -0500 Date: Fri, 5 Mar 2010 12:56:27 -0300 From: Luiz Capitulino Message-ID: <20100305125627.35020028@redhat.com> In-Reply-To: <20100305154732.GA21444@redhat.com> References: <20100305151222.GA21283@redhat.com> <4B9121CF.6020703@redhat.com> <20100305154732.GA21444@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] Wrong error message in block_passwd command List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Shahar Havivi Cc: Kevin Wolf , Luiz Capitulino , Dor Laor , qemu-devel@nongnu.org On Fri, 5 Mar 2010 17:47:33 +0200 Shahar Havivi wrote: > On Fri, Mar 05, 2010 at 04:22:55PM +0100, Kevin Wolf wrote: > > Date: Fri, 05 Mar 2010 16:22:55 +0100 > > From: Kevin Wolf > > To: Shahar Havivi > > CC: qemu-devel@nongnu.org, Dor Laor , > > Luiz Capitulino > > Subject: Re: [PATCH] Wrong error message in block_passwd command > > > > 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 > > > --- > > > 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 > You right Kevin, > Revert returning error when backing file in bdrv_set_key. Looks good to me too, but it's better to send it as new message, as maintainers can miss patches submitted in the middle of thread.