|
|
a41c76 |
From 433f551418c9b40b5da9bf36abb5f9eba0662369 Mon Sep 17 00:00:00 2001
|
|
|
a41c76 |
Message-Id: <433f551418c9b40b5da9bf36abb5f9eba0662369@dist-git>
|
|
|
a41c76 |
From: Peter Krempa <pkrempa@redhat.com>
|
|
|
a41c76 |
Date: Tue, 23 Jun 2020 12:24:01 +0200
|
|
|
a41c76 |
Subject: [PATCH] qemublocktest: Add 'basic' tests for commit bitmap handling
|
|
|
a41c76 |
MIME-Version: 1.0
|
|
|
a41c76 |
Content-Type: text/plain; charset=UTF-8
|
|
|
a41c76 |
Content-Transfer-Encoding: 8bit
|
|
|
a41c76 |
|
|
|
a41c76 |
In the 'basic' case we have few bitmaps in only the top layer. Simulate
|
|
|
a41c76 |
commit into the backing of the top layer and also 2 levels deep.
|
|
|
a41c76 |
|
|
|
a41c76 |
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
|
|
a41c76 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
a41c76 |
(cherry picked from commit 79bc7c1828212c165d8b71bd6166ca24695a8ecd)
|
|
|
a41c76 |
https://bugzilla.redhat.com/show_bug.cgi?id=1804593
|
|
|
a41c76 |
Message-Id: <9973a947b47bb20fa2e3f03e1a36541c2f1f3018.1592906423.git.pkrempa@redhat.com>
|
|
|
a41c76 |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
|
a41c76 |
---
|
|
|
a41c76 |
tests/qemublocktest.c | 4 +
|
|
|
a41c76 |
.../bitmapblockcommit/basic-1-2 | 145 ++++++++++++++++++
|
|
|
a41c76 |
.../bitmapblockcommit/basic-1-3 | 145 ++++++++++++++++++
|
|
|
a41c76 |
.../bitmapblockcommit/basic-2-3 | 1 +
|
|
|
a41c76 |
4 files changed, 295 insertions(+)
|
|
|
a41c76 |
create mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-1-2
|
|
|
a41c76 |
create mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-1-3
|
|
|
a41c76 |
create mode 100644 tests/qemublocktestdata/bitmapblockcommit/basic-2-3
|
|
|
a41c76 |
|
|
|
a41c76 |
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
|
|
|
a41c76 |
index f0e80a0738..43abc49534 100644
|
|
|
a41c76 |
--- a/tests/qemublocktest.c
|
|
|
a41c76 |
+++ b/tests/qemublocktest.c
|
|
|
a41c76 |
@@ -1357,6 +1357,10 @@ mymain(void)
|
|
|
a41c76 |
|
|
|
a41c76 |
TEST_BITMAP_BLOCKCOMMIT("empty", 1, 2, "empty");
|
|
|
a41c76 |
|
|
|
a41c76 |
+ TEST_BITMAP_BLOCKCOMMIT("basic-1-2", 1, 2, "basic");
|
|
|
a41c76 |
+ TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic");
|
|
|
a41c76 |
+ TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic");
|
|
|
a41c76 |
+
|
|
|
a41c76 |
cleanup:
|
|
|
a41c76 |
qemuTestDriverFree(&driver);
|
|
|
a41c76 |
VIR_FREE(capslatest_x86_64);
|
|
|
a41c76 |
diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-2 b/tests/qemublocktestdata/bitmapblockcommit/basic-1-2
|
|
|
a41c76 |
new file mode 100644
|
|
|
a41c76 |
index 0000000000..d393d31044
|
|
|
a41c76 |
--- /dev/null
|
|
|
a41c76 |
+++ b/tests/qemublocktestdata/bitmapblockcommit/basic-1-2
|
|
|
a41c76 |
@@ -0,0 +1,145 @@
|
|
|
a41c76 |
+merge bitmpas:
|
|
|
a41c76 |
+[
|
|
|
a41c76 |
+ {
|
|
|
a41c76 |
+ "type": "block-dirty-bitmap-add",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-2-format",
|
|
|
a41c76 |
+ "name": "a",
|
|
|
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": "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-add",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-2-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-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-add",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-2-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-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-add",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-2-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-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-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-remove",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-2-format",
|
|
|
a41c76 |
+ "name": "libvirt-tmp-activewrite"
|
|
|
a41c76 |
+ }
|
|
|
a41c76 |
+ }
|
|
|
a41c76 |
+]
|
|
|
a41c76 |
diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-3 b/tests/qemublocktestdata/bitmapblockcommit/basic-1-3
|
|
|
a41c76 |
new file mode 100644
|
|
|
a41c76 |
index 0000000000..3fa902c354
|
|
|
a41c76 |
--- /dev/null
|
|
|
a41c76 |
+++ b/tests/qemublocktestdata/bitmapblockcommit/basic-1-3
|
|
|
a41c76 |
@@ -0,0 +1,145 @@
|
|
|
a41c76 |
+merge bitmpas:
|
|
|
a41c76 |
+[
|
|
|
a41c76 |
+ {
|
|
|
a41c76 |
+ "type": "block-dirty-bitmap-add",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-3-format",
|
|
|
a41c76 |
+ "name": "a",
|
|
|
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": "a",
|
|
|
a41c76 |
+ "bitmaps": [
|
|
|
a41c76 |
+ {
|
|
|
a41c76 |
+ "node": "libvirt-1-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": "b",
|
|
|
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": "b",
|
|
|
a41c76 |
+ "bitmaps": [
|
|
|
a41c76 |
+ {
|
|
|
a41c76 |
+ "node": "libvirt-1-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-add",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-3-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-3-format",
|
|
|
a41c76 |
+ "target": "c",
|
|
|
a41c76 |
+ "bitmaps": [
|
|
|
a41c76 |
+ {
|
|
|
a41c76 |
+ "node": "libvirt-1-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-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-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": "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-remove",
|
|
|
a41c76 |
+ "data": {
|
|
|
a41c76 |
+ "node": "libvirt-3-format",
|
|
|
a41c76 |
+ "name": "libvirt-tmp-activewrite"
|
|
|
a41c76 |
+ }
|
|
|
a41c76 |
+ }
|
|
|
a41c76 |
+]
|
|
|
a41c76 |
diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-2-3 b/tests/qemublocktestdata/bitmapblockcommit/basic-2-3
|
|
|
a41c76 |
new file mode 100644
|
|
|
a41c76 |
index 0000000000..9260011852
|
|
|
a41c76 |
--- /dev/null
|
|
|
a41c76 |
+++ b/tests/qemublocktestdata/bitmapblockcommit/basic-2-3
|
|
|
a41c76 |
@@ -0,0 +1 @@
|
|
|
a41c76 |
+merge bitmpas:
|
|
|
a41c76 |
--
|
|
|
a41c76 |
2.27.0
|
|
|
a41c76 |
|