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

d76c62
From 2eb309fcc6bc22e5eff4fe048683176056a43a94 Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <2eb309fcc6bc22e5eff4fe048683176056a43a94@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Mon, 16 Mar 2020 22:12:26 +0100
d76c62
Subject: [PATCH] qemublocktest: Add more tests for block-commit bitmap
d76c62
 handling with snapshots
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
Test handling of more complex cases of merging bitmaps accross
d76c62
snapshots.
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Eric Blake <eblake@redhat.com>
d76c62
(cherry picked from commit 8f096cd8808b186d451ec100c646dc8ddd974735)
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1799013
d76c62
Message-Id: <45bfd1540594f663240f64a58a369c31cd83e607.1584391727.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 tests/qemublocktest.c                         |  15 ++
d76c62
 .../bitmapblockcommit/snapshots-1-2           |  49 +++++++
d76c62
 .../bitmapblockcommit/snapshots-1-3           |  76 ++++++++++
d76c62
 .../bitmapblockcommit/snapshots-1-4           | 126 +++++++++++++++++
d76c62
 .../bitmapblockcommit/snapshots-1-5           | 130 ++++++++++++++++++
d76c62
 .../bitmapblockcommit/snapshots-2-3           |  49 +++++++
d76c62
 .../bitmapblockcommit/snapshots-2-4           |  99 +++++++++++++
d76c62
 .../bitmapblockcommit/snapshots-2-5           | 103 ++++++++++++++
d76c62
 .../bitmapblockcommit/snapshots-3-4           |  72 ++++++++++
d76c62
 .../bitmapblockcommit/snapshots-3-5           |  76 ++++++++++
d76c62
 .../bitmapblockcommit/snapshots-4-5           |  33 +++++
d76c62
 11 files changed, 828 insertions(+)
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5
d76c62
 create mode 100644 tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5
d76c62
d76c62
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
d76c62
index 63ac80b584..ad68b37c80 100644
d76c62
--- a/tests/qemublocktest.c
d76c62
+++ b/tests/qemublocktest.c
d76c62
@@ -1392,6 +1392,21 @@ mymain(void)
d76c62
     TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic");
d76c62
     TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic");
d76c62
 
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-2", 1, 2, "snapshots");
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-3", 1, 3, "snapshots");
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-4", 1, 4, "snapshots");
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-1-5", 1, 5, "snapshots");
d76c62
+
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-2-3", 2, 3, "snapshots");
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-2-4", 2, 4, "snapshots");
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-2-5", 2, 5, "snapshots");
d76c62
+
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-3-4", 3, 4, "snapshots");
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-3-5", 3, 5, "snapshots");
d76c62
+
d76c62
+    TEST_BITMAP_BLOCKCOMMIT("snapshots-4-5", 4, 5, "snapshots");
d76c62
+
d76c62
+
d76c62
  cleanup:
d76c62
     qemuTestDriverFree(&driver);
d76c62
     VIR_FREE(capslatest_x86_64);
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2
d76c62
new file mode 100644
d76c62
index 0000000000..0015b9ceb3
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-2
d76c62
@@ -0,0 +1,49 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-2-format",
d76c62
+      "name": "d"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-2-format",
d76c62
+      "name": "current",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-2-format",
d76c62
+      "target": "current",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "current"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-2-format",
d76c62
+      "target": "d",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "d"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3
d76c62
new file mode 100644
d76c62
index 0000000000..5691b408aa
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-3
d76c62
@@ -0,0 +1,76 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "name": "c"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "name": "current",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "target": "current",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "current"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "name": "d",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "target": "d",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "d"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "d"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4
d76c62
new file mode 100644
d76c62
index 0000000000..454001531a
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-4
d76c62
@@ -0,0 +1,126 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "a",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "a"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "b",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "b",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "b"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "current",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "current",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "current"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "c",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "c"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "d",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "d",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "d"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "d"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5
d76c62
new file mode 100644
d76c62
index 0000000000..2fd43d7917
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-1-5
d76c62
@@ -0,0 +1,130 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "a",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "a"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-4-format",
d76c62
+          "name": "a"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "b",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "b",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "b"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "current",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "current",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "current"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "c",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "c"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "d",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "d",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-1-format",
d76c62
+          "name": "d"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "d"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3
d76c62
new file mode 100644
d76c62
index 0000000000..d719a90bd7
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-3
d76c62
@@ -0,0 +1,49 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "name": "c"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "name": "d",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-3-format",
d76c62
+      "target": "d",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "d"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4
d76c62
new file mode 100644
d76c62
index 0000000000..9e37962344
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-4
d76c62
@@ -0,0 +1,99 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "a",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "a"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "b",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "b",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "b"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "c",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "c"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "d",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "d",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "d"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5
d76c62
new file mode 100644
d76c62
index 0000000000..d6b20a5d05
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-2-5
d76c62
@@ -0,0 +1,103 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "a",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "a"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-4-format",
d76c62
+          "name": "a"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "b",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "b",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "b"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "c",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "c"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "d",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "d",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-2-format",
d76c62
+          "name": "d"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4
d76c62
new file mode 100644
d76c62
index 0000000000..b96e8910d7
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-4
d76c62
@@ -0,0 +1,72 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "a",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "a"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "b",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "b",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "b"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "name": "c",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-4-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5
d76c62
new file mode 100644
d76c62
index 0000000000..9570c34c40
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-3-5
d76c62
@@ -0,0 +1,76 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "a",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "a"
d76c62
+        },
d76c62
+        {
d76c62
+          "node": "libvirt-4-format",
d76c62
+          "name": "a"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "b",
d76c62
+      "persistent": true,
d76c62
+      "disabled": true,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "b",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "b"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-add",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "c",
d76c62
+      "persistent": true,
d76c62
+      "disabled": false,
d76c62
+      "granularity": 65536
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "c",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-3-format",
d76c62
+          "name": "c"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5
d76c62
new file mode 100644
d76c62
index 0000000000..7e1020d96e
d76c62
--- /dev/null
d76c62
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-4-5
d76c62
@@ -0,0 +1,33 @@
d76c62
+pre job bitmap disable:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-disable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
+merge bitmpas:
d76c62
+[
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-enable",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "name": "a"
d76c62
+    }
d76c62
+  },
d76c62
+  {
d76c62
+    "type": "block-dirty-bitmap-merge",
d76c62
+    "data": {
d76c62
+      "node": "libvirt-5-format",
d76c62
+      "target": "a",
d76c62
+      "bitmaps": [
d76c62
+        {
d76c62
+          "node": "libvirt-4-format",
d76c62
+          "name": "a"
d76c62
+        }
d76c62
+      ]
d76c62
+    }
d76c62
+  }
d76c62
+]
d76c62
-- 
d76c62
2.25.1
d76c62