]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemublocktest: Add tests for re-enabling of bitmaps after commit
authorPeter Krempa <pkrempa@redhat.com>
Tue, 17 Mar 2020 14:51:57 +0000 (15:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 Mar 2020 15:32:13 +0000 (16:32 +0100)
Some branches were not covered and thus we didn't catch that the bitmaps
are not re-enabled if nothing is merged into them. Two bitmaps are
necessary to reliably test the case due to hash table ordering.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.json
tests/qemublocktestdata/bitmap/snapshots-synthetic-broken.out
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-2
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-3
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-4
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-1-5
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-3
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-4
tests/qemublocktestdata/bitmapblockcommit/snapshots-synthetic-broken-2-5

index bf4963494f41098c03bd585ecc952a05bbe39224..8cf14d4baa80e055d875b043af6adbbade6617dc 100644 (file)
                 "granularity": 65536,
                 "count": 0
             },
+            {
+                "name": "oa",
+                "recording": true,
+                "persistent": true,
+                "busy": false,
+                "status": "active",
+                "granularity": 65536,
+                "count": 0
+            },
+            {
+                "name": "ob",
+                "recording": true,
+                "persistent": true,
+                "busy": false,
+                "status": "active",
+                "granularity": 65536,
+                "count": 0
+            },
             {
                 "name": "d",
                 "recording": true,
index 022630bd7679ba54f7fca2b03158c78ed9b75570..ad24a580f1c06c595a2610c64bb27aefbf0f5f8c 100644 (file)
@@ -3,6 +3,8 @@ libvirt-1-format:
   current: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
 libvirt-2-format:
         c: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+       oa: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
+       ob: record:1 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
         d: record:1 busy:0 persist:1 inconsist:1 gran:65536 dirty:0
 libvirt-3-format:
         a: record:0 busy:0 persist:1 inconsist:0 gran:65536 dirty:0
index d413fbe7231f3b2a8157559ea331f76252d0f0ec..463120d442dc66fc52f22bda671b80085c43b6ac 100644 (file)
@@ -1,4 +1,20 @@
 pre job bitmap disable:
+[
+  {
+    "type": "block-dirty-bitmap-disable",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "oa"
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-disable",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "ob"
+    }
+  }
+]
 merge bitmpas:
 [
   {
@@ -23,5 +39,19 @@ merge bitmpas:
         }
       ]
     }
+  },
+  {
+    "type": "block-dirty-bitmap-enable",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "oa"
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-enable",
+    "data": {
+      "node": "libvirt-2-format",
+      "name": "ob"
+    }
   }
 ]
index 6eb14f927a325066749170dec6a241dd366bb9bc..fec6f95dd162d1b5c3fd3e35f9e007cca1825a4d 100644 (file)
@@ -62,5 +62,51 @@ merge bitmpas:
         }
       ]
     }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "oa",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "oa",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "oa"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "ob",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "ob",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "ob"
+        }
+      ]
+    }
   }
 ]
index f4d9b725761c63c5d90e3940a482f9ed73a12b00..697230f67b0f74557388e66b750b0d7d97a5c285 100644 (file)
@@ -69,5 +69,51 @@ merge bitmpas:
         }
       ]
     }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "oa",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "oa",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "oa"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "ob",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "ob",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "ob"
+        }
+      ]
+    }
   }
 ]
index a8e575c2d9630d9958b8871ea71b4944c7d01274..6bf1f0da6456b3b86567fbdeab6f92eee6873c3e 100644 (file)
@@ -69,5 +69,51 @@ merge bitmpas:
         }
       ]
     }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "oa",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "oa",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "oa"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "ob",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "ob",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "ob"
+        }
+      ]
+    }
   }
 ]
index d468e2b9d88fa781729648bfca7bff66d43a5a72..f202bb94b17b023de9fb2ca803459eef586fefba 100644 (file)
@@ -39,5 +39,51 @@ merge bitmpas:
         }
       ]
     }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "oa",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "oa",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "oa"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-3-format",
+      "name": "ob",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-3-format",
+      "target": "ob",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "ob"
+        }
+      ]
+    }
   }
 ]
index 2a9986bac69598513d5ca692a684261b31ea26fe..864cc9041b82f13c0c6cc44b2003b3cb5ceea3b9 100644 (file)
@@ -46,5 +46,51 @@ merge bitmpas:
         }
       ]
     }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "oa",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "oa",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "oa"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-4-format",
+      "name": "ob",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-4-format",
+      "target": "ob",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "ob"
+        }
+      ]
+    }
   }
 ]
index 47d9f6e17a10ef87e97474310b68cad722e22c0f..4c5d8dbe805021cbb460d73acf620ed4ed8dc51d 100644 (file)
@@ -46,5 +46,51 @@ merge bitmpas:
         }
       ]
     }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "oa",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "oa",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "oa"
+        }
+      ]
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-add",
+    "data": {
+      "node": "libvirt-5-format",
+      "name": "ob",
+      "persistent": true,
+      "disabled": false,
+      "granularity": 65536
+    }
+  },
+  {
+    "type": "block-dirty-bitmap-merge",
+    "data": {
+      "node": "libvirt-5-format",
+      "target": "ob",
+      "bitmaps": [
+        {
+          "node": "libvirt-2-format",
+          "name": "ob"
+        }
+      ]
+    }
   }
 ]