render / rpms / libvirt

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