From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLakv-0002qF-LK for qemu-devel@nongnu.org; Thu, 06 Mar 2014 11:02:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLakn-0000Ty-He for qemu-devel@nongnu.org; Thu, 06 Mar 2014 11:02:45 -0500 Received: from lnantes-156-75-100-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:55854 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLakn-0000Tm-Bs for qemu-devel@nongnu.org; Thu, 06 Mar 2014 11:02:37 -0500 Date: Thu, 6 Mar 2014 17:02:37 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140306160236.GD22291@irqsave.net> References: <1394120669-4675-1-git-send-email-kwolf@redhat.com> <1394120669-4675-2-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1394120669-4675-2-git-send-email-kwolf@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/3] blockdev: Fail blockdev-add with encrypted images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, stefanha@redhat.com, armbru@redhat.com The Thursday 06 Mar 2014 =E0 16:44:27 (+0100), Kevin Wolf wrote : > Encrypted images need a password before they can be used, and we don't > want blockdev-add to create BDSes that aren't fully initialised. So for > now simply forbid encrypted images; we can come back to it later if we > need the functionality. >=20 > Signed-off-by: Kevin Wolf > --- > blockdev.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) >=20 > diff --git a/blockdev.c b/blockdev.c > index 357f760..561cb81 100644 > --- a/blockdev.c > +++ b/blockdev.c > @@ -2266,6 +2266,7 @@ void qmp_block_job_complete(const char *device, E= rror **errp) > void qmp_blockdev_add(BlockdevOptions *options, Error **errp) > { > QmpOutputVisitor *ov =3D qmp_output_visitor_new(); > + DriveInfo *dinfo; > QObject *obj; > QDict *qdict; > Error *local_err =3D NULL; > @@ -2301,12 +2302,18 @@ void qmp_blockdev_add(BlockdevOptions *options,= Error **errp) > =20 > qdict_flatten(qdict); > =20 > - blockdev_init(NULL, qdict, &local_err); > + dinfo =3D blockdev_init(NULL, qdict, &local_err); > if (local_err) { > error_propagate(errp, local_err); > goto fail; > } > =20 > + if (bdrv_key_required(dinfo->bdrv)) { > + drive_uninit(dinfo); > + error_setg(errp, "blockdev-add doesn't support encrypted devic= es"); > + goto fail; This goto fail; is an extra the code will flow to fail anyway. Best regards Beno=EEt > + } > + > fail: > qmp_output_visitor_cleanup(ov); > } > --=20 > 1.8.1.4 >=20 >=20