From a6c9365ad4ba26b274bb4b7491f99b05bb765d76 Mon Sep 17 00:00:00 2001 From: John Snow Date: Mon, 29 Jul 2019 16:35:55 -0400 Subject: block/backup: hoist bitmap check into QMP interface This is nicer to do in the unified QMP interface that we have now, because it lets us use the right terminology back at the user. Signed-off-by: John Snow Reviewed-by: Max Reitz Message-id: 20190716000117.25219-5-jsnow@redhat.com Signed-off-by: John Snow --- blockdev.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'blockdev.c') diff --git a/blockdev.c b/blockdev.c index 210226d829..f889da0b42 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3529,6 +3529,16 @@ static BlockJob *do_backup_common(BackupCommon *backup, return NULL; } + if ((backup->sync == MIRROR_SYNC_MODE_BITMAP) || + (backup->sync == MIRROR_SYNC_MODE_INCREMENTAL)) { + /* done before desugaring 'incremental' to print the right message */ + if (!backup->has_bitmap) { + error_setg(errp, "must provide a valid bitmap name for " + "'%s' sync mode", MirrorSyncMode_str(backup->sync)); + return NULL; + } + } + if (backup->sync == MIRROR_SYNC_MODE_INCREMENTAL) { if (backup->has_bitmap_mode && backup->bitmap_mode != BITMAP_SYNC_MODE_ON_SUCCESS) { -- cgit v1.2.3-55-g7522