From bc9621c8afe43ca9803193b4ebe0587689900c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 6 Jan 2016 04:32:11 +0100 Subject: [PATCH] Add some logging to ease debugging libvirt errors Temporary add some more logging to ease debugging libvirt errors. Unfortunatelly stack trace doesn't contain actual error. QubesOS/qubes-issues#1537 (cherry picked from commit 530a79417f27f391164c34aeef1a5a5ee523073c) --- core-modules/000QubesVm.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index 0b2010cd5..cc06bbc86 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -711,6 +711,8 @@ def xid(self): if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN: return -1 else: + print >>sys.stderr, "libvirt error code: {!r}".format( + e.get_error_code()) raise @@ -766,6 +768,8 @@ def get_mem(self): elif e.get_error_code() == libvirt.VIR_ERR_INTERNAL_ERROR: return 0 else: + print >>sys.stderr, "libvirt error code: {!r}".format( + e.get_error_code()) raise def get_cputime(self): @@ -783,6 +787,8 @@ def get_cputime(self): elif e.get_error_code() == libvirt.VIR_INTERNAL_ERROR: return 0 else: + print >>sys.stderr, "libvirt error code: {!r}".format( + e.get_error_code()) raise def get_mem_static_max(self): @@ -824,6 +830,8 @@ def get_per_cpu_time(self): if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN: return 0 else: + print >>sys.stderr, "libvirt error code: {!r}".format( + e.get_error_code()) raise def get_disk_utilization_root_img(self): @@ -899,6 +907,8 @@ def is_running(self): if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN: return False else: + print >>sys.stderr, "libvirt error code: {!r}".format( + e.get_error_code()) raise def is_paused(self): @@ -911,6 +921,8 @@ def is_paused(self): if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN: return False else: + print >>sys.stderr, "libvirt error code: {!r}".format( + e.get_error_code()) raise def get_start_time(self): @@ -1355,6 +1367,8 @@ def remove_from_disk(self): # already undefined pass else: + print >>sys.stderr, "libvirt error code: {!r}".format( + e.get_error_code()) raise self.storage.remove_from_disk()