Skip to content

Commit

Permalink
Add some logging to ease debugging libvirt errors
Browse files Browse the repository at this point in the history
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 530a794)
  • Loading branch information
marmarek committed Feb 26, 2016
1 parent 8abdeb8 commit bc9621c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core-modules/000QubesVm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit bc9621c

Please sign in to comment.