def merge_external_bitmaps(self):
     for i, node in enumerate(self._snapshot_nodes):
         block_dirty_bitmap_merge(self.main_vm, node,
                                  [{
                                      "node": self._source_nodes[i],
                                      "name": self._bitmaps[i]
                                  }], self._merged_bitmaps[i])
Ejemplo n.º 2
0
 def merge_bitmap2_and_bitmap3_to_bitmap4(self):
     """merged bitmap2 and bitmap3 into bitmap4"""
     source_bitmaps, target_bitmap = ["bitmap_2", "bitmap_3"], "bitmap_4"
     args = {
         "bitmap_name": target_bitmap,
         "target_device": self.device,
         "disabled": "on"}
     block_dirty_bitmap.block_dirty_bitmap_add(self.vm, args)
     block_dirty_bitmap.block_dirty_bitmap_merge(
         self.vm, self.device, source_bitmaps, target_bitmap)
     time.sleep(5)
Ejemplo n.º 3
0
 def merge_two_bitmaps(self):
     try:
         block_dirty_bitmap_merge(self.main_vm, self._source_nodes[0],
                                  self._merged_bitmaps, self._merged_target)
     except QMPCmdError as e:
         nonexist_target = self._merged_target
         qmp_error_msg = self.params.get("qmp_error_msg") % nonexist_target
         if qmp_error_msg not in str(e.data):
             self.test.fail(str(e))
     else:
         self.test.fail("Merge to a non-exist bitmap:%s" %
                        self._merged_target)
Ejemplo n.º 4
0
    def _handle_bitmaps(self, disabled_list, new_list, **extra):
        for idx, bitmap in enumerate(disabled_list):
            block_dirty_bitmap.block_dirty_bitmap_disable(
                self.main_vm, self.source_images[idx], bitmap)

        for idx, bitmap in enumerate(new_list):
            bitmap_params = {}
            bitmap_params['bitmap_name'] = bitmap
            bitmap_params['target_device'] = self.source_images[idx]
            bitmap_params['disabled'] = extra.pop('disabled', 'off')
            block_dirty_bitmap.block_dirty_bitmap_add(self.main_vm,
                                                      bitmap_params)

        merged_list = extra.pop('merged_list', [])
        for idx, target in enumerate(merged_list):
            src_list = [v[idx] for v in extra.values()]
            block_dirty_bitmap.block_dirty_bitmap_merge(
                self.main_vm, self.source_images[idx], src_list, target)
Ejemplo n.º 5
0
 def merge_bitmap5_to_bitmap4(self):
     source_bitmaps, target_bitmap = ["bitmap_5"], "bitmap_4"
     return block_dirty_bitmap.block_dirty_bitmap_merge(
         self.vm, self.device, source_bitmaps, target_bitmap)