Adam Litke has uploaded a new change for review. Change subject: Live Merge: Update path using libvirt supplied value ......................................................................
Live Merge: Update path using libvirt supplied value When libvirt pivots the active layer after a live merge, the live XML is updated to reflect the path of the new active layer. The new path is copied from the backingStore pointer of the old active layer. Since that is a relative path, libvirt makes it absolute but it will not remove the '../' path component since that is not always correct (even though it would be correct for our environment). When syncing the volume chain, we must use the same path as libvirt does, otherwise future calls to libvirt may fail. Change-Id: Ie341333ad934645c0fe4f2fd31733c459d306d9a Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1109920 Signed-off-by: Adam Litke <[email protected]> --- M vdsm/virt/vm.py 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/65/31365/1 diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index 0706ea7..3bb9ce0 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -5474,7 +5474,7 @@ break sourceAttr = ('file', 'dev')[drive.blockDev] path = sourceXML.getAttribute(sourceAttr) - info = {'id': pathToVolID(drive, path)} + info = {'id': pathToVolID(drive, path), 'path': path} volChain.insert(0, info) bsXML = findElement(diskXML, 'backingStore') if not bsXML: @@ -5501,6 +5501,7 @@ return volumes = [v['id'] for v in ret] + activePath = ret[-1]['path'] self.log.debug("vdsm chain: %s, libvirt chain: %s", curVols, volumes) # Ask the storage to sync metadata according to the new chain @@ -5518,9 +5519,13 @@ # If the active layer changed: # Update the disk path, volumeID, and volumeInfo members volInfo = getVolumeInfo(device, volumeID) - device['path'] = drive.path = volInfo['path'] + # Path must be set with the value being used by libvirt + device['path'] = drive.path = volInfo['path'] = activePath device['volumeID'] = drive.volumeID = volumeID device['volumeInfo'] = drive.volumeInfo = volInfo + for v in device['volumeChain']: + if v['volumeID'] == volumeID: + v['path'] = activePath # Remove any components of the volumeChain which are no longer present newChain = [x for x in device['volumeChain'] -- To view, visit http://gerrit.ovirt.org/31365 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie341333ad934645c0fe4f2fd31733c459d306d9a Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Adam Litke <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
