[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 04/14] block: Convert block job core to Block
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 04/14] block: Convert block job core to BlockBackend |
Date: |
Tue, 24 May 2016 18:17:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 05/24/2016 07:47 AM, 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 <address@hidden>
> ---
> block/mirror.c | 3 +++
> blockjob.c | 37 ++++++++++++++++++++-----------------
> include/block/blockjob.h | 3 ++-
> 3 files changed, 25 insertions(+), 18 deletions(-)
>
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v2 00/14] block jobs: Convert I/O to BlockBackend, Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 03/14] block: Default to enabled write cache in blk_new(), Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 02/14] block: Cancel jobs first in bdrv_close_all(), Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 01/14] block: keep a list of block jobs, Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 04/14] block: Convert block job core to BlockBackend, Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 09/14] backup: Don't leak BackupBlockJob in error path, Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 10/14] backup: Pack Notifier within BackupBlockJob, Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 07/14] mirror: Allow target that already has a BlockBackend, Kevin Wolf, 2016/05/24
- [Qemu-devel] [PATCH v2 08/14] mirror: Use BlockBackend for I/O, Kevin Wolf, 2016/05/24