From 26fca20d4566f740e2075c271313d61fcd4dad05 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 16 Aug 2012 01:53:49 +0200 Subject: [PATCH] dom0/qmemman: fix reporting to qubes-manager When VM is shutting down, xenstore entries (especially 'name') can be deleted before qmemman remove VM from its list. So check if name is defined before reporting to qubes-manager. --- dom0/qmemman/qmemman.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dom0/qmemman/qmemman.py b/dom0/qmemman/qmemman.py index 7b6f687e..d88d75e3 100755 --- a/dom0/qmemman/qmemman.py +++ b/dom0/qmemman/qmemman.py @@ -214,12 +214,14 @@ class SystemState: print 'dom %s didnt react to memory request (holds %d, requested balloon down to %d)' % (dom2, self.domdict[dom2].memory_actual, mem2) self.domdict[dom2].no_progress = True dom_name = self.xs.read('', '/local/domain/%s/name' % str(dom2)) - notify_error_qubes_manager(dom_name, no_progress_msg) + if dom_name is not None: + notify_error_qubes_manager(str(dom_name), no_progress_msg) else: print 'dom %s still hold more memory than have assigned (%d > %d)' % (dom2, self.domdict[dom2].memory_actual, mem2) self.domdict[dom2].slow_memset_react = True dom_name = self.xs.read('', '/local/domain/%s/name' % str(dom2)) - notify_error_qubes_manager(dom_name, slow_memset_react_msg) + if dom_name is not None: + notify_error_qubes_manager(str(dom_name), slow_memset_react_msg) self.mem_set(dom, self.get_free_xen_memory() + self.domdict[dom].memory_actual - self.XEN_FREE_MEM_LEFT) return