Blame SOURCES/libvirt-qemublocktest-Add-tests-for-re-enabling-of-bitmaps-after-commit.patch

a41c76
From 0dc8024eae1f56e02228171feb824becf21ee697 Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <0dc8024eae1f56e02228171feb824becf21ee697@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Tue, 17 Mar 2020 17:12:46 +0100
a41c76
Subject: [PATCH] qemublocktest: Add tests for re-enabling of bitmaps after
a41c76
 commit
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Some branches were not covered and thus we didn't catch that the bitmaps
a41c76
are not re-enabled if nothing is merged into them. Two bitmaps are
a41c76
necessary to reliably test the case due to hash table ordering.
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
a41c76
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
a41c76
(cherry picked from commit cab3622119a73a54e62e5f2d7b4257da00bd4ac8)
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1799013
a41c76
Message-Id: <fc3f48f6a5233fce3148fc21a63c4e0255b2e466.1584461519.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 .../bitmap/snapshots-synthetic-broken.json    | 18 ++++++++
a41c76
 .../bitmap/snapshots-synthetic-broken.out     |  2 +
a41c76
 .../snapshots-synthetic-broken-1-2            | 30 ++++++++++++
a41c76
 .../snapshots-synthetic-broken-1-3            | 46 +++++++++++++++++++
a41c76
 .../snapshots-synthetic-broken-1-4            | 46 +++++++++++++++++++
a41c76
 .../snapshots-synthetic-broken-1-5            | 46 +++++++++++++++++++
a41c76
 .../snapshots-synthetic-broken-2-3            | 46 +++++++++++++++++++
a41c76
 .../snapshots-synthetic-broken-2-4            | 46 +++++++++++++++++++
a41c76
 .../snapshots-synthetic-broken-2-5            | 46 +++++++++++++++++++
a41c76
 9 files changed, 326 insertions(+)
a41c76
a41c76
diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
a41c76
index bf4963494f..8cf14d4baa 100644
a41c76
--- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
a41c76
+++ b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
a41c76
@@ -398,6 +398,24 @@
a41c76
                 "granularity": 65536,
a41c76
                 "count": 0
a41c76
             },
a41c76
+            {
a41c76
+                "name": "oa",
a41c76
+                "recording": true,
a41c76
+                "persistent": true,
a41c76
+                "busy": false,
a41c76
+                "status": "active",
a41c76
+                "granularity": 65536,
a41c76
+                "count": 0
a41c76
+            },
a41c76
+            {
a41c76
+                "name": "ob",
a41c76
+                "recording": true,
a41c76
+                "persistent": true,
a41c76
+                "busy": false,
a41c76
+                "status": "active",
a41c76
+                "granularity": 65536,
a41c76
+                "count": 0
a41c76
+            },
a41c76
             {
a41c76
                 "name": "d",
a41c76
                 "recording": true,
a41c76
diff --git a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
a41c76
index 022630bd76..ad24a580f1 100644
a41c76
--- a/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
a41c76
+++ b/tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
a41c76
@@ -3,6 +3,8 @@ libvirt-1-format:
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
+       oa: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
a41c76
+       ob: record:1 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
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
a41c76
index d413fbe723..463120d442 100644
a41c76
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
a41c76
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
a41c76
@@ -1,4 +1,20 @@
a41c76
 pre job bitmap disable:
a41c76
+[
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-disable",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "oa"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-disable",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "ob"
a41c76
+    }
a41c76
+  }
a41c76
+]
a41c76
 merge bitmpas:
a41c76
 [
a41c76
   {
a41c76
@@ -23,5 +39,19 @@ merge bitmpas:
a41c76
         }
a41c76
       ]
a41c76
     }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-enable",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "oa"
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-enable",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-2-format",
a41c76
+      "name": "ob"
a41c76
+    }
a41c76
   }
a41c76
 ]
a41c76
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
a41c76
index 6eb14f927a..fec6f95dd1 100644
a41c76
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
a41c76
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
a41c76
@@ -62,5 +62,51 @@ merge bitmpas:
a41c76
         }
a41c76
       ]
a41c76
     }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "oa",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "target": "oa",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "oa"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "ob",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "target": "ob",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "ob"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
   }
a41c76
 ]
a41c76
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
a41c76
index f4d9b72576..697230f67b 100644
a41c76
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
a41c76
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
a41c76
@@ -69,5 +69,51 @@ merge bitmpas:
a41c76
         }
a41c76
       ]
a41c76
     }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "name": "oa",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "target": "oa",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "oa"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "name": "ob",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "target": "ob",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "ob"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
   }
a41c76
 ]
a41c76
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
a41c76
index a8e575c2d9..6bf1f0da64 100644
a41c76
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
a41c76
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
a41c76
@@ -69,5 +69,51 @@ merge bitmpas:
a41c76
         }
a41c76
       ]
a41c76
     }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "name": "oa",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "target": "oa",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "oa"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "name": "ob",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "target": "ob",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "ob"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
   }
a41c76
 ]
a41c76
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
a41c76
index d468e2b9d8..f202bb94b1 100644
a41c76
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
a41c76
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
a41c76
@@ -39,5 +39,51 @@ merge bitmpas:
a41c76
         }
a41c76
       ]
a41c76
     }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "oa",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "target": "oa",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "oa"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "name": "ob",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-3-format",
a41c76
+      "target": "ob",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "ob"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
   }
a41c76
 ]
a41c76
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
a41c76
index 2a9986bac6..864cc9041b 100644
a41c76
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
a41c76
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
a41c76
@@ -46,5 +46,51 @@ merge bitmpas:
a41c76
         }
a41c76
       ]
a41c76
     }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "name": "oa",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "target": "oa",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "oa"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "name": "ob",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-4-format",
a41c76
+      "target": "ob",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "ob"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
   }
a41c76
 ]
a41c76
diff --git a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5 b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5
a41c76
index 47d9f6e17a..4c5d8dbe80 100644
a41c76
--- a/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5
a41c76
+++ b/tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5
a41c76
@@ -46,5 +46,51 @@ merge bitmpas:
a41c76
         }
a41c76
       ]
a41c76
     }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "name": "oa",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "target": "oa",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "oa"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-add",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "name": "ob",
a41c76
+      "persistent": true,
a41c76
+      "disabled": false,
a41c76
+      "granularity": 65536
a41c76
+    }
a41c76
+  },
a41c76
+  {
a41c76
+    "type": "block-dirty-bitmap-merge",
a41c76
+    "data": {
a41c76
+      "node": "libvirt-5-format",
a41c76
+      "target": "ob",
a41c76
+      "bitmaps": [
a41c76
+        {
a41c76
+          "node": "libvirt-2-format",
a41c76
+          "name": "ob"
a41c76
+        }
a41c76
+      ]
a41c76
+    }
a41c76
   }
a41c76
 ]
a41c76
-- 
a41c76
2.25.1
a41c76