Change in vdsm[master]: Live Merge: improve log messages

alitke at redhat.com alitke at redhat.com
Thu Jun 26 19:30:10 UTC 2014


Adam Litke has uploaded a new change for review.

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 consistent
and easy to correlate.

Change-Id: Ib5d22e4c503d5781eb1dc00c6c326146d5bbbbd1
Signed-off-by: Adam Litke <alitke at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 9 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/10/29310/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 2deed52..00aca8b 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -5431,9 +5431,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()
 
@@ -5462,9 +5462,7 @@
                 if 'done' not in job:
                     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.debug("Block Job %s has ended", jobID)
                         job['done'] = True
 
                 entry = {'id': jobID, 'jobType': 'block',
@@ -5559,7 +5557,7 @@
                 if ret != 0:
                     raise RuntimeError("blockCommit failed rc:%i", ret)
             except (RuntimeError, libvirt.libvirtError):
-                self.log.error("Live merge failed for '%s'", drive.path)
+                self.log.error("Live merge failed (job: %s)", jobUUID)
                 self.untrackBlockJob(jobUUID)
                 return errCode['mergeErr']
 
@@ -5694,18 +5692,18 @@
 
         if status not in (libvirt.VIR_DOMAIN_BLOCK_JOB_COMPLETED,
                           libvirt.VIR_DOMAIN_BLOCK_JOB_READY):
-            self.log.warning("Block job on '%s' did not complete successfully "
-                             "(status:%i)", diskName, status)
+            self.log.warning("Block job %s did not complete successfully "
+                             "(status:%i)", jobID, status)
             self.untrackBlockJob(jobID)
             return
 
         if blockJobType == libvirt.VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT:
-            self.log.info("Live merge completed for disk '%s'", diskName)
+            self.log.info("Live merge completed (job %s)", jobID)
             self._syncVolumeChain(drive)
             self.untrackBlockJob(jobID)
         elif isActiveCommit(blockJobType, status):
             self.log.info("Requesting pivot to complete active layer commit "
-                          "for disk '%s'", diskName)
+                          "(job %s)", jobID)
             self._onBlockJobActiveCommitEvent(diskName)
         else:
             self.log.warning("Received unexpected block job event %i on disk "


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib5d22e4c503d5781eb1dc00c6c326146d5bbbbd1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke at redhat.com>


More information about the vdsm-patches mailing list