Bug 818467
Summary: | Improve libvirt debug capability | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Alex Jia <ajia> |
Component: | libvirt | Assignee: | Laine Stump <laine> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 6.3 | CC: | acathrow, bili, dallan, dyasny, dyuan, mzhan, rwu, tzheng |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.10.0-0rc1.el6 | Doc Type: | Bug Fix |
Doc Text: |
Cause: Many external programs that are used by libvirt (e.g. qemu-kvm) produce useful error messages that were not passed on to the admin by libvirt, which instead would sometimes just report that a command had failed.
Consequence: Sometimes a problem whose cause/resolution would have been trivial to discover by looking at the error output of a command, were instead very difficult to diagnose.
Fix: If any external command run by libvirt exits with a failure, its stderr output will be captured and added to the system log as a libvirt error.
Result: Many problems are now easier to diagnose, because better information is available.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-21 07:12:38 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Alex Jia
2012-05-03 07:39:38 UTC
I've sent a patch upstream which will include the output of stderr in the error log of any failed external command: https://www.redhat.com/archives/libvir-list/2012-August/msg00404.html For example, I tried removing the usbredir rpm, and the following log message was generated when I tried to start a guest: error : virCommandWait:2336 : internal error Child process (LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin /usr/bin/qemu-kvm -help) unexpected exit status 127: /usr/bin/qemu-kvm: error while loading shared libraries: libusbredirparser.so.0: cannot open shared object file: No such file or directory (BTW, it takes some really explicit effort to install libvirt without its dependencies - even just using rpm rather than yum won't do it, you have to actually force rpm to ignore the dependencies. Because of that, my opinion is that anybody who ends up with a system broken in this way deserves it. However, the information is there, and could also be useful in other more legitimate situations, so it's still good to provide it.) The following patch has been pushed to upstream libvirt, and will be in the next rebase: commit b8c298d3019ffed3f93989314c90821ddbe47f83 Author: Laine Stump <laine> Date: Mon Aug 6 11:40:06 2012 -0400 util: include stderr in log message when an external command fails This patch is in response to: https://bugzilla.redhat.com/show_bug.cgi?id=818467 If a caller to virCommandRun doesn't ask for the exitstatus of the program it's running, the virCommand functions assume that they should log an error message and return failure if the exit code isn't 0. However, only the commandline and exit status are logged, while potentially useful information sent by the program to stderr is discarded. Fortunately, virCommandRun is already checking if the caller had asked for stderr to be saved and, if not, sets things up to save it in *cmd->errbuf. This makes it fairly simple for virCommandWait to include *cmd->errbuf in the error log (there are still other callers that don't setup errbuf, and even virCommandRun won't set it up if the command is being daemonized, so we have to check that it's non-zero). Verifying this bug in libvirt-0.10.0-0rc1.el6: Do not install usbredir, restart libvirtd and check libvirtd.log at the same time, get error like: 2012-08-23 09:45:53.495+0000: 11237: error : virCommandWait:2332 : internal error Child process (LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/libexec/qemu-kvm -help) unexpected exit status 127: /usr/libexec/qemu-kvm: error while loading shared libraries: libusbredirparser.so.0: cannot open shared object file: No such file or directory 2012-08-23 09:45:53.497+0000: 11237: error : virCommandWait:2332 : internal error Child process (LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/libexec/qemu-kvm -help) unexpected exit status 127: /usr/libexec/qemu-kvm: error while loading shared libraries: libusbredirparser.so.0: cannot open shared object file: No such file or directory are expected results. And also get same error: Error starting domain: internal error Child process (LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin /usr/libexec/qemu-kvm -help) unexpected exit status 127: /usr/libexec/qemu-kvm: error while loading shared libraries: libusbredirparser.so.0: cannot open shared object file: No such file or directory using virt-manager to to connect libvirtd. So moving to VERIFIED. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0276.html |