Skip to content

Commit

Permalink
launch: libvirt: In error messages, display err->int1, don't display …
Browse files Browse the repository at this point in the history
…domain.

The err->domain field is essentially random from the point of view
of libguestfs.

The err->int1 field has some useful information in some circumstances:
it has the errno value from the failed system call.
  • Loading branch information
rwmjones committed Jan 19, 2016
1 parent d029fa0 commit c3ebc0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/launch-libvirt.c
Expand Up @@ -2091,8 +2091,8 @@ libvirt_error (guestfs_h *g, const char *fs, ...)
/* In all recent libvirt, this retrieves the thread-local error. */
err = virGetLastError ();
if (err)
error (g, "%s: %s [code=%d domain=%d]",
msg, err->message, err->code, err->domain);
error (g, "%s: %s [code=%d int1=%d]",
msg, err->message, err->code, err->int1);
else
error (g, "%s", msg);

Expand Down Expand Up @@ -2124,8 +2124,8 @@ libvirt_debug (guestfs_h *g, const char *fs, ...)
/* In all recent libvirt, this retrieves the thread-local error. */
err = virGetLastError ();
if (err)
debug (g, "%s: %s [code=%d domain=%d]",
msg, err->message, err->code, err->domain);
debug (g, "%s: %s [code=%d int1=%d]",
msg, err->message, err->code, err->int1);
else
debug (g, "%s", msg);

Expand Down

0 comments on commit c3ebc0a

Please sign in to comment.