RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 856528 - List option --state-shutoff should filter guest properly
Summary: List option --state-shutoff should filter guest properly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-12 08:44 UTC by Luwen Su
Modified: 2013-02-21 07:23 UTC (History)
6 users (show)

Fixed In Version: libvirt-0.10.2-0rc1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:23:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0276 0 normal SHIPPED_LIVE Moderate: libvirt security, bug fix, and enhancement update 2013-02-20 21:18:26 UTC

Description Luwen Su 2012-09-12 08:44:05 UTC
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 09:04:50 UTC
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 14:44:21 UTC
Docs fixed upstream:
commit 60b0284f24c3187bfa2225f1715c30b9d6a2eb1c
Author: Peter Krempa <pkrempa>
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 08:46:53 UTC
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 07:23:34 UTC
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.