Received: from eggs.gnu.org ([2001:4830:134:3::10]:40037) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zr0C9-0006MS-Ar for qemu-devel@nongnu.org; Tue, 27 Oct 2015 05:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zr0C8-0008Kh-EN for qemu-devel@nongnu.org; Tue, 27 Oct 2015 05:05:29 -0400 From: Alberto Garcia In-Reply-To: <1445891959-27432-2-git-send-email-mreitz@redhat.com> References: <1445891959-27432-1-git-send-email-mreitz@redhat.com> <1445891959-27432-2-git-send-email-mreitz@redhat.com> Date: Tue, 27 Oct 2015 10:04:55 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v8 01/15] block: Add blk_remove_bs() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-block@nongnu.org Cc: Kevin Wolf , John Snow , Markus Armbruster , qemu-devel@nongnu.org, Stefan Hajnoczi On Mon 26 Oct 2015 09:39:05 PM CET, Max Reitz wrote: > +void blk_remove_bs(BlockBackend *blk) > +{ > + blk_update_root_state(blk); > + > + blk->bs->blk = NULL; > + bdrv_unref(blk->bs); > + blk->bs = NULL; > +} I cannot think of any example out of the blue but I wonder if removing the reference to the BDS (and possibly destroying it) while blk->bs is still pointing to it could be a source of problems. Berto