Change in vdsm[ovirt-3.6]: Don't prepare image with illegal volumes

ahino at redhat.com ahino at redhat.com
Sun May 1 11:54:34 UTC 2016


Hello Nir Soffer, Adam Litke, Francesco Romani,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/56881

to review the following change.

Change subject: Don't prepare image with illegal volumes
......................................................................

Don't prepare image with illegal volumes

The irs verb 'prepareImage' is used only by clientIF when preparing the
host to start a VM.  Currently, this operation succeeds even if one or
more of the volumes in the image is illegal.  Since we should never
permit a VM to start with an illegal disk, check for this and report an
error if any illegal volumes are found.

The pivot stage of a live merge operation depends on this behavior to
ensure that a VM is not accidentally started using a stale leaf volume.

Bug-Url: https://bugzilla.redhat.com/1331572
Change-Id: Ie543aeb8bdb52305419613ab6297681817124308
Signed-off-by: Adam Litke <alitke at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/39302
Reviewed-by: Greg Padgett <gpadgett at redhat.com>
Reviewed-by: Allon Mureinik <amureini at redhat.com>
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
Continuous-Integration: Jenkins CI
---
M vdsm/storage/hsm.py
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/56881/1

diff --git a/vdsm/storage/hsm.py b/vdsm/storage/hsm.py
index 3a04424..1880da8 100644
--- a/vdsm/storage/hsm.py
+++ b/vdsm/storage/hsm.py
@@ -3221,6 +3221,11 @@
         if leafUUID not in imgVolumes:
             raise se.VolumeDoesNotExist(leafUUID)
 
+        for volUUID in imgVolumes:
+            legality = dom.produceVolume(imgUUID, volUUID).getLegality()
+            if legality == volume.ILLEGAL_VOL:
+                raise se.prepareIllegalVolumeError(volUUID)
+
         imgPath = dom.activateVolumes(imgUUID, imgVolumes)
         if spUUID and spUUID != sd.BLANK_UUID:
             runImgPath = dom.linkBCImage(imgPath, imgUUID)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie543aeb8bdb52305419613ab6297681817124308
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list