[RFC,1/4] block/backup: delete target after completion callback

Submitted by Fam Zheng on July 29, 2013, 4:25 a.m.

Details

Message ID 1375071932-31627-2-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng July 29, 2013, 4:25 a.m.
Move bdrv_delete(target) one line down to give block job caller a chance
to handle target on completion before deleting it.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/backup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eric Blake Aug. 21, 2013, 6:37 p.m.
On 07/28/2013 10:25 PM, Fam Zheng wrote:
> Move bdrv_delete(target) one line down to give block job caller a chance
> to handle target on completion before deleting it.
> 
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block/backup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

Patch hide | download patch | download mbox

diff --git a/block/backup.c b/block/backup.c
index 6ae8a05..d80341c 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -338,9 +338,9 @@  static void coroutine_fn backup_run(void *opaque)
     hbitmap_free(job->bitmap);
 
     bdrv_iostatus_disable(target);
-    bdrv_delete(target);
 
     block_job_completed(&job->common, ret);
+    bdrv_delete(target);
 }
 
 void backup_start(BlockDriverState *bs, BlockDriverState *target,