Federico Simoncelli has uploaded a new change for review.
Change subject: sd: fix volume path returned by linkBCImage
......................................................................
sd: fix volume path returned by linkBCImage
In a previous commit (c072945 One shot prepare) we involuntarily
changed the path used for virtual machine images from:
/rhev/data-center/<spUUID>/<sdUUID>/images/<imgUUID>/<volUUID>
to:
/rhev/data-center/mnt/blockSD/<sdUUID>/images/<imgUUID>/<volUUID>
This patch reverts to the previous path in order to minimize the
differences between different versions of vdsm that could lead to
live migration issues, e.g.
libvirtError: invalid argument: invalid path ... not assigned to
domain
Change-Id: Iea497b574d9a9a7e0e9b8e234e2bd9b9d983a60c
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=1059482
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
---
M vdsm/storage/blockSD.py
M vdsm/storage/fileSD.py
M vdsm/storage/sd.py
3 files changed, 8 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/15/24315/1
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 5179c5a..587e617 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -1053,8 +1053,7 @@
return rems
def linkBCImage(self, imgPath, imgUUID):
- dst = os.path.join(self.mountpoint, self.sdUUID, sd.DOMAIN_IMAGES,
- imgUUID)
+ dst = self.getLinkBCImagePath(imgUUID)
try:
os.symlink(imgPath, dst)
except OSError as e:
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py
index 180a43f..0f52718 100644
--- a/vdsm/storage/fileSD.py
+++ b/vdsm/storage/fileSD.py
@@ -422,8 +422,8 @@
for k, v in volumes.iteritems())
def linkBCImage(self, imgPath, imgUUID):
- return os.path.join(self.mountpoint, self.sdUUID, sd.DOMAIN_IMAGES,
- imgUUID)
+ # Nothing to do here other than returning the path
+ return self.getLinkBCImagePath(imgUUID)
def createImageLinks(self, srcImgPath, imgUUID):
"""
diff --git a/vdsm/storage/sd.py b/vdsm/storage/sd.py
index c9738e0..fd4c9db 100644
--- a/vdsm/storage/sd.py
+++ b/vdsm/storage/sd.py
@@ -25,6 +25,7 @@
from collections import namedtuple
import codecs
+import image
import storage_exception as se
import misc
import resourceFactories
@@ -643,6 +644,10 @@
# If it has a repo we don't have multiple domains. Assume single pool
return os.path.join(self.storage_repository, self.getPools()[0])
+ def getLinkBCImagePath(self, imgUUID):
+ return image.Image(self._getRepoPath()) \
+ .getImageDir(self.sdUUID, imgUUID)
+
def getIsoDomainImagesDir(self):
"""
Get 'images' directory from Iso domain
--
To view, visit
http://gerrit.ovirt.org/24315
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iea497b574d9a9a7e0e9b8e234e2bd9b9d983a60c
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>