Change in vdsm[master]: Relink template hard links to meta and lease files

abaron at redhat.com abaron at redhat.com
Mon Mar 18 19:50:17 UTC 2013


Ayal Baron has posted comments on this change.

Change subject: Relink template hard links to meta and lease files
......................................................................


Patch Set 2: I would prefer that you didn't submit this

(5 inline comments)

....................................................
Commit Message
Line 5: CommitDate: 2013-03-10 16:04:22 +0200
Line 6: 
Line 7: Relink template hard links to meta and lease files
Line 8: 
Line 9: Every image that is based on a template contains a hard
In file based domains every image...
Line 10: link to the template volumes.
Line 11: When copying the template to the storage domain to replace
Line 12: the old/fake one we relink the volumes in the dependant
Line 13: image to the new template volumes.


Line 7: Relink template hard links to meta and lease files
Line 8: 
Line 9: Every image that is based on a template contains a hard
Line 10: link to the template volumes.
Line 11: When copying the template to the storage domain to replace
s/.*/Since an export domain may contain images without the backing template,
when copying the template to the export domain we need to relink the derived images to it to be able to later on collapse the chain on import (without qemu-img crashing). In addition, in case we're importing a template to override a corrupted template we also need to relink.
Line 12: the old/fake one we relink the volumes in the dependant
Line 13: image to the new template volumes.
Line 14: 
Line 15: Change-Id: Idce0f3f1812fdf45efeeeffcccb7dc22b3b0d0f0


....................................................
File vdsm/storage/blockSD.py
Line 1250:         """
Line 1251:         Relink all hardlinks of the template 'volUUID' in all VMs based on it.
Line 1252:         No need to relink template for block domains.
Line 1253:         """
Line 1254:         self.log.debug("Doesn't relink templates non-File domain %s",
s/.*/Skipping relink of template, domain %s is not file based/
Line 1255:                        self.sdUUID)
Line 1256: 
Line 1257: 
Line 1258: def _createVMSfs(dev):


....................................................
File vdsm/storage/fileSD.py
Line 544:             for ext in ['', fileVolume.META_FILEEXT, fileVolume.LEASE_FILEEXT]:
Line 545:                 tLink = (tVolPath + ext) % rImg
Line 546:                 tVol = (tVolPath + ext) % templateImage
Line 547:                 try:
Line 548:                     self.oop.os.unlink(tLink)
sorry for not noticing this before but we should be using self.oop.fileUtils.safeUnlink
and remove the try except here.
ENOENT is relevant for the unlink only (and handled in safeUnlink) and here we wouldn't be linking the template in case the fakeTemplate is missing for some reason which doesn't seem right.
Line 549:                     self.oop.os.link(tVol, tLink)
Line 550:                 except OSError as e:
Line 551:                     if e.errno != os.errno.ENOENT:
Line 552:                         raise


....................................................
File vdsm/storage/fileVolume.py
Line 538: 
Line 539:     @classmethod
Line 540:     def __metaVolumePath(cls, vol_path):
Line 541:         if vol_path:
Line 542:             return vol_path + META_FILEEXT
since you're making changes here, it would be nice (but not mandatory) if you renamed vol_path to volPath
Line 543:         else:
Line 544:             return None
Line 545: 
Line 546:     @classmethod


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Idce0f3f1812fdf45efeeeffcccb7dc22b3b0d0f0
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list