Nir Soffer has posted comments on this change.

Change subject: storage: Move detect_format to new workarounds module
......................................................................


Patch Set 2:

(7 comments)

https://gerrit.ovirt.org/#/c/64229/2/tests/storage_workarounds_test.py
File tests/storage_workarounds_test.py:

Line 30: from vdsm.storage import constants as sc
Line 31: 
Line 32: 
Line 33: md_formats = dict(raw=sc.RAW_FORMAT, cow=sc.COW_FORMAT)
Line 34: qemu_formats = dict(raw=qemuimg.FORMAT.RAW, cow=qemuimg.FORMAT.QCOW2)
Nice!
Line 35: VM_CONF_SIZE = workarounds.VM_CONF_SIZE_BLK * sc.BLOCK_SIZE
Line 36: 
Line 37: 
Line 38: def make_volume(env, size, md_fmt, real_fmt):


Line 40:     vol_id = str(uuid.uuid4())
Line 41:     env.make_volume(size, img_id, vol_id, 
vol_format=md_formats[md_fmt])
Line 42:     vol = env.sd_manifest.produceVolume(img_id, vol_id)
Line 43:     qemuimg.create(vol.getVolumePath(), size, qemu_formats[real_fmt])
Line 44:     return vol
Neat
Line 45: 
Line 46: 
Line 47: class DetectFormatTest(VdsmTestCase):
Line 48: 


https://gerrit.ovirt.org/#/c/64229/2/vdsm/storage/Makefile.am
File vdsm/storage/Makefile.am:

Line 55:        taskManager.py \
Line 56:        task.py \
Line 57:        threadPool.py \
Line 58:        volume.py \
Line 59:        workarounds.py \
We cannot create new volumes in the vdsm tree - we are trying to move stuff to 
lib/vdsm. Please move this to lib/vdsm/storage/workarounds.py
Line 60:        $(NULL)
Line 61: 
Line 62: dist_vdsmexec_SCRIPTS = \
Line 63:        curl-img-wrap \


https://gerrit.ovirt.org/#/c/64229/2/vdsm/storage/workarounds.py
File vdsm/storage/workarounds.py:

Line 35: 
Line 36:     Since commit 0b61c4851a528fd6354d9ab77a68085c41f35dc9 copy of 
internal raw
Line 37:     volumes is done using 'qemu-img convert' instead of invoking 'dd'.
Line 38: 
Line 39:     Consequently, exporting VM metadata images (produce during live 
snapshot)
produced
Line 40:     fails on qemu-img convert - since the images 'impersonate' to 
qcow2 (the
Line 41:     format in .meta file is cow, whereas the real format is raw).  
This problem
Line 42:     is documented by 
https://bugzilla.redhat.com/show_bug.cgi?id=1282239 and
Line 43:     has subsequently been fixed in ovirt-engine


Line 38: 
Line 39:     Consequently, exporting VM metadata images (produce during live 
snapshot)
Line 40:     fails on qemu-img convert - since the images 'impersonate' to 
qcow2 (the
Line 41:     format in .meta file is cow, whereas the real format is raw).  
This problem
Line 42:     is documented by 
https://bugzilla.redhat.com/show_bug.cgi?id=1282239 and
can you use https://bugzilla.redhat.com/1282239?
Line 43:     has subsequently been fixed in ovirt-engine
Line 44:     (see https://gerrit.ovirt.org/#/c/48768/).
Line 45: 
Line 46:     Since VM metadata volumes with this problem may still exist in 
storage we


Line 40:     fails on qemu-img convert - since the images 'impersonate' to 
qcow2 (the
Line 41:     format in .meta file is cow, whereas the real format is raw).  
This problem
Line 42:     is documented by 
https://bugzilla.redhat.com/show_bug.cgi?id=1282239 and
Line 43:     has subsequently been fixed in ovirt-engine
Line 44:     (see https://gerrit.ovirt.org/#/c/48768/).
Can you use https://gerrit.ovirt.org/48768?
Line 45: 
Line 46:     Since VM metadata volumes with this problem may still exist in 
storage we
Line 47:     must keep using this workaround to avoid problems with copying VM 
disks.
Line 48:     """


Line 44:     (see https://gerrit.ovirt.org/#/c/48768/).
Line 45: 
Line 46:     Since VM metadata volumes with this problem may still exist in 
storage we
Line 47:     must keep using this workaround to avoid problems with copying VM 
disks.
Line 48:     """
I don't think any workaround got such quality documentation :-)
Line 49:     src_format = srcVol.getFormat()
Line 50:     size_in_blk = srcVol.getSize()
Line 51:     if src_format == sc.COW_FORMAT and size_in_blk == VM_CONF_SIZE_BLK:
Line 52:         info = qemuimg.info(srcVol.getVolumePath())


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If4da9d2c16679f99b55438d7336d0cfb27429c12
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to