Skip to contentSkip to conversation

Add "dumpcore_in_progress" flag to xenstore information

PATCH New Masaki Kanno 1 participant 1 message Apr 3, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add "dumpcore_in_progress" flag to xenstore information

Hi,

By using xenstore-ls, I'd like to know whether a core dump of a guest domain is being collected or not. Could you apply this patch?

Best regards,
Kan

tools/python/xen/xend/XendConstants.py +1 -0
diff -r db943e8d1051 tools/python/xen/xend/XendConstants.py
@@ -96,6 +96,7 @@ MINIMUM_RESTART_TIME = 20
 MINIMUM_RESTART_TIME = 20
 
 RESTART_IN_PROGRESS = 'xend/restart_in_progress'
+DUMPCORE_IN_PROGRESS = 'xend/dumpcore_in_progress'
 LAST_SHUTDOWN_REASON = 'xend/last_shutdown_reason'
 
 TRIGGER_NMI   = 0
tools/python/xen/xend/XendDomainInfo.py +3 -0
diff -r db943e8d1051 tools/python/xen/xend/XendDomainInfo.py
@@ -1792,10 +1792,13 @@ class XendDomainInfo:
                 raise XendError("Cannot dump core in a directory: %s" %
                                 corefile)
             
+            self._writeVm(DUMPCORE_IN_PROGRESS, 'True')
             xc.domain_dumpcore(self.domid, corefile)
+            self._removeVm(DUMPCORE_IN_PROGRESS)
         except RuntimeError, ex:
             corefile_incomp = corefile+'-incomplete'
             os.rename(corefile, corefile_incomp)
+            self._removeVm(DUMPCORE_IN_PROGRESS)
             log.exception("XendDomainInfo.dumpCore failed: id = %s name = %s",
                           self.domid, self.info['name_label'])
             raise XendError("Failed to dump core: %s" %  str(ex))

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel