Patchwork [v10,11/11] block: Allow backup on referenced named BlockDriverState

mail settings
Submitter Fam Zheng
Date Jan. 8, 2014, 3:42 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/307994/
State New
Headers show


Fam Zheng - Jan. 8, 2014, 3:42 a.m.
Drive backup is a read only operation on source bs. We want to allow
this specific case to enable image-fleecing. Note that when
image-fleecing job starts, the job still add its blocker to source bs,
and any other operation on it will be blocked by that.

Signed-off-by: Fam Zheng <>
 block.c | 2 ++
 1 file changed, 2 insertions(+)


diff --git a/block.c b/block.c
index b28fb93..1bc00ef 100644
--- a/block.c
+++ b/block.c
@@ -988,6 +988,8 @@  void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd)
     /* Otherwise we won't be able to commit due to check in bdrv_commit */
     bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_COMMIT,
+    bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_BACKUP_SOURCE,
+                    bs->backing_blocker);
     pstrcpy(bs->backing_file, sizeof(bs->backing_file),
     pstrcpy(bs->backing_format, sizeof(bs->backing_format),