Change in vdsm[master]: hsm: add uploaded image verification

nsoffer at redhat.com nsoffer at redhat.com
Wed Apr 6 21:35:53 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: hsm: add uploaded image verification
......................................................................


Patch Set 2:

(4 comments)

Mostly fine, but I'm not sure about the name. This is not about an upload, but about verifying an image after a user that was exposed for writing via imageio-daemon, or maybe by other means. For example, we may like to use the same verification after downloading image from another machine directly into an image, or after importing image from external system. Actually any time when we write qcow image that we did not generate.

https://gerrit.ovirt.org/#/c/55746/2/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:

Line 1554:     @public
Line 1555:     def verifyUpload(self, sdUUID, spUUID, imgUUID, volUUID):
Line 1556:         dom = sdCache.produce(sdUUID=sdUUID)
Line 1557:         vol = dom.produceVolume(imgUUID, volUUID)
Line 1558:         vol_qemu_info = qemuimg.info(vol.getVolumePath())
Let call this actual_info
Line 1559: 
Line 1560:         vol_md_fmt = volume.FMT2STR[vol.getFormat()]
Line 1561:         uploaded_fmt = vol_qemu_info["format"]
Line 1562:         if vol_md_fmt != uploaded_fmt:


Line 1556:         dom = sdCache.produce(sdUUID=sdUUID)
Line 1557:         vol = dom.produceVolume(imgUUID, volUUID)
Line 1558:         vol_qemu_info = qemuimg.info(vol.getVolumePath())
Line 1559: 
Line 1560:         vol_md_fmt = volume.FMT2STR[vol.getFormat()]
Lets call this expected_format
Line 1561:         uploaded_fmt = vol_qemu_info["format"]
Line 1562:         if vol_md_fmt != uploaded_fmt:
Line 1563:             raise se.ImageVerificationError(
Line 1564:                 "Uploaded image format is %s while the format specified "


Line 1557:         vol = dom.produceVolume(imgUUID, volUUID)
Line 1558:         vol_qemu_info = qemuimg.info(vol.getVolumePath())
Line 1559: 
Line 1560:         vol_md_fmt = volume.FMT2STR[vol.getFormat()]
Line 1561:         uploaded_fmt = vol_qemu_info["format"]
And actual_format
Line 1562:         if vol_md_fmt != uploaded_fmt:
Line 1563:             raise se.ImageVerificationError(
Line 1564:                 "Uploaded image format is %s while the format specified "
Line 1565:                 "by the user is %s" % (uploaded_fmt, vol_md_fmt)


Line 1562:         if vol_md_fmt != uploaded_fmt:
Line 1563:             raise se.ImageVerificationError(
Line 1564:                 "Uploaded image format is %s while the format specified "
Line 1565:                 "by the user is %s" % (uploaded_fmt, vol_md_fmt)
Line 1566:             )
We don't use this style, look how other logs are formatted in this file.
Line 1567:         if "backingfile" in vol_qemu_info:
Line 1568:             raise se.ImageVerificationError(
Line 1569:                 "'%s' is defined as a backingfile, while backingfile is not "
Line 1570:                 "allowed for an uploaded image."


-- 
To view, visit https://gerrit.ovirt.org/55746
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf85061536eb4ddff021539c742a674f183a8984
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadgett at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list