提交 5f2fdcc8 编写于 作者: P Peter Krempa

qemublocktest: Add test cases for handling bitmaps during block-copy

Test both 'basic' and 'snapshots' cases on shallow and deep copy modes.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
上级 7bfff40f
......@@ -1346,6 +1346,11 @@ mymain(void)
TEST_BITMAP_BLOCKCOPY("empty-shallow", true, "empty");
TEST_BITMAP_BLOCKCOPY("empty-deep", false, "empty");
TEST_BITMAP_BLOCKCOPY("basic-shallow", true, "basic");
TEST_BITMAP_BLOCKCOPY("basic-deep", false, "basic");
TEST_BITMAP_BLOCKCOPY("snapshots-shallow", true, "snapshots");
TEST_BITMAP_BLOCKCOPY("snapshots-deep", false, "snapshots");
#define TEST_BITMAP_BLOCKCOMMIT(testname, topimg, baseimg, ndf) \
do {\
......
[
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "a",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "a",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "a"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "b",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "b",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "b"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "c",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "c",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "c"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "d",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "d",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "d"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "current",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "current",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "current"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-remove",
"data": {
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
}
]
[
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "a",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "a",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "a"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "b",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "b",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "b"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "c",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "c",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "c"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "d",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "d",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "d"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "current",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "current",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "current"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-remove",
"data": {
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
}
]
[
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "current",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "current",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "current"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "c",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "c",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "c"
},
{
"node": "libvirt-2-format",
"name": "c"
},
{
"node": "libvirt-3-format",
"name": "c"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "b",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "b",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "b"
},
{
"node": "libvirt-2-format",
"name": "b"
},
{
"node": "libvirt-3-format",
"name": "b"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "a",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "a",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "a"
},
{
"node": "libvirt-2-format",
"name": "a"
},
{
"node": "libvirt-3-format",
"name": "a"
},
{
"node": "libvirt-4-format",
"name": "a"
},
{
"node": "libvirt-5-format",
"name": "a"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "d",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "d",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "d"
},
{
"node": "libvirt-2-format",
"name": "d"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-remove",
"data": {
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
}
]
[
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "current",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "current",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "current"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "c",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "c",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "c"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "b",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "b",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "b"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "a",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "a",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "a"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-add",
"data": {
"node": "mirror-format-node",
"name": "d",
"persistent": true,
"disabled": false,
"granularity": 65536
}
},
{
"type": "block-dirty-bitmap-merge",
"data": {
"node": "mirror-format-node",
"target": "d",
"bitmaps": [
{
"node": "libvirt-1-format",
"name": "d"
},
{
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
]
}
},
{
"type": "block-dirty-bitmap-remove",
"data": {
"node": "mirror-format-node",
"name": "libvirt-tmp-activewrite"
}
}
]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册