Federico Simoncelli has posted comments on this change.
Change subject: Live Merge: add reconcileVolumeChain verb
......................................................................
Patch Set 2:
(4 comments)
http://gerrit.ovirt.org/#/c/31788/2/client/vdsClient.py
File client/vdsClient.py:
Line 2555: '<spUUID> <sdUUID> <imgUUID>
[<volUUID>]',
Line 2556: 'Teardown an image, releasing the prepared volumes.'
Line 2557: )),
Line 2558: 'reconcileVolumeChain': (serv.reconcileVolumeChain, (
Line 2559: '<spUUID> <sdUUID> <imgUUID>
<leafVolUUID>',
To generalize this verb we probably want leafVolUUID to be optional.
Line 2560: 'Reconcile an image volume chain and return the current
chain.'
Line 2561: )),
Line 2562: 'moveMultiImage': (serv.moveMultiImage,
Line 2563: ('<spUUID> <srcDomUUID>
<dstDomUUID> '
http://gerrit.ovirt.org/#/c/31788/2/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:
Line 1837:
Line 1838: imageResourcesNamespace = sd.getNamespace(sdUUID, IMAGE_NAMESPACE)
Line 1839: with rmanager.acquireResource(imageResourcesNamespace, imgUUID,
Line 1840: rm.LockType.shared):
Line 1841: curChain = img.getChain(sdUUID, imgUUID, volUUID)
Related to a following comment below: this logic seems to belong to image.py (it should be
relevant to this patch as you're calling it from reconcileVolumeChain).
Line 1842: subChain = []
Line 1843: for vol in curChain:
Line 1844: if vol.volUUID not in newChain:
Line 1845: subChain.insert(0, vol.volUUID)
Line 1870: """
Line 1871: argsStr = ("spUUID=%s, sdUUID=%s, imgUUID=%s, leafVolUUID=%s"
%
Line 1872: (spUUID, sdUUID, imgUUID, leafVolUUID))
Line 1873: vars.task.setDefaultException(se.StorageException("%s" %
argsStr))
Line 1874: dom = sdCache.produce(sdUUID=sdUUID)
So we're not enforcing this verb as an SPM verb?
Line 1875: self.prepareImage(sdUUID, spUUID, imgUUID, leafVolUUID)
Line 1876:
Line 1877: # Walk the volume chain using qemu-img. Not safe for running VMs
Line 1878: retVolumes = []
Line 1876:
Line 1877: # Walk the volume chain using qemu-img. Not safe for running VMs
Line 1878: retVolumes = []
Line 1879: volUUID = leafVolUUID
Line 1880: while volUUID is not None:
All the logic doesn't belong here. It should probably go in image.py.
Line 1881: retVolumes.insert(0, volUUID)
Line 1882: vol = dom.produceVolume(imgUUID, volUUID)
Line 1883: qemuImgFormat = volume.fmt2str(vol.getFormat())
Line 1884: imgInfo = qemuimg.info(vol.volumePath, qemuImgFormat)
--
To view, visit
http://gerrit.ovirt.org/31788
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia8927a42d2bc9adcf7c6b26babb327a00e91e49e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Adam Litke <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadgett(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes