Re: [Qemu-devel] [PATCH v10 04/16] block: Use block_job_add_bdrv() in backup_start()

2016-10-12 Thread Alberto Garcia
On Wed 12 Oct 2016 03:47:34 PM CEST, Kevin Wolf  wrote:
> Am 06.10.2016 um 15:02 hat Alberto Garcia geschrieben:
>> Use block_job_add_bdrv() instead of blocking all operations in
>> backup_start() and unblocking them in backup_run().
>> 
>> Signed-off-by: Alberto Garcia 
>
> This has the same problem as mirror (dataplane must be blocked).

Yeah, I think I'll keep dataplane blocked in all cases except in
block_job_create(). BLOCK_OP_TYPE_DATAPLANE is only checked in root
nodes anyway.

Berto



Re: [Qemu-devel] [PATCH v10 04/16] block: Use block_job_add_bdrv() in backup_start()

2016-10-12 Thread Kevin Wolf
Am 06.10.2016 um 15:02 hat Alberto Garcia geschrieben:
> Use block_job_add_bdrv() instead of blocking all operations in
> backup_start() and unblocking them in backup_run().
> 
> Signed-off-by: Alberto Garcia 

This has the same problem as mirror (dataplane must be blocked).

Kevin



[Qemu-devel] [PATCH v10 04/16] block: Use block_job_add_bdrv() in backup_start()

2016-10-06 Thread Alberto Garcia
Use block_job_add_bdrv() instead of blocking all operations in
backup_start() and unblocking them in backup_run().

Signed-off-by: Alberto Garcia 
---
 block/backup.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/block/backup.c b/block/backup.c
index 582bd0f..3a9cb7f 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -427,7 +427,6 @@ static void coroutine_fn backup_run(void *opaque)
 BackupBlockJob *job = opaque;
 BackupCompleteData *data;
 BlockDriverState *bs = blk_bs(job->common.blk);
-BlockBackend *target = job->target;
 int64_t start, end;
 int64_t sectors_per_cluster = cluster_size_sectors(job);
 int ret = 0;
@@ -514,8 +513,6 @@ static void coroutine_fn backup_run(void *opaque)
 qemu_co_rwlock_unlock(>flush_rwlock);
 g_free(job->done_bitmap);
 
-bdrv_op_unblock_all(blk_bs(target), job->common.blocker);
-
 data = g_malloc(sizeof(*data));
 data->ret = ret;
 block_job_defer_to_main_loop(>common, backup_complete, data);
@@ -629,7 +626,7 @@ void backup_start(const char *job_id, BlockDriverState *bs,
 job->cluster_size = MAX(BACKUP_CLUSTER_SIZE_DEFAULT, bdi.cluster_size);
 }
 
-bdrv_op_block_all(target, job->common.blocker);
+block_job_add_bdrv(>common, target);
 job->common.len = len;
 job->common.co = qemu_coroutine_create(backup_run, job);
 block_job_txn_add_job(txn, >common);
-- 
2.9.3