block/backup: loosen restriction on readonly bitmaps
With the "never" sync policy, we actually can utilize readonly bitmaps now. Loosen the check at the QMP level, and tighten it based on provided arguments down at the job creation level instead. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-19-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
dfdc48d5e2
commit
b30ffbef53
@ -617,6 +617,12 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we need to write to this bitmap, check that we can: */
|
||||||
|
if (bitmap_mode != BITMAP_SYNC_MODE_NEVER &&
|
||||||
|
bdrv_dirty_bitmap_check(sync_bitmap, BDRV_BITMAP_DEFAULT, errp)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create a new bitmap, and freeze/disable this one. */
|
/* Create a new bitmap, and freeze/disable this one. */
|
||||||
if (bdrv_dirty_bitmap_create_successor(bs, sync_bitmap, errp) < 0) {
|
if (bdrv_dirty_bitmap_create_successor(bs, sync_bitmap, errp) < 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -3491,7 +3491,7 @@ static BlockJob *do_backup_common(BackupCommon *backup,
|
|||||||
"when providing a bitmap");
|
"when providing a bitmap");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_DEFAULT, errp)) {
|
if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_ALLOW_RO, errp)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user