diff mbox

[v6,10/10] block: Allow backup on referenced named BlockDriverState

Message ID 1385627982-14675-11-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng Nov. 28, 2013, 8:39 a.m. UTC
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 <famz@redhat.com>
---
 block.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/block.c b/block.c
index 25ef5c8..68bf72c 100644
--- a/block.c
+++ b/block.c
@@ -1036,6 +1036,8 @@  int bdrv_open_backing_file(BlockDriverState *bs, const char *backing_bs,
     /* Otherwise we won't be able to commit due to check in bdrv_commit */
     bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_COMMIT,
                     bs->backing_blocker);
+    bdrv_op_unblock(bs->backing_hd, BLOCK_OP_TYPE_BACKUP_SOURCE,
+                    bs->backing_blocker);
     pstrcpy(bs->backing_file, sizeof(bs->backing_file),
             bs->backing_hd->file->filename);
     pstrcpy(bs->backing_format, sizeof(bs->backing_format),