Received: from eggs.gnu.org ([2001:4830:134:3::10]:34286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS1zZ-0004mb-8F for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:52:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS1zU-0004Hk-56 for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:52:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS1zT-0004HY-Tv for qemu-devel@nongnu.org; Thu, 11 Sep 2014 06:52:40 -0400 From: Markus Armbruster References: <1410336832-22160-1-git-send-email-armbru@redhat.com> <1410336832-22160-4-git-send-email-armbru@redhat.com> <20140910115524.GB22376@irqsave.net> Date: Thu, 11 Sep 2014 12:52:35 +0200 In-Reply-To: <20140910115524.GB22376@irqsave.net> (=?utf-8?Q?=22Beno=C3=AE?= =?utf-8?Q?t?= Canet"'s message of "Wed, 10 Sep 2014 13:55:25 +0200") Message-ID: <874mwesa30.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 03/23] block: Connect BlockBackend to 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, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Beno=C3=AEt Canet writes: > The Wednesday 10 Sep 2014 =C3=A0 10:13:32 (+0200), Markus Armbruster wrot= e : >> The pointer from BlockBackend to BlockDriverState is a strong >> reference, managed with bdrv_ref() / bdrv_unref(), the back-pointer is >> a weak one. >>=20 >> Convenience function blk_new_with_bs() creates a BlockBackend with its >> BlockDriverState. Callers have to unref both. The commit after next >> will relieve them of the need to unref the BlockDriverState. >>=20 >> Signed-off-by: Markus Armbruster >> --- >> block.c | 10 ++-- >> block/block-backend.c | 79 +++++++++++++++++++++++++++++++ >> blockdev.c | 49 +++++++++++--------- >> hw/block/xen_disk.c | 8 +--- >> include/block/block_int.h | 2 + >> include/sysemu/block-backend.h | 5 ++ >> qemu-img.c | 103 +++++++++++++++++++++-------------= ------- >> qemu-io.c | 4 +- >> qemu-nbd.c | 3 +- >> 9 files changed, 175 insertions(+), 88 deletions(-) >>=20 >> diff --git a/block.c b/block.c >> index 4b3bcd4..a6c03da 100644 >> --- a/block.c >> +++ b/block.c >> @@ -2032,7 +2032,7 @@ static void bdrv_move_feature_fields(BlockDriverSt= ate *bs_dest, >> * This will modify the BlockDriverState fields, and swap contents >> * between bs_new and bs_old. Both bs_new and bs_old are modified. >> * >> - * bs_new is required to be anonymous. >> + * bs_new must be nameless and not attached to a BlockBackend. > > 1) > Does "nameless" refer to device_name or node_name ? > From the code I see it's device_name but the wording can be confusing. Yes. It's slightly better than "anonymous", because that really means both device_name and node_name (since commit dc364f4). The "nameless" part will go away in PATCH 08, so I'm inclined not to worry about it now. > maybe: > + * bs_new must have an empty device_name and not be attached to a BlockB= ackend. Can do if you think it's necessary.