Bug 856528 - List option --state-shutoff should filter guest properly
List option --state-shutoff should filter guest properly
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.4
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-12 04:44 EDT by Luwen Su
Modified: 2013-02-21 02:23 EST (History)
6 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-0rc1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 02:23:34 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Luwen Su 2012-09-12 04:44:05 EDT
Description of problem:
the --state-shutoff option can't list shutoff guest if not combine with --all or --inactive and there is no spical usage in help

Version-Release number of selected component (if applicable):
libvirt-0.10.1-1.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     test                           paused
 11    test-1                         running
 20    test-abi                       running
 -     block                          shut off
 -     test-snap                      shut off

2.
# virsh list --state-shutoff
 Id    Name                           State
----------------------------------------------------


3.
#virsh list --state-shutoff --inactive
 Id    Name                           State
----------------------------------------------------
 -     block                          shut off
 -     test-snap                      shut off
  

Actual results:
Can't list shutoff guest


Expected results:
List shutoff guest without --inactive or --all

Additional info:
In help doc , 
    --state-running  list domains in running state
    --state-paused   list domains in paused state
    --state-shutoff  list domains in shutoff state
    --state-other    list domains in other states
there is no specail requrement for the option.If the result is expected , should add more details into the doc?
Comment 2 Peter Krempa 2012-09-17 05:04:50 EDT
Unfortunately, due to historic reasons, virsh lists only active guests by default. I posted a patch to clarify that some combinations of flags produce no results:

http://www.redhat.com/archives/libvir-list/2012-September/msg01150.html
Comment 3 Peter Krempa 2012-09-17 10:44:21 EDT
Docs fixed upstream:
commit 60b0284f24c3187bfa2225f1715c30b9d6a2eb1c
Author: Peter Krempa <pkrempa@redhat.com>
Date:   Mon Sep 17 10:57:41 2012 +0200

    virsh: Clarify behavior of domain list filtering.
    
    Some combinations of filtering flags produce no result. This patch tries
    to clarify this.

Moving to POST.
Comment 5 EricLee 2012-09-20 04:46:53 EDT
Verifying the bug:

Reproduction:
-------------
Reproduced this issue in env below. 
# rpm -qa libvirt
libvirt-0.10.1-1.el6.x86_64

Steps:
# man virsh
....
           Normally only active domains are listed. To list inactive domains specify --inactive or --all to
           list both active and inactive domains.

           To filter the list of domains present on the hypervisor you may specify one or more of filtering
           flags supported by the list command.  These flags are grouped by function. Specifying one or more
           flags from a group enables the filter group. Supported filtering flags and groups:
....

Result:
Some behavior of domain list filtering is not clear.

Verification:
-------------
Verified in env below with same steps as above.
# rpm -qa libvirt
libvirt-0.10.2-0rc1.el6.x86_64

# man virsh
....
           Normally only active domains are listed. To list inactive domains specify --inactive or --all to
           list both active and inactive domains.

           To further filter the list of domains you may specify one or more of filtering flags supported by
           the list command. These flags are grouped by function.  Specifying one or more flags from a group
           enables the filter group. Note that some combinations of flags may yield no results. Supported
           filtering flags and groups:

....

Result:
There is clearer info of "Note that some combinations of flags may yield no results.".


Conclusion:
-----------
As per above, this bug has been fixed.

Moving to VERIFIED.
Comment 6 errata-xmlrpc 2013-02-21 02:23:34 EST
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

Note You need to log in before you can comment on or make changes to this bug.