Hello Federico Simoncelli,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/31048
to review the following change.
Change subject: Live Merge: improve log messages
......................................................................
Live Merge: improve log messages
Make it easier to debug live merge flows by reporting the job ID
whenever it is available. This will make the messages more istent and
easy to correlate.
Change-Id: Ib5d22e4c503d5781eb1dc00c6c326146d5bbbbd1
Signed-off-by: Adam Litke <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/29310
Reviewed-by: Federico Simoncelli <[email protected]>
---
M vdsm/virt/vm.py
1 file changed, 11 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/31048/1
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 0990d3d..4d43c1e 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -5467,9 +5467,9 @@
'chain': self._driveGetActualVolumeChain(drive)}
self.conf['_blockJobs'][jobID] = newJob
else:
- self.log.error("A block job with id %s already exists for vm "
- "disk with image id: %s" %
- (job['jobID'], drive['imageID']))
+ self.log.error("Cannot add block job %s. A block job with id "
+ "%s already exists for image %s", jobID,
+ job['jobID'], drive['imageID'])
raise BlockJobExistsError()
self.saveState()
@@ -5490,8 +5490,7 @@
drive = self._findDriveByUUIDs(job['disk'])
ret = self._dom.blockJobInfo(drive.name, 0)
if not ret:
- self.log.debug("Block Job for vm:%s, img:%s has ended",
- self.conf['vmId'], job['disk']['imageID'])
+ self.log.info("Block Job %s has ended", jobID)
jobs[jobID] = None
continue
@@ -5567,7 +5566,7 @@
except BlockJobExistsError:
self.log.error("Another block job is already active on this disk")
return errCode['mergeErr']
- self.log.debug("Starting merge with jobUUID='%s'", jobUUID)
+ self.log.info("Starting merge with jobUUID='%s'", jobUUID)
flags = 0
# Indicate that we expect libvirt to maintain the relative paths of
@@ -5585,8 +5584,7 @@
if ret != 0:
raise RuntimeError("blockCommit operation failed rc:%i", ret)
except (RuntimeError, libvirt.libvirtError):
- self.log.error("Live merge failed for '%s'", drive.path,
- exc_info=True)
+ self.log.exception("Live merge failed (job: %s)", jobUUID)
self.untrackBlockJob(jobUUID)
return errCode['mergeErr']
@@ -5694,12 +5692,13 @@
device['volumeChain'] = drive.volumeChain = newChain
def _onBlockJobEvent(self, path, blockJobType, status):
+ self.log.debug("Received block job event for path:%s, type:%s, "
+ "status:%s", path, blockJobType, status)
if blockJobType != libvirt.VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT:
self.log.warning("Ignoring unrecognized block job type: '%s'",
blockJobType)
return
- self.log.info("Live merge completed for path '%s'", path)
drive = self._lookupDeviceByPath(path)
try:
jobID = self.getBlockJob(drive)['jobID']
@@ -5709,10 +5708,11 @@
return
if status == libvirt.VIR_DOMAIN_BLOCK_JOB_COMPLETED:
+ self.log.info("Live merge completed (job:%s)", jobID)
self._syncVolumeChain(drive)
else:
- self.log.warning("Block job '%s' did not complete successfully "
- "(status:%i)", path, status)
+ self.log.warning("Block job %s did not complete successfully "
+ "(status:%i)", jobID, status)
self.untrackBlockJob(jobID)
def _initLegacyConf(self):
--
To view, visit http://gerrit.ovirt.org/31048
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5d22e4c503d5781eb1dc00c6c326146d5bbbbd1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches