From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgtuk-000682-Dc for qemu-devel@nongnu.org; Tue, 29 Sep 2015 08:21:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgtuj-0002kn-N9 for qemu-devel@nongnu.org; Tue, 29 Sep 2015 08:21:46 -0400 Date: Tue, 29 Sep 2015 14:21:37 +0200 From: Kevin Wolf Message-ID: <20150929122137.GF3930@noname.str.redhat.com> References: <1442497700-2536-1-git-send-email-kwolf@redhat.com> <1442497700-2536-13-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 12/16] block: Introduce parents list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia Cc: qemu-block@nongnu.org, armbru@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com Am 28.09.2015 um 15:09 hat Alberto Garcia geschrieben: > On Thu 17 Sep 2015 03:48:16 PM CEST, Kevin Wolf wrote: > > > @@ -1090,6 +1090,7 @@ static BdrvChild *bdrv_attach_child(BlockDriverState *parent_bs, > > }; > > > > QLIST_INSERT_HEAD(&parent_bs->children, child, next); > > + QLIST_INSERT_HEAD(&child_bs->parents, child, next_parent); > > > > return child; > > } > > Ok, I'm probably slow today, but what is this used for? :-? And why is > it called 'parents'? The list doesn't contain pointers to the parents of > child_bs, but to child_bs itself... > > I would expect a BdrvChild *parent, with parent->bs = parent_bs. It's the list of BdrvChild objects that point to the given BlockDriverState. This is good enough for updating the pointers. If we ever need the actual parent BDS, we can add a pointer to BdrvChild. Kevin