]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemublocktest: Add 'basic' tests for commit bitmap handling
authorPeter Krempa <pkrempa@redhat.com>
Fri, 29 May 2020 11:01:55 +0000 (13:01 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 22 Jun 2020 14:04:30 +0000 (16:04 +0200)
In the 'basic' case we have few bitmaps in only the top layer. Simulate
commit into the backing of the top layer and also 2 levels deep.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
tests/qemublocktest.c
tests/qemublocktestdata/bitmapblockcommit/basic-1-2 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/basic-1-3 [new file with mode: 0644]
tests/qemublocktestdata/bitmapblockcommit/basic-2-3 [new file with mode: 0644]

index 5be98b9320278d4352e7b887b62bcb9fd10907d0..1a8ce3b73df59c44d58b04554c76276aa22b99f5 100644 (file)
@@ -1358,6 +1358,10 @@ mymain(void)
 
     TEST_BITMAP_BLOCKCOMMIT("empty", 1, 2, "empty");
 
+    TEST_BITMAP_BLOCKCOMMIT("basic-1-2", 1, 2, "basic");
+    TEST_BITMAP_BLOCKCOMMIT("basic-1-3", 1, 3, "basic");
+    TEST_BITMAP_BLOCKCOMMIT("basic-2-3", 2, 3, "basic");
+
  cleanup:
     qemuTestDriverFree(&driver);
     VIR_FREE(capslatest_x86_64);
diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-2 b/tests/qemublocktestdata/bitmapblockcommit/basic-1-2
new file mode 100644 (file)
index 0000000..d393d31
--- /dev/null
@@ -0,0 +1,145 @@
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "a",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-2-format",
+      "target": "a",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "a"
+        },
+        {
+          "node": "libvirt-2-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-2-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "b"
+        },
+        {
+          "node": "libvirt-2-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-2-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "c"
+        },
+        {
+          "node": "libvirt-2-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "d",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-2-format",
+      "target": "d",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "d"
+        },
+        {
+          "node": "libvirt-2-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "current",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-2-format",
+      "target": "current",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "current"
+        },
+        {
+          "node": "libvirt-2-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-remove",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "libvirt-tmp-activewrite"
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-1-3 b/tests/qemublocktestdata/bitmapblockcommit/basic-1-3
new file mode 100644 (file)
index 0000000..3fa902c
--- /dev/null
@@ -0,0 +1,145 @@
+merge bitmpas:
+[
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "a",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "a",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "a"
+        },
+        {
+          "node": "libvirt-3-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "b",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "b",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "b"
+        },
+        {
+          "node": "libvirt-3-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "c",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "c",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "c"
+        },
+        {
+          "node": "libvirt-3-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "d",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "d",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "d"
+        },
+        {
+          "node": "libvirt-3-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "current",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "current",
+      "bitmaps": [
+        {
+          "node": "libvirt-1-format",
+          "name": "current"
+        },
+        {
+          "node": "libvirt-3-format",
+          "name": "libvirt-tmp-activewrite"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-remove",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "libvirt-tmp-activewrite"
+    }
+  }
+]
diff --git a/tests/qemublocktestdata/bitmapblockcommit/basic-2-3 b/tests/qemublocktestdata/bitmapblockcommit/basic-2-3
new file mode 100644 (file)
index 0000000..9260011
--- /dev/null
@@ -0,0 +1 @@
+merge bitmpas: