Change in vdsm[master]: [WIP] BZ#748386 - Replace dd with qemu-img convert within _i...

lyarwood at redhat.com lyarwood at redhat.com
Sat Dec 15 21:35:58 UTC 2012


Lee Yarwood has uploaded a new change for review.

Change subject: [WIP] BZ#748386 - Replace dd with qemu-img convert within _interImagesCopy.
......................................................................

[WIP] BZ#748386 - Replace dd with qemu-img convert within _interImagesCopy.

_interImagesCopy previously used dd to copy volumes thus fully
allocating sparse file volumes. This change replaces dd with
the new qemuImg.convert method.

Change-Id: I50db161a068a7269082baa5474d9057785730c4e
Signed-off-by: Lee Yarwood <lyarwood at redhat.com>
---
M vdsm/storage/image.py
1 file changed, 8 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/88/10088/1

diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index afb1abf..8f4867a 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -580,19 +580,14 @@
         try:
             for srcVol in chains['srcChain']:
                 # Do the actual copy
-                try:
-                    dstVol = destDom.produceVolume(imgUUID=imgUUID, volUUID=srcVol.volUUID)
-                    srcSize = srcVol.getVolumeSize(bs=1)
-                    misc.ddWatchCopy(srcVol.getVolumePath(), dstVol.getVolumePath(), vars.task.aborting, size=srcSize)
-                except se.ActionStopped:
-                    raise
-                except se.StorageException:
-                    self.log.error("Unexpected error", exc_info=True)
-                    raise
-                except Exception:
-                    self.log.error("Copy image error: image=%s, src domain=%s, dst domain=%s", imgUUID, srcSdUUID,
-                                    destDom.sdUUID, exc_info=True)
-                    raise se.CopyImageError()
+                dstVol = destDom.produceVolume(imgUUID=imgUUID, volUUID=srcVol.volUUID)
+                qemuImg.convert(srcVol, srcVol.getFormat(), dstVol, dstVol.getFormat())
+
+        except qemuImg.QImgError(e):
+            self.log.error("%s", str(e))
+            raise
+        except Exception, e:
+            raise se.CopyImageError("Error copying src image=%s to dst image=%s: msg=%s" % (srcImgUUID, dstImgUUID, str(e)))
         finally:
             # teardown volumes
             self.__cleanupMove(srcLeafVol, dstLeafVol)


--
To view, visit http://gerrit.ovirt.org/10088
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I50db161a068a7269082baa5474d9057785730c4e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Lee Yarwood <lyarwood at redhat.com>


More information about the vdsm-patches mailing list