Fix race condition in QubesVm.get_cputime/get_mem
When domain is destroyed after isActive check, but before getting actuall info, it would fail. So handle this situation.
This commit is contained in:
parent
e475e291a9
commit
1c0ade6166
@ -760,6 +760,9 @@ class QubesVm(object):
|
|||||||
except libvirt.libvirtError as e:
|
except libvirt.libvirtError as e:
|
||||||
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
|
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
|
||||||
return 0
|
return 0
|
||||||
|
# libxl_domain_info failed - domain no longer exists
|
||||||
|
elif e.get_error_code() == libvirt.VIR_INTERNAL_ERROR:
|
||||||
|
return 0
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@ -774,6 +777,9 @@ class QubesVm(object):
|
|||||||
except libvirt.libvirtError as e:
|
except libvirt.libvirtError as e:
|
||||||
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
|
if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
|
||||||
return 0
|
return 0
|
||||||
|
# libxl_domain_info failed - domain no longer exists
|
||||||
|
elif e.get_error_code() == libvirt.VIR_INTERNAL_ERROR:
|
||||||
|
return 0
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user