From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoW16-0003js-RC for qemu-devel@nongnu.org; Mon, 17 Jun 2013 05:46:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoW12-00073B-2i for qemu-devel@nongnu.org; Mon, 17 Jun 2013 05:46:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoW11-00072s-QI for qemu-devel@nongnu.org; Mon, 17 Jun 2013 05:46:23 -0400 Message-ID: <51BEDAEB.3050404@redhat.com> Date: Mon, 17 Jun 2013 11:46:19 +0200 From: Pavel Hrdina MIME-Version: 1.0 References: <20130605132317.GF31478@stefanha-thinkpad.muc.redhat.com> In-Reply-To: <20130605132317.GF31478@stefanha-thinkpad.muc.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/2] block: move the bdrv_dev_change_media_cb() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On 5.6.2013 15:23, Stefan Hajnoczi wrote: > On Wed, May 29, 2013 at 06:18:19PM +0200, Pavel Hrdina wrote: >> @@ -1071,14 +1072,18 @@ static void qmp_bdrv_open_encrypted(BlockDriverState *bs, const char *filename, >> if (password) { >> if (bdrv_set_key(bs, password) < 0) { >> error_set(errp, QERR_INVALID_PASSWORD); >> + return; >> } >> } else { >> error_set(errp, QERR_DEVICE_ENCRYPTED, bdrv_get_device_name(bs), >> bdrv_get_encrypted_filename(bs)); >> + return; >> } >> } else if (password) { >> error_set(errp, QERR_DEVICE_NOT_ENCRYPTED, bdrv_get_device_name(bs)); >> } >> + >> + bdrv_dev_change_media_cb(bs, true); >> } > > Calling bdrv_dev_change_media_cb() after raising > QERR_DEVICE_NOT_ENCRYPTED is intentional? It might warrant a comment. > Sorry for my late answer. It's just a warning, that you used a password for a block device that doesn't require it. The device is opened successfully and should be handled correctly (call the bdrv_dev_change_media_cb() ). Pavel