[RFC qemu 3/6] mirror: add check for bitmap-mode without bitmap

Fabian Grünbichler posted 6 patches 5 years, 11 months ago
Maintainers: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>, John Snow <jsnow@redhat.com>
There is a newer version of this series
[RFC qemu 3/6] mirror: add check for bitmap-mode without bitmap
Posted by Fabian Grünbichler 5 years, 11 months ago
as one without the other does not make much sense with the current set
of modes.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 blockdev.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/blockdev.c b/blockdev.c
index 8f7b7ba5eb..23df9f76ba 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3868,6 +3868,9 @@ static void blockdev_mirror_common(const char *job_id, BlockDriverState *bs,
         if (bdrv_dirty_bitmap_check(bitmap, BDRV_BITMAP_ALLOW_RO, errp)) {
             return;
         }
+    } else if (has_bitmap_mode) {
+        error_setg(errp, "Cannot specify bitmap sync mode without a bitmap");
+        return;
     }
 
     if (has_replaces) {
-- 
2.20.1