diff options
Diffstat (limited to 'blockdev.c')
-rw-r--r-- | blockdev.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c index f889da0b42..64d06d1f67 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3567,6 +3567,28 @@ static BlockJob *do_backup_common(BackupCommon *backup, if (bdrv_dirty_bitmap_check(bmap, BDRV_BITMAP_ALLOW_RO, errp)) { return NULL; } + + /* This does not produce a useful bitmap artifact: */ + if (backup->sync == MIRROR_SYNC_MODE_NONE) { + error_setg(errp, "sync mode '%s' does not produce meaningful bitmap" + " outputs", MirrorSyncMode_str(backup->sync)); + return NULL; + } + + /* If the bitmap isn't used for input or output, this is useless: */ + if (backup->bitmap_mode == BITMAP_SYNC_MODE_NEVER && + backup->sync != MIRROR_SYNC_MODE_BITMAP) { + error_setg(errp, "Bitmap sync mode '%s' has no meaningful effect" + " when combined with sync mode '%s'", + BitmapSyncMode_str(backup->bitmap_mode), + MirrorSyncMode_str(backup->sync)); + return NULL; + } + } + + if (!backup->has_bitmap && backup->has_bitmap_mode) { + error_setg(errp, "Cannot specify bitmap sync mode without a bitmap"); + return NULL; } if (!backup->auto_finalize) { |