Change in vdsm[master]: virt: dump domain xml when change is detected

fromani at redhat.com fromani at redhat.com
Tue Sep 30 15:50:27 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: virt: dump domain xml when change is detected
......................................................................

virt: dump domain xml when change is detected

The Domain XML should not change often during the lifetime of a VM.
Nevertheless, it is greatly helpful to have up-to-date information
when troubleshooting issues.

This patch logs the domain XML whenever a change is detected, to improve
the debuggability of VDSM.

Change-Id: I658ed887e258c4217a3d1eddb4924688b5a613f6
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/49/33549/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index ad8cb0e..e728902 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -4492,8 +4492,11 @@
         self._lastXMLDesc = self._dom.XMLDesc(0)
         devxml = _domParseStr(self._lastXMLDesc).childNodes[0]. \
             getElementsByTagName('devices')[0]
-        self._devXmlHash = hash(devxml.toxml())
-
+        xmlHash = hash(devxml.toxml())
+        if xmlHash != self._devXmlHash:
+            self.log.debug('changed device configuration:\n%s',
+                           self._lastXMLDesc)
+        self._devXmlHash = xmlHash
         return self._lastXMLDesc
 
     def _ejectFloppy(self):


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I658ed887e258c4217a3d1eddb4924688b5a613f6
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list