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

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