Federico Simoncelli has posted comments on this change.
Change subject: image: add support to upload/download images
......................................................................
Patch Set 7: (6 inline comments)
....................................................
File vdsm/storage/curl-img-wrap
Line 74: data_r, data_w = os.pipe()
Line 75: curl_opt = get_curl_options(headers) + [url]
Line 76:
Line 77: pids.add(fork_exec(
Line 78: "/usr/bin/curl", "curl", *curl_opt, dup2args=(data_w, 1),
Done
Line 79: closefd=(data_r,)))
Line 80: pids.add(fork_exec(
Line 81: "/bin/dd", "dd", "bs=2M", "of=%s" % path, dup2args=(data_r, 0),
Line 82: closefd=(data_w,)))
Line 115:
Line 116: all_success = True
Line 117:
Line 118: while len(pids):
Line 119: pid, status = os.wait()
Done
Line 120: pids.remove(pid)
Line 121: if status != 0:
Line 122: all_success = False
Line 123:
....................................................
File vdsm/storage/hsm.py
Line 1673: and methodArgs.
Line 1674: """
Line 1675: self.validateSdUUID(sdUUID)
Line 1676: pool = self.getPool(spUUID)
Line 1677: # NOTE: this could become an hsm task
Done
Line 1678: self._spmSchedule(spUUID, "downloadImage",
pool.downloadImage,
Line 1679: method, methodArgs, sdUUID, imgUUID,
volUUID)
Line 1680:
Line 1681: @deprecated
....................................................
File vdsm/storage/image.py
Line 1181: def download(self, method, methodArgs, sdUUID, imgUUID,
volUUID=None):
Line 1182: domain = sdCache.produce(sdUUID)
Line 1183: vol = self._activateVolumeForImportExport(domain, imgUUID,
volUUID)
Line 1184:
Line 1185: def sizeCallback(imageSize):
Done
Line 1186: # Extend the volume (if relevant) to the image size
Line 1187: vol.extend(imageSize / 512)
Line 1188:
Line 1189: try:
....................................................
File vdsm/storage/imageSharing.py
Line 51: size = int(headers['X-Image-Meta-Size'])
Line 52: else:
Line 53: raise RuntimeError("Unable to determine the image size")
Line 54:
Line 55: sizeCallback(size)
Done
Line 56:
Line 57: curlImgWrap.download(methodArgs.get('url'), dstImgPath,
Line 58: headers=methodArgs.get("headers", {}))
Line 59:
Line 87: raise RuntimeError("Upload method %s not found" % method)
Line 88:
Line 89:
Line 90: def validateSharingMethod(method, methodArgs):
Line 91: if method != methodArgs.get("method", None):
Done
--
To view, visit http://gerrit.ovirt.org/14955
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib208bb20d88633167b5c66b42febe912439a022d
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches