From 02601049ca74b09372413dd5ecda5ecdaa8a1f69 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Mon, 15 Oct 2012 01:58:07 +0200 Subject: [PATCH] dom0/qmemman: do not fail when domain name not available This can be the case when domain just dissapeared (destroy), but qmemman didn't processed xenstore watch trigger. --- 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 d88d75e3..c35f4e8e 100755 --- a/dom0/qmemman/qmemman.py +++ b/dom0/qmemman/qmemman.py @@ -66,13 +66,15 @@ class SystemState: if self.domdict[i].slow_memset_react and \ self.domdict[i].memory_actual <= self.domdict[i].last_target + self.XEN_FREE_MEM_LEFT/4: dom_name = self.xs.read('', '/local/domain/%s/name' % str(i)) - clear_error_qubes_manager(dom_name, slow_memset_react_msg) + if dom_name is not None: + clear_error_qubes_manager(dom_name, slow_memset_react_msg) self.domdict[i].slow_memset_react = False if self.domdict[i].no_progress and \ self.domdict[i].memory_actual <= self.domdict[i].last_target + self.XEN_FREE_MEM_LEFT/4: dom_name = self.xs.read('', '/local/domain/%s/name' % str(i)) - clear_error_qubes_manager(dom_name, no_progress_msg) + if dom_name is not None: + clear_error_qubes_manager(dom_name, no_progress_msg) self.domdict[i].no_progress = False #the below works (and is fast), but then 'xm list' shows unchanged memory value