示例#1
0
 def _run(self):
     with guarded.context(self._vol_info.locks):
         self._validate()
         with self._vol_info.prepare():
             with self._vol_info.volume_operation():
                 qemuimg.amend(self._vol_info.path,
                               self._vol_attr.compat)
示例#2
0
 def test_empty_image(self, qcow2_compat, desired_qcow2_compat):
     with namedTemporaryDir() as tmpdir:
         base_path = os.path.join(tmpdir, 'base.img')
         leaf_path = os.path.join(tmpdir, 'leaf.img')
         size = 1048576
         qemuimg.create(base_path, size=size, format=qemuimg.FORMAT.RAW)
         qemuimg.create(leaf_path, format=qemuimg.FORMAT.QCOW2,
                        backing=base_path)
         qemuimg.amend(leaf_path, desired_qcow2_compat)
         self.assertEquals(qemuimg.info(leaf_path)['compat'],
                           desired_qcow2_compat)
示例#3
0
 def test_empty_image(self, qcow2_compat, desired_qcow2_compat):
     with namedTemporaryDir() as tmpdir:
         base_path = os.path.join(tmpdir, 'base.img')
         leaf_path = os.path.join(tmpdir, 'leaf.img')
         size = 1048576
         qemuimg.create(base_path, size=size, format=qemuimg.FORMAT.RAW)
         qemuimg.create(leaf_path, format=qemuimg.FORMAT.QCOW2,
                        backing=base_path)
         qemuimg.amend(leaf_path, desired_qcow2_compat)
         self.assertEquals(qemuimg.info(leaf_path)['compat'],
                           desired_qcow2_compat)
示例#4
0
 def _run(self):
     with guarded.context(self._vol_info.locks):
         self._validate()
         with self._vol_info.prepare():
             with self._vol_info.volume_operation():
                 qemuimg.amend(self._vol_info.path, self._qcow2_attr.compat)