| Summary: | RFE: Keep consistence between code and documentation on log level and usage | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Min Zhan <mzhan> |
| Component: | libvirt | Assignee: | Daniel Veillard <veillard> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 6.2 | CC: | dallan, dyuan, jdenemar, mzhan, rwu, zpeng |
| Target Milestone: | rc | Keywords: | FutureFeature |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-0.9.3-4.el6 | Doc Type: | Enhancement |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-12-06 11:15:54 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
|
Description
Min Zhan
2011-06-27 11:09:14 UTC
------- Comment From skannery.com 2011-07-01 02:58 EDT------- Status: Waiting for comments on patches sent upstream - https://www.redhat.com/archives/libvir-list/2011-June/msg01574.html This is fixed upstream by v0.9.3-129-g2de8aa8 through v0.9.3-132-gc444721:
commit 2de8aa8fd0b9a60589a19b365dc045c05a4039d7
Author: Supriya Kannery <supriyak.ibm.com>
Date: Thu Jun 30 13:52:20 2011 +0530
virsh: Avoid using magic numbers for logging
Replace magic numbers with loglevel variables.
Signed-off-by: Supriya Kannery <supriyak.com>
commit c1710ca6a05b8e679dde6ff26b560a68bf196485
Author: Supriya Kannery <supriyak.ibm.com>
Date: Thu Jun 30 13:52:32 2011 +0530
virsh: Make "DEBUG" loglevel the superset
Aligning loglevel values of virsh to that of libvirt.
"DEBUG"=0 loglevel, when specified through commandline or
env variable, should log all the messages. "ERROR=4"
should log only error messages.
Signed-off-by: Supriya Kannery <supriyak.com>
commit f580a33ffdeaa567823f87ce0c03264cc2aa9192
Author: Jiri Denemark <jdenemar>
Date: Thu Jul 14 13:58:02 2011 +0200
virsh: fix previous patch
The last patch breaks make check for two reasons. First, it reverses the
condition but leaves default level unchanged, so instead of not printing
anything but errors before the patch it now prints all debug messages by
default. Second, you forgot to change -d5 option passed to virsh in
tests/virsh-optparse to -d0; the script wants to see all debug messages.
commit c444721b9d6e2a08a15763667489e79813a2d60b
Author: Supriya Kannery <supriyak.ibm.com>
Date: Thu Jun 30 13:52:45 2011 +0530
virsh: Update virsh man page
Valid loglevel range for virsh is 0-4. Update virsh man page
accordingly. Also explain virsh ENV variables and values.
Signed-off-by: Supriya Kannery <supriyak.com>
verify on libvirt-0.9.3-5.el6.x86_64 passed.
# virsh --help |grep debug
-d | --debug <num> debug level [0-4]
#man virsh
-d, --debug LEVEL
Enable debug messages at integer LEVEL and above. LEVEL can range from 0 (default) to 4.
VIRSH_DEBUG=<0 to 4>
Turn on verbose debugging of virsh commands. Valid levels are
* VIRSH_DEBUG=0
DEBUG - Messages at ALL levels get logged
* VIRSH_DEBUG=1
INFO - Logs messages at levels INFO, NOTICE, WARNING and ERROR
* VIRSH_DEBUG=2
NOTICE - Logs messages at levels NOTICE, WARNING and ERROR
* VIRSH_DEBUG=3
WARNING - Logs messages at levels WARNING and ERROR
* VIRSH_DEBUG=4
ERROR - Messages at only ERROR level gets logged.
VIRSH_LOG_FILE="LOGFILE"
The file to log virsh debug messages.
man page fixed.
verify log level:
level 4:error
Check debug level as ERROR
# export VIRSH_LOG_FILE=/tmp/debug.log
# export VIRSH_DEBUG=4
# echo $VIRSH_DEBUG
4
# echo $VIRSH_LOG_FILE
/tmp/debug.log
# ll /tmp/debug.log
ls: cannot access /tmp/debug.log: No such file or directory
#virsh list --all
Id Name State
----------------------------------
2 demo running
#virsh undefine demo
error: Failed to undefine domain demo
error: Requested operation is not valid: cannot delete active domain
#cat /tmp/debug.log
[2011.07.18 03:53:31 virsh 13733] ERROR Failed to undefine domain demo
[2011.07.18 03:53:31 virsh 13733] ERROR Requested operation is not valid: cannot delete active domain
level 1:info
Check debug level as INFO
# export VIRSH_LOG_FILE=/tmp/info.log
# export VIRSH_DEBUG=1
# echo $VIRSH_DEBUG
1
# echo $VIRSH_LOG_FILE
/tmp/info.log
# ll /tmp/info.log
ls: cannot access /tmp/info.log: No such file or directory
#virsh undefine demo
#cat /tmp/info.log
[2011.07.18 04:09:00 virsh 14240] INFO undefine: found option <domain>: demo
[2011.07.18 04:09:00 virsh 14240] ERROR Failed to undefine domain demo
[2011.07.18 04:09:00 virsh 14240] ERROR Requested operation is not valid: cannot delete active domain
level 0:all
Check debug level as ALL
# export VIRSH_LOG_FILE=/tmp/all.log
# export VIRSH_DEBUG=0
# echo $VIRSH_DEBUG
0
# echo $VIRSH_LOG_FILE
/tmp/all.log
# ll /tmp/all.log
ls: cannot access /tmp/all.log: No such file or directory
#virsh undefine demo
#cat /tmp/all.log
[2011.07.18 04:12:08 virsh 14282] INFO undefine: found option <domain>: demo
[2011.07.18 04:12:08 virsh 14282] DEBUG undefine: <domain> trying as domain NAME
[2011.07.18 04:12:08 virsh 14282] ERROR Failed to undefine domain demo
[2011.07.18 04:12:08 virsh 14282] ERROR Requested operation is not valid: cannot delete active domain
Debug level NOTICE & WARNING not covered, can't find VIRSH_ERR_NOTICE & VIRSH_ERR_WARNING invoked in virsh.c,so according to comment 4,move state to verify. 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/RHBA-2011-1513.html |