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

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