Received: from eggs.gnu.org ([2001:4830:134:3::10]:56100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS1Wp-0005FC-B6 for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:23:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS1Wk-0002J8-7c for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:23:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS1Wj-0002Iu-VU for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:22:58 -0400 From: Markus Armbruster References: <1410336832-22160-1-git-send-email-armbru@redhat.com> <1410336832-22160-3-git-send-email-armbru@redhat.com> <20140910124042.GC22376@irqsave.net> <20140910124644.GD22376@irqsave.net> Date: Thu, 11 Sep 2014 12:22:54 +0200 In-Reply-To: <20140910124644.GD22376@irqsave.net> (=?utf-8?Q?=22Beno=C3=AE?= =?utf-8?Q?t?= Canet"'s message of "Wed, 10 Sep 2014 14:46:44 +0200") Message-ID: <87bnqmsbgh.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/23] block: New BlockBackend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Beno=C3=AEt?= Canet Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Beno=C3=AEt Canet writes: > The Wednesday 10 Sep 2014 =C3=A0 14:40:42 (+0200), Beno=C3=AEt Canet wrot= e : >> The Wednesday 10 Sep 2014 =C3=A0 10:13:31 (+0200), Markus Armbruster wro= te : [...] >> > diff --git a/qemu-img.c b/qemu-img.c >> > index 4490a22..bad3f64 100644 >> > --- a/qemu-img.c >> > +++ b/qemu-img.c >> > @@ -29,6 +29,7 @@ >> > #include "qemu/error-report.h" >> > #include "qemu/osdep.h" >> > #include "sysemu/sysemu.h" >> > +#include "sysemu/block-backend.h" >> > #include "block/block_int.h" >> > #include "block/qapi.h" >> > #include >> > @@ -575,6 +576,7 @@ static int img_check(int argc, char **argv) >> > int c, ret; >> > OutputFormat output_format =3D OFORMAT_HUMAN; >> > const char *filename, *fmt, *output, *cache; >> > + BlockBackend *blk; >> > BlockDriverState *bs; >> > int fix =3D 0; >> > int flags =3D BDRV_O_FLAGS | BDRV_O_CHECK; >> > @@ -649,6 +651,7 @@ static int img_check(int argc, char **argv) >> > return 1; >> > } >> >=20=20 >>=20 >> > + blk =3D blk_new("image", &error_abort); >> Hmm we are so sure this will work that we don't do if (!block) ? > > Ok I understood we are sure because we control the id and won't use twice= the same. Exactly! [...]