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.
This commit is contained in:
Marek Marczykowski 2012-08-16 01:53:49 +02:00
parent 9b3a77bc1d
commit 26fca20d45

View File

@ -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