Received: from eggs.gnu.org ([2001:4830:134:3::10]:47034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTtKT-00081l-Hk for qemu-devel@nongnu.org; Tue, 16 Sep 2014 10:02:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTtKP-0008Oh-0A for qemu-devel@nongnu.org; Tue, 16 Sep 2014 10:02:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30245) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTtKO-0008OA-OP for qemu-devel@nongnu.org; Tue, 16 Sep 2014 10:01:56 -0400 From: Markus Armbruster References: <1410620427-20089-1-git-send-email-armbru@redhat.com> <1410620427-20089-7-git-send-email-armbru@redhat.com> <20140916125644.GC27495@nodalink.com> Date: Tue, 16 Sep 2014 16:01:47 +0200 In-Reply-To: <20140916125644.GC27495@nodalink.com> (=?utf-8?Q?=22Beno?= =?utf-8?Q?=C3=AEt?= Canet"'s message of "Tue, 16 Sep 2014 12:56:44 +0000") Message-ID: <87fvfrk6k4.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 v2 06/23] block: Make BlockBackend own its BlockDriverState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?utf-8?Q?Beno=C3=AEt?= Canet Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Beno=C3=AEt Canet writes: >> /* blkdev->bs is not create by us, we get a reference >> * so we can bdrv_unref() unconditionally */ >> - bdrv_ref(blkdev->bs); > >> + /* Except we don't bdrv_unref() anymore, we blk_unref(). > Is this dot extra ? ^ No, I wrote two sentences intentionally. The whole comment gets replaced in PATCH 14. > The following line seems to make better sense without this dot and the > initial cap. >> + * Conditionally, because we can't easily blk_ref() here. > >> @@ -712,9 +711,7 @@ static int img_check(int argc, char **argv) >>=20=20 >> fail: >> qapi_free_ImageCheck(check); >> - bdrv_unref(bs); >> blk_unref(blk); >> - > Spurious blank line removal here. Intentional. Without it, the code looks like this: if (check->corruptions) { ret =3D 2; } else if (check->leaks) { ret =3D 3; } else { ret =3D 0; } fail: qapi_free_ImageCheck(check); blk_unref(blk); return ret; } I don't think the blank line helps readability here. >> @@ -483,9 +481,6 @@ int main(int argc, char **argv) >> */ >> bdrv_drain_all(); >>=20=20 >> - if (qemuio_bs) { >> - bdrv_unref(qemuio_bs); >> - } >> blk_unref(qemuio_blk); >> g_free(readline_state); >> return 0; >> diff --git a/qemu-nbd.c b/qemu-nbd.c >> index fa8a7d0..0c496af 100644 >> --- a/qemu-nbd.c >> +++ b/qemu-nbd.c >> @@ -771,7 +771,6 @@ int main(int argc, char **argv) > > Well that does seems to simplify things a lot. :)