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
  • Loading branch information
marmarek committed Jan 7, 2016
1 parent 4af5a05 commit 530a794
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 @@ -723,6 +723,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 @@ -778,6 +780,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 @@ -795,6 +799,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 @@ -836,6 +842,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 @@ -911,6 +919,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 @@ -923,6 +933,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 @@ -1371,6 +1383,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 530a794

Please sign in to comment.