Blame SOURCES/libvirt-tests-qemublocktest-Add-another-synthetic-test-case-for-broken-bitmaps.patch

fbe740
From 51214acf9b65be8575eac8ff82d63e5c260a48fe Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <51214acf9b65be8575eac8ff82d63e5c260a48fe@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 4 Feb 2020 15:08:24 +0100
fbe740
Subject: [PATCH] tests: qemublocktest: Add another synthetic test case for
fbe740
 broken bitmaps
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Add a case where a bitmap spanning multiple images is missing one of the
fbe740
intermediate components.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
(cherry picked from commit 8e29a8b151f59a53d2bb57bb58074185088f38f0)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1207659
fbe740
Message-Id: <0a1a64d620d9770afda50efc0e82c67dd3c2ae19.1580824112.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 tests/qemublocktest.c                         |   8 +
fbe740
 .../bitmap/snapshots-synthetic-broken.json    | 819 ++++++++++++++++++
fbe740
 .../bitmap/snapshots-synthetic-broken.out     |  12 +
fbe740
 3 files changed, 839 insertions(+)
fbe740
 create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
fbe740
 create mode 100644 tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
fbe740
fbe740
diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c
fbe740
index 6a7b07cfee..3208e90e41 100644
fbe740
--- a/tests/qemublocktest.c
fbe740
+++ b/tests/qemublocktest.c
fbe740
@@ -1026,6 +1026,7 @@ mymain(void)
fbe740
     TEST_BITMAP_DETECT("synthetic");
fbe740
     TEST_BITMAP_DETECT("snapshots");
fbe740
     TEST_BITMAP_DETECT("snapshots-synthetic-checkpoint");
fbe740
+    TEST_BITMAP_DETECT("snapshots-synthetic-broken");
fbe740
 
fbe740
 #define TEST_BACKUP_BITMAP_CALCULATE(testname, source, incrbackup, named) \
fbe740
     do { \
fbe740
@@ -1112,6 +1113,13 @@ mymain(void)
fbe740
     TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "c", true);
fbe740
     TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "d", true);
fbe740
     TEST_BITMAP_VALIDATE("snapshots-synthetic-checkpoint", "current", true);
fbe740
+
fbe740
+    TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "a", false);
fbe740
+    TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "b", true);
fbe740
+    TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "c", true);
fbe740
+    TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "d", false);
fbe740
+    TEST_BITMAP_VALIDATE("snapshots-synthetic-broken", "current", true);
fbe740
+
fbe740
  cleanup:
fbe740
     virHashFree(diskxmljsondata.schema);
fbe740
     qemuTestDriverFree(&driver);
fbe740
diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
fbe740
new file mode 100644
fbe740
index 0000000000..bf4963494f
fbe740
--- /dev/null
fbe740
+++ b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
fbe740
@@ -0,0 +1,819 @@
fbe740
+[
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "backing-image": {
fbe740
+                "backing-image": {
fbe740
+                    "backing-image": {
fbe740
+                        "backing-image": {
fbe740
+                            "virtual-size": 10485760,
fbe740
+                            "filename": "/tmp/pull4.qcow2",
fbe740
+                            "cluster-size": 65536,
fbe740
+                            "format": "qcow2",
fbe740
+                            "actual-size": 208896,
fbe740
+                            "format-specific": {
fbe740
+                                "type": "qcow2",
fbe740
+                                "data": {
fbe740
+                                    "compat": "1.1",
fbe740
+                                    "lazy-refcounts": false,
fbe740
+                                    "bitmaps": [
fbe740
+                                        {
fbe740
+                                            "flags": [
fbe740
+                                                "auto"
fbe740
+                                            ],
fbe740
+                                            "name": "a",
fbe740
+                                            "granularity": 65536
fbe740
+                                        }
fbe740
+                                    ],
fbe740
+                                    "refcount-bits": 16,
fbe740
+                                    "corrupt": false
fbe740
+                                }
fbe740
+                            },
fbe740
+                            "dirty-flag": false
fbe740
+                        },
fbe740
+                        "backing-filename-format": "qcow2",
fbe740
+                        "virtual-size": 10485760,
fbe740
+                        "filename": "/tmp/pull4.1575911522",
fbe740
+                        "cluster-size": 65536,
fbe740
+                        "format": "qcow2",
fbe740
+                        "actual-size": 208896,
fbe740
+                        "format-specific": {
fbe740
+                            "type": "qcow2",
fbe740
+                            "data": {
fbe740
+                                "compat": "1.1",
fbe740
+                                "lazy-refcounts": false,
fbe740
+                                "bitmaps": [
fbe740
+                                    {
fbe740
+                                        "flags": [
fbe740
+                                            "auto"
fbe740
+                                        ],
fbe740
+                                        "name": "a",
fbe740
+                                        "granularity": 65536
fbe740
+                                    }
fbe740
+                                ],
fbe740
+                                "refcount-bits": 16,
fbe740
+                                "corrupt": false
fbe740
+                            }
fbe740
+                        },
fbe740
+                        "full-backing-filename": "/tmp/pull4.qcow2",
fbe740
+                        "backing-filename": "/tmp/pull4.qcow2",
fbe740
+                        "dirty-flag": false
fbe740
+                    },
fbe740
+                    "backing-filename-format": "qcow2",
fbe740
+                    "virtual-size": 10485760,
fbe740
+                    "filename": "/tmp/pull4.1575911527",
fbe740
+                    "cluster-size": 65536,
fbe740
+                    "format": "qcow2",
fbe740
+                    "actual-size": 217088,
fbe740
+                    "format-specific": {
fbe740
+                        "type": "qcow2",
fbe740
+                        "data": {
fbe740
+                            "compat": "1.1",
fbe740
+                            "lazy-refcounts": false,
fbe740
+                            "bitmaps": [
fbe740
+                                {
fbe740
+                                    "flags": [
fbe740
+                                        "auto"
fbe740
+                                    ],
fbe740
+                                    "name": "c",
fbe740
+                                    "granularity": 65536
fbe740
+                                },
fbe740
+                                {
fbe740
+                                    "flags": [
fbe740
+
fbe740
+                                    ],
fbe740
+                                    "name": "b",
fbe740
+                                    "granularity": 65536
fbe740
+                                },
fbe740
+                                {
fbe740
+                                    "flags": [
fbe740
+
fbe740
+                                    ],
fbe740
+                                    "name": "a",
fbe740
+                                    "granularity": 65536
fbe740
+                                }
fbe740
+                            ],
fbe740
+                            "refcount-bits": 16,
fbe740
+                            "corrupt": false
fbe740
+                        }
fbe740
+                    },
fbe740
+                    "full-backing-filename": "/tmp/pull4.1575911522",
fbe740
+                    "backing-filename": "/tmp/pull4.1575911522",
fbe740
+                    "dirty-flag": false
fbe740
+                },
fbe740
+                "backing-filename-format": "qcow2",
fbe740
+                "virtual-size": 10485760,
fbe740
+                "filename": "/tmp/pull4.1575911540",
fbe740
+                "cluster-size": 65536,
fbe740
+                "format": "qcow2",
fbe740
+                "actual-size": 212992,
fbe740
+                "format-specific": {
fbe740
+                    "type": "qcow2",
fbe740
+                    "data": {
fbe740
+                        "compat": "1.1",
fbe740
+                        "lazy-refcounts": false,
fbe740
+                        "bitmaps": [
fbe740
+                            {
fbe740
+                                "flags": [
fbe740
+                                    "auto"
fbe740
+                                ],
fbe740
+                                "name": "d",
fbe740
+                                "granularity": 65536
fbe740
+                            },
fbe740
+                            {
fbe740
+                                "flags": [
fbe740
+
fbe740
+                                ],
fbe740
+                                "name": "c",
fbe740
+                                "granularity": 65536
fbe740
+                            }
fbe740
+                        ],
fbe740
+                        "refcount-bits": 16,
fbe740
+                        "corrupt": false
fbe740
+                    }
fbe740
+                },
fbe740
+                "full-backing-filename": "/tmp/pull4.1575911527",
fbe740
+                "backing-filename": "/tmp/pull4.1575911527",
fbe740
+                "dirty-flag": false
fbe740
+            },
fbe740
+            "backing-filename-format": "qcow2",
fbe740
+            "virtual-size": 10485760,
fbe740
+            "filename": "/tmp/pull4.1575911550",
fbe740
+            "cluster-size": 65536,
fbe740
+            "format": "qcow2",
fbe740
+            "actual-size": 212992,
fbe740
+            "format-specific": {
fbe740
+                "type": "qcow2",
fbe740
+                "data": {
fbe740
+                    "compat": "1.1",
fbe740
+                    "lazy-refcounts": false,
fbe740
+                    "bitmaps": [
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+                                "in-use",
fbe740
+                                "auto"
fbe740
+                            ],
fbe740
+                            "name": "current",
fbe740
+                            "granularity": 65536
fbe740
+                        },
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+                                "in-use"
fbe740
+                            ],
fbe740
+                            "name": "d",
fbe740
+                            "granularity": 65536
fbe740
+                        }
fbe740
+                    ],
fbe740
+                    "refcount-bits": 16,
fbe740
+                    "corrupt": false
fbe740
+                }
fbe740
+            },
fbe740
+            "full-backing-filename": "/tmp/pull4.1575911540",
fbe740
+            "backing-filename": "/tmp/pull4.1575911540",
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": false,
fbe740
+        "node-name": "libvirt-1-format",
fbe740
+        "backing_file_depth": 4,
fbe740
+        "drv": "qcow2",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "backing_file": "/tmp/pull4.1575911540",
fbe740
+        "dirty-bitmaps": [
fbe740
+            {
fbe740
+                "name": "d",
fbe740
+                "recording": false,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "disabled",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            },
fbe740
+            {
fbe740
+                "name": "current",
fbe740
+                "recording": true,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "active",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            }
fbe740
+        ],
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911550",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "virtual-size": 393728,
fbe740
+            "filename": "/tmp/pull4.1575911550",
fbe740
+            "format": "file",
fbe740
+            "actual-size": 212992,
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": false,
fbe740
+        "node-name": "libvirt-1-storage",
fbe740
+        "backing_file_depth": 0,
fbe740
+        "drv": "file",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911550",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "backing-image": {
fbe740
+                "backing-image": {
fbe740
+                    "backing-image": {
fbe740
+                        "virtual-size": 10485760,
fbe740
+                        "filename": "/tmp/pull4.qcow2",
fbe740
+                        "cluster-size": 65536,
fbe740
+                        "format": "qcow2",
fbe740
+                        "actual-size": 208896,
fbe740
+                        "format-specific": {
fbe740
+                            "type": "qcow2",
fbe740
+                            "data": {
fbe740
+                                "compat": "1.1",
fbe740
+                                "lazy-refcounts": false,
fbe740
+                                "bitmaps": [
fbe740
+                                    {
fbe740
+                                        "flags": [
fbe740
+                                            "auto"
fbe740
+                                        ],
fbe740
+                                        "name": "a",
fbe740
+                                        "granularity": 65536
fbe740
+                                    }
fbe740
+                                ],
fbe740
+                                "refcount-bits": 16,
fbe740
+                                "corrupt": false
fbe740
+                            }
fbe740
+                        },
fbe740
+                        "dirty-flag": false
fbe740
+                    },
fbe740
+                    "backing-filename-format": "qcow2",
fbe740
+                    "virtual-size": 10485760,
fbe740
+                    "filename": "/tmp/pull4.1575911522",
fbe740
+                    "cluster-size": 65536,
fbe740
+                    "format": "qcow2",
fbe740
+                    "actual-size": 208896,
fbe740
+                    "format-specific": {
fbe740
+                        "type": "qcow2",
fbe740
+                        "data": {
fbe740
+                            "compat": "1.1",
fbe740
+                            "lazy-refcounts": false,
fbe740
+                            "bitmaps": [
fbe740
+                                {
fbe740
+                                    "flags": [
fbe740
+                                        "auto"
fbe740
+                                    ],
fbe740
+                                    "name": "a",
fbe740
+                                    "granularity": 65536
fbe740
+                                }
fbe740
+                            ],
fbe740
+                            "refcount-bits": 16,
fbe740
+                            "corrupt": false
fbe740
+                        }
fbe740
+                    },
fbe740
+                    "full-backing-filename": "/tmp/pull4.qcow2",
fbe740
+                    "backing-filename": "/tmp/pull4.qcow2",
fbe740
+                    "dirty-flag": false
fbe740
+                },
fbe740
+                "backing-filename-format": "qcow2",
fbe740
+                "virtual-size": 10485760,
fbe740
+                "filename": "/tmp/pull4.1575911527",
fbe740
+                "cluster-size": 65536,
fbe740
+                "format": "qcow2",
fbe740
+                "actual-size": 217088,
fbe740
+                "format-specific": {
fbe740
+                    "type": "qcow2",
fbe740
+                    "data": {
fbe740
+                        "compat": "1.1",
fbe740
+                        "lazy-refcounts": false,
fbe740
+                        "bitmaps": [
fbe740
+                            {
fbe740
+                                "flags": [
fbe740
+                                    "auto"
fbe740
+                                ],
fbe740
+                                "name": "c",
fbe740
+                                "granularity": 65536
fbe740
+                            },
fbe740
+                            {
fbe740
+                                "flags": [
fbe740
+
fbe740
+                                ],
fbe740
+                                "name": "b",
fbe740
+                                "granularity": 65536
fbe740
+                            },
fbe740
+                            {
fbe740
+                                "flags": [
fbe740
+
fbe740
+                                ],
fbe740
+                                "name": "a",
fbe740
+                                "granularity": 65536
fbe740
+                            }
fbe740
+                        ],
fbe740
+                        "refcount-bits": 16,
fbe740
+                        "corrupt": false
fbe740
+                    }
fbe740
+                },
fbe740
+                "full-backing-filename": "/tmp/pull4.1575911522",
fbe740
+                "backing-filename": "/tmp/pull4.1575911522",
fbe740
+                "dirty-flag": false
fbe740
+            },
fbe740
+            "backing-filename-format": "qcow2",
fbe740
+            "virtual-size": 10485760,
fbe740
+            "filename": "/tmp/pull4.1575911540",
fbe740
+            "cluster-size": 65536,
fbe740
+            "format": "qcow2",
fbe740
+            "actual-size": 212992,
fbe740
+            "format-specific": {
fbe740
+                "type": "qcow2",
fbe740
+                "data": {
fbe740
+                    "compat": "1.1",
fbe740
+                    "lazy-refcounts": false,
fbe740
+                    "bitmaps": [
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+                                "auto"
fbe740
+                            ],
fbe740
+                            "name": "d",
fbe740
+                            "granularity": 65536
fbe740
+                        },
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+
fbe740
+                            ],
fbe740
+                            "name": "c",
fbe740
+                            "granularity": 65536
fbe740
+                        }
fbe740
+                    ],
fbe740
+                    "refcount-bits": 16,
fbe740
+                    "corrupt": false
fbe740
+                }
fbe740
+            },
fbe740
+            "full-backing-filename": "/tmp/pull4.1575911527",
fbe740
+            "backing-filename": "/tmp/pull4.1575911527",
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": true,
fbe740
+        "node-name": "libvirt-2-format",
fbe740
+        "backing_file_depth": 3,
fbe740
+        "drv": "qcow2",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "backing_file": "/tmp/pull4.1575911527",
fbe740
+        "dirty-bitmaps": [
fbe740
+            {
fbe740
+                "name": "c",
fbe740
+                "recording": false,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "disabled",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            },
fbe740
+            {
fbe740
+                "name": "d",
fbe740
+                "recording": true,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "active",
fbe740
+                "granularity": 65536,
fbe740
+                "inconsistent": true,
fbe740
+                "count": 0
fbe740
+            }
fbe740
+        ],
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911540",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "virtual-size": 393728,
fbe740
+            "filename": "/tmp/pull4.1575911540",
fbe740
+            "format": "file",
fbe740
+            "actual-size": 212992,
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": false,
fbe740
+        "node-name": "libvirt-2-storage",
fbe740
+        "backing_file_depth": 0,
fbe740
+        "drv": "file",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911540",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "backing-image": {
fbe740
+                "backing-image": {
fbe740
+                    "virtual-size": 10485760,
fbe740
+                    "filename": "/tmp/pull4.qcow2",
fbe740
+                    "cluster-size": 65536,
fbe740
+                    "format": "qcow2",
fbe740
+                    "actual-size": 208896,
fbe740
+                    "format-specific": {
fbe740
+                        "type": "qcow2",
fbe740
+                        "data": {
fbe740
+                            "compat": "1.1",
fbe740
+                            "lazy-refcounts": false,
fbe740
+                            "bitmaps": [
fbe740
+                                {
fbe740
+                                    "flags": [
fbe740
+                                        "auto"
fbe740
+                                    ],
fbe740
+                                    "name": "a",
fbe740
+                                    "granularity": 65536
fbe740
+                                }
fbe740
+                            ],
fbe740
+                            "refcount-bits": 16,
fbe740
+                            "corrupt": false
fbe740
+                        }
fbe740
+                    },
fbe740
+                    "dirty-flag": false
fbe740
+                },
fbe740
+                "backing-filename-format": "qcow2",
fbe740
+                "virtual-size": 10485760,
fbe740
+                "filename": "/tmp/pull4.1575911522",
fbe740
+                "cluster-size": 65536,
fbe740
+                "format": "qcow2",
fbe740
+                "actual-size": 208896,
fbe740
+                "format-specific": {
fbe740
+                    "type": "qcow2",
fbe740
+                    "data": {
fbe740
+                        "compat": "1.1",
fbe740
+                        "lazy-refcounts": false,
fbe740
+                        "bitmaps": [
fbe740
+                            {
fbe740
+                                "flags": [
fbe740
+                                    "auto"
fbe740
+                                ],
fbe740
+                                "name": "a",
fbe740
+                                "granularity": 65536
fbe740
+                            }
fbe740
+                        ],
fbe740
+                        "refcount-bits": 16,
fbe740
+                        "corrupt": false
fbe740
+                    }
fbe740
+                },
fbe740
+                "full-backing-filename": "/tmp/pull4.qcow2",
fbe740
+                "backing-filename": "/tmp/pull4.qcow2",
fbe740
+                "dirty-flag": false
fbe740
+            },
fbe740
+            "backing-filename-format": "qcow2",
fbe740
+            "virtual-size": 10485760,
fbe740
+            "filename": "/tmp/pull4.1575911527",
fbe740
+            "cluster-size": 65536,
fbe740
+            "format": "qcow2",
fbe740
+            "actual-size": 217088,
fbe740
+            "format-specific": {
fbe740
+                "type": "qcow2",
fbe740
+                "data": {
fbe740
+                    "compat": "1.1",
fbe740
+                    "lazy-refcounts": false,
fbe740
+                    "bitmaps": [
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+                                "auto"
fbe740
+                            ],
fbe740
+                            "name": "c",
fbe740
+                            "granularity": 65536
fbe740
+                        },
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+
fbe740
+                            ],
fbe740
+                            "name": "b",
fbe740
+                            "granularity": 65536
fbe740
+                        },
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+
fbe740
+                            ],
fbe740
+                            "name": "a",
fbe740
+                            "granularity": 65536
fbe740
+                        }
fbe740
+                    ],
fbe740
+                    "refcount-bits": 16,
fbe740
+                    "corrupt": false
fbe740
+                }
fbe740
+            },
fbe740
+            "full-backing-filename": "/tmp/pull4.1575911522",
fbe740
+            "backing-filename": "/tmp/pull4.1575911522",
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": true,
fbe740
+        "node-name": "libvirt-3-format",
fbe740
+        "backing_file_depth": 2,
fbe740
+        "drv": "qcow2",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "backing_file": "/tmp/pull4.1575911522",
fbe740
+        "dirty-bitmaps": [
fbe740
+            {
fbe740
+                "name": "a",
fbe740
+                "recording": false,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "disabled",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            },
fbe740
+            {
fbe740
+                "name": "b",
fbe740
+                "recording": true,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "disabled",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            }
fbe740
+        ],
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911527",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "virtual-size": 459264,
fbe740
+            "filename": "/tmp/pull4.1575911527",
fbe740
+            "format": "file",
fbe740
+            "actual-size": 217088,
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": false,
fbe740
+        "node-name": "libvirt-3-storage",
fbe740
+        "backing_file_depth": 0,
fbe740
+        "drv": "file",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911527",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "backing-image": {
fbe740
+                "virtual-size": 10485760,
fbe740
+                "filename": "/tmp/pull4.qcow2",
fbe740
+                "cluster-size": 65536,
fbe740
+                "format": "qcow2",
fbe740
+                "actual-size": 208896,
fbe740
+                "format-specific": {
fbe740
+                    "type": "qcow2",
fbe740
+                    "data": {
fbe740
+                        "compat": "1.1",
fbe740
+                        "lazy-refcounts": false,
fbe740
+                        "bitmaps": [
fbe740
+                            {
fbe740
+                                "flags": [
fbe740
+                                    "auto"
fbe740
+                                ],
fbe740
+                                "name": "a",
fbe740
+                                "granularity": 65536
fbe740
+                            }
fbe740
+                        ],
fbe740
+                        "refcount-bits": 16,
fbe740
+                        "corrupt": false
fbe740
+                    }
fbe740
+                },
fbe740
+                "dirty-flag": false
fbe740
+            },
fbe740
+            "backing-filename-format": "qcow2",
fbe740
+            "virtual-size": 10485760,
fbe740
+            "filename": "/tmp/pull4.1575911522",
fbe740
+            "cluster-size": 65536,
fbe740
+            "format": "qcow2",
fbe740
+            "actual-size": 208896,
fbe740
+            "format-specific": {
fbe740
+                "type": "qcow2",
fbe740
+                "data": {
fbe740
+                    "compat": "1.1",
fbe740
+                    "lazy-refcounts": false,
fbe740
+                    "bitmaps": [
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+                                "auto"
fbe740
+                            ],
fbe740
+                            "name": "a",
fbe740
+                            "granularity": 65536
fbe740
+                        }
fbe740
+                    ],
fbe740
+                    "refcount-bits": 16,
fbe740
+                    "corrupt": false
fbe740
+                }
fbe740
+            },
fbe740
+            "full-backing-filename": "/tmp/pull4.qcow2",
fbe740
+            "backing-filename": "/tmp/pull4.qcow2",
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": true,
fbe740
+        "node-name": "libvirt-4-format",
fbe740
+        "backing_file_depth": 1,
fbe740
+        "drv": "qcow2",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "backing_file": "/tmp/pull4.qcow2",
fbe740
+        "dirty-bitmaps": [
fbe740
+        ],
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911522",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "virtual-size": 328192,
fbe740
+            "filename": "/tmp/pull4.1575911522",
fbe740
+            "format": "file",
fbe740
+            "actual-size": 208896,
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": false,
fbe740
+        "node-name": "libvirt-4-storage",
fbe740
+        "backing_file_depth": 0,
fbe740
+        "drv": "file",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.1575911522",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "virtual-size": 10485760,
fbe740
+            "filename": "/tmp/pull4.qcow2",
fbe740
+            "cluster-size": 65536,
fbe740
+            "format": "qcow2",
fbe740
+            "actual-size": 208896,
fbe740
+            "format-specific": {
fbe740
+                "type": "qcow2",
fbe740
+                "data": {
fbe740
+                    "compat": "1.1",
fbe740
+                    "lazy-refcounts": false,
fbe740
+                    "bitmaps": [
fbe740
+                        {
fbe740
+                            "flags": [
fbe740
+                                "auto"
fbe740
+                            ],
fbe740
+                            "name": "a",
fbe740
+                            "granularity": 65536
fbe740
+                        }
fbe740
+                    ],
fbe740
+                    "refcount-bits": 16,
fbe740
+                    "corrupt": false
fbe740
+                }
fbe740
+            },
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": true,
fbe740
+        "node-name": "libvirt-5-format",
fbe740
+        "backing_file_depth": 0,
fbe740
+        "drv": "qcow2",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "dirty-bitmaps": [
fbe740
+            {
fbe740
+                "name": "a",
fbe740
+                "recording": true,
fbe740
+                "persistent": true,
fbe740
+                "busy": false,
fbe740
+                "status": "active",
fbe740
+                "granularity": 65536,
fbe740
+                "count": 0
fbe740
+            }
fbe740
+        ],
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.qcow2",
fbe740
+        "encryption_key_missing": false
fbe740
+    },
fbe740
+    {
fbe740
+        "iops_rd": 0,
fbe740
+        "detect_zeroes": "off",
fbe740
+        "image": {
fbe740
+            "virtual-size": 328192,
fbe740
+            "filename": "/tmp/pull4.qcow2",
fbe740
+            "format": "file",
fbe740
+            "actual-size": 208896,
fbe740
+            "dirty-flag": false
fbe740
+        },
fbe740
+        "iops_wr": 0,
fbe740
+        "ro": false,
fbe740
+        "node-name": "libvirt-5-storage",
fbe740
+        "backing_file_depth": 0,
fbe740
+        "drv": "file",
fbe740
+        "iops": 0,
fbe740
+        "bps_wr": 0,
fbe740
+        "write_threshold": 0,
fbe740
+        "encrypted": false,
fbe740
+        "bps": 0,
fbe740
+        "bps_rd": 0,
fbe740
+        "cache": {
fbe740
+            "no-flush": false,
fbe740
+            "direct": false,
fbe740
+            "writeback": true
fbe740
+        },
fbe740
+        "file": "/tmp/pull4.qcow2",
fbe740
+        "encryption_key_missing": false
fbe740
+    }
fbe740
+]
fbe740
diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
fbe740
new file mode 100644
fbe740
index 0000000000..022630bd76
fbe740
--- /dev/null
fbe740
+++ b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
fbe740
@@ -0,0 +1,12 @@
fbe740
+libvirt-1-format:
fbe740
+        d: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
+  current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
+libvirt-2-format:
fbe740
+        c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
+        d: record:1 busy:0 persist:1 inconsist:1 gran:65536 dirty:0
fbe740
+libvirt-3-format:
fbe740
+        a: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
+        b: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
+libvirt-4-format:
fbe740
+libvirt-5-format:
fbe740
+        a: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
fbe740
-- 
fbe740
2.25.0
fbe740