Received: from eggs.gnu.org ([2001:4830:134:3::10]:35782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5XAn-0004rF-Kr for qemu-devel@nongnu.org; Wed, 25 May 2016 07:40:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5XAl-0004mz-N0 for qemu-devel@nongnu.org; Wed, 25 May 2016 07:40:24 -0400 From: Alberto Garcia In-Reply-To: <1464097654-12977-5-git-send-email-kwolf@redhat.com> References: <1464097654-12977-1-git-send-email-kwolf@redhat.com> <1464097654-12977-5-git-send-email-kwolf@redhat.com> Date: Wed, 25 May 2016 13:40:09 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 04/14] block: Convert block job core to BlockBackend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: mreitz@redhat.com, jcody@redhat.com, jsnow@redhat.com, qemu-devel@nongnu.org On Tue 24 May 2016 03:47:24 PM CEST, Kevin Wolf wrote: > This adds a new BlockBackend field to the BlockJob struct, which > coexists with the BlockDriverState while converting the individual jobs. > > When creating a block job, a new BlockBackend is created on top of the > given BlockDriverState, and it is destroyed when the BlockJob ends. The > reference to the BDS is now held by the BlockBackend instead of calling > bdrv_ref/unref manually. > > We have to be careful when we use bdrv_replace_in_backing_chain() in > block jobs because this changes the BDS that job->blk points to. At the > moment block jobs are too tightly coupled with their BDS, so that moving > a job to another BDS isn't easily possible; therefore, we need to just > manually undo this change afterwards. > > Signed-off-by: Kevin Wolf Reviewed-by: Alberto Garcia Berto