Blame SOURCES/libvirt-qemublocktest-Add-snapshots-tests-for-block-commit-bitmap-handling.patch

b971b8
From 59a754b5c95a4795178d2a117abb7f7145c830a4 Mon Sep 17 00:00:00 2001
b971b8
Message-Id: <59a754b5c95a4795178d2a117abb7f7145c830a4@dist-git>
b971b8
From: Peter Krempa <pkrempa@redhat.com>
b971b8
Date: Tue, 23 Jun 2020 12:24:02 +0200
b971b8
Subject: [PATCH] qemublocktest: Add 'snapshots' tests for block commit bitmap
b971b8
 handling
b971b8
MIME-Version: 1.0
b971b8
Content-Type: text/plain; charset=UTF-8
b971b8
Content-Transfer-Encoding: 8bit
b971b8
b971b8
Simulate commit between all the combinations of layers in the
b971b8
'snapshots' case to see whether the code merges the correct bitmaps with
b971b8
the correct depth of temporary bitmaps.
b971b8
b971b8
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
b971b8
Reviewed-by: Eric Blake <eblake@redhat.com>
b971b8
(cherry picked from commit b5eaabfbf892c8d4a30b2822325959a6ecb93cb6)
b971b8
https://bugzilla.redhat.com/show_bug.cgi?id=1804593
b971b8
Message-Id: <e2a3ce231bab06d274039daf7cdebd086b2a5691.1592906423.git.pkrempa@redhat.com>
b971b8
Reviewed-by: Ján Tomko <jtomko@redhat.com>
b971b8
---
b971b8
 tests/qemublocktest.c                         |  14 ++
b971b8
 .../bitmapblockcommit/snapshots-1-2           | 105 +++++++++++
b971b8
 .../bitmapblockcommit/snapshots-1-3           | 131 ++++++++++++++
b971b8
 .../bitmapblockcommit/snapshots-1-4           | 163 +++++++++++++++++
b971b8
 .../bitmapblockcommit/snapshots-1-5           | 167 ++++++++++++++++++
b971b8
 .../bitmapblockcommit/snapshots-2-3           |  65 +++++++
b971b8
 .../bitmapblockcommit/snapshots-2-4           |  97 ++++++++++
b971b8
 .../bitmapblockcommit/snapshots-2-5           | 101 +++++++++++
b971b8
 .../bitmapblockcommit/snapshots-3-4           |  62 +++++++
b971b8
 .../bitmapblockcommit/snapshots-3-5           |  66 +++++++
b971b8
 .../bitmapblockcommit/snapshots-4-5           |  16 ++
b971b8
 11 files changed, 987 insertions(+)
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5
b971b8
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5
b971b8
b971b8
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
b971b8
index 43abc49534..e1468f13fa 100644
b971b8
--- a/tests/qemublocktest.c
b971b8
+++ b/tests/qemublocktest.c
b971b8
@@ -1361,6 +1361,20 @@ mymain(void)
b971b8
     TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic");
b971b8
     TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic");
b971b8
 
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-2", 1, 2, "snapshots");
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-3", 1, 3, "snapshots");
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-4", 1, 4, "snapshots");
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-5", 1, 5, "snapshots");
b971b8
+
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-2-3", 2, 3, "snapshots");
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-2-4", 2, 4, "snapshots");
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-2-5", 2, 5, "snapshots");
b971b8
+
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-3-4", 3, 4, "snapshots");
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-3-5", 3, 5, "snapshots");
b971b8
+
b971b8
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-4-5", 4, 5, "snapshots");
b971b8
+
b971b8
  cleanup:
b971b8
     qemuTestDriverFree(&driver);
b971b8
     VIR_FREE(capslatest_x86_64);
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2
b971b8
new file mode 100644
b971b8
index 0000000000..7d5b0a4402
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2
b971b8
@@ -0,0 +1,105 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-2-format",
b971b8
+      "name": "current",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-2-format",
b971b8
+      "target": "current",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "current"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-2-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-2-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-2-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-2-format",
b971b8
+      "target": "d",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "d"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-remove",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-2-format",
b971b8
+      "name": "libvirt-tmp-activewrite"
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3
b971b8
new file mode 100644
b971b8
index 0000000000..17a020ba20
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3
b971b8
@@ -0,0 +1,131 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "name": "current",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "current",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "current"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "name": "d",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "d",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "d"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "d"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-remove",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "name": "libvirt-tmp-activewrite"
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4
b971b8
new file mode 100644
b971b8
index 0000000000..972d30b2e1
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4
b971b8
@@ -0,0 +1,163 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "current",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "current",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "current"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "c",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "b",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "d",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "d",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "d"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "d"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-remove",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "libvirt-tmp-activewrite"
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5
b971b8
new file mode 100644
b971b8
index 0000000000..3cda5b4132
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5
b971b8
@@ -0,0 +1,167 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "current",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "current",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "current"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-5-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "c",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-5-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "b",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-5-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-5-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "d",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "d",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-1-format",
b971b8
+          "name": "d"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "d"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-5-format",
b971b8
+          "name": "libvirt-tmp-activewrite"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-remove",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "libvirt-tmp-activewrite"
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3
b971b8
new file mode 100644
b971b8
index 0000000000..cb952eeb06
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3
b971b8
@@ -0,0 +1,65 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "name": "d",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "d",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "d"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "a"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "b"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-3-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "c"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4
b971b8
new file mode 100644
b971b8
index 0000000000..a540ca42e3
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4
b971b8
@@ -0,0 +1,97 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "d",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "d",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "d"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "a"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "b",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "b"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "c",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "c"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5
b971b8
new file mode 100644
b971b8
index 0000000000..8ea6036a33
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5
b971b8
@@ -0,0 +1,101 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "d",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "d",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "d"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "a"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "b",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "b"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "b"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "c",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-2-format",
b971b8
+          "name": "c"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "c"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4
b971b8
new file mode 100644
b971b8
index 0000000000..736d4fd9df
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4
b971b8
@@ -0,0 +1,62 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "c",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "c"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "name": "b",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "b"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-4-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "a"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5
b971b8
new file mode 100644
b971b8
index 0000000000..207d82e6b6
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5
b971b8
@@ -0,0 +1,66 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "c",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "c",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "c"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-add",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "name": "b",
b971b8
+      "persistent": true,
b971b8
+      "disabled": false,
b971b8
+      "granularity": 65536
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "b",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "b"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  },
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-3-format",
b971b8
+          "name": "a"
b971b8
+        },
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "a"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5
b971b8
new file mode 100644
b971b8
index 0000000000..4a8e6c5cff
b971b8
--- /dev/null
b971b8
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5
b971b8
@@ -0,0 +1,16 @@
b971b8
+merge bitmpas:
b971b8
+[
b971b8
+  {
b971b8
+    "type": "block-dirty-bitmap-merge",
b971b8
+    "data": {
b971b8
+      "node": "libvirt-5-format",
b971b8
+      "target": "a",
b971b8
+      "bitmaps": [
b971b8
+        {
b971b8
+          "node": "libvirt-4-format",
b971b8
+          "name": "a"
b971b8
+        }
b971b8
+      ]
b971b8
+    }
b971b8
+  }
b971b8
+]
b971b8
-- 
b971b8
2.27.0
b971b8