Federico Simoncelli has uploaded a new change for review.
Change subject: volume: prepare only one volume on clone
......................................................................
volume: prepare only one volume on clone
When we are cloning a volume we need only
Change-Id: Idc009fac4dc1a258537b0ffb15bd627680d79330
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/volume.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/26920/1
diff --git a/vdsm/storage/volume.py b/vdsm/storage/volume.py
index e1d3fc7..a36914f 100644
--- a/vdsm/storage/volume.py
+++ b/vdsm/storage/volume.py
@@ -271,7 +271,7 @@
wasleaf = True
self.setInternal()
try:
- self.prepare(rw=False)
+ self.prepare(rw=False, justme=True)
dst_path = os.path.join(dst_image_dir, dst_volUUID)
self.log.debug('cloning volume %s to %s', self.volumePath,
dst_path)
@@ -283,15 +283,15 @@
qemuimg.create(dst_path, backing=parent,
format=fmt2str(volFormat),
backingFormat=fmt2str(self.getFormat()))
- self.teardown(self.sdUUID, self.volUUID)
except Exception as e:
self.log.exception('cannot clone volume %s to %s',
self.volumePath, dst_path)
# FIXME: might race with other clones
if wasleaf:
self.setLeaf()
- self.teardown(self.sdUUID, self.volUUID)
raise se.CannotCloneVolume(self.volumePath, dst_path, str(e))
+ finally:
+ self.teardown(self.sdUUID, self.volUUID, justme=True)
def _shareLease(self, dstImgPath):
"""
--
To view, visit
http://gerrit.ovirt.org/26920
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idc009fac4dc1a258537b0ffb15bd627680d79330
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>