Bug 810799

Summary: virsh list and "--managed-save " flag can't list the domains with managed save state
Product: Red Hat Enterprise Linux 6 Reporter: hongming <honzhang>
Component: libvirtAssignee: Peter Krempa <pkrempa>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3CC: acathrow, berrange, dallan, dyasny, dyuan, mzhan, pkrempa, rwu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.13-3.el6 Doc Type: Bug Fix
Doc Text:
Feature bug fix.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-21 07:11:40 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 hongming 2012-04-09 08:32:51 UTC
Description of problem:
virsh list and "--managed-save " flag can't list the domains with managed save state.

Version-Release number of selected component (if applicable):
kernel-2.6.32-250.el6.x86_64
libvirt-0.9.10-10.el6.x86_64
qemu-kvm-0.12.1.2-2.270.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Managed save one domain
# virsh managedsave rhel6u32
Domain rhel6u32 state saved by libvirt

2. List domains with managed save state.
# virsh list --managed-save
Id Name             State
----------------------------------------------------
18 winxp-x86_64     running


3. # virsh list --managed-save --all
Id  Name             State
----------------------------------------------------
18 winxp-x86_64      running
- kvm-rhel3u9-i386   shut off
- rhel6u32           saved


  
Actual results:
virsh list and "--managed-save" flag can't list the domains with managed save state. It only list running domains. If use "--managed-save --all" flag , the domains with managed save states can be listed.

Expected results:
virsh list and "--managed-save " flag can list the domains with managed save state.

Additional info:

Comment 2 dyuan 2012-04-09 09:04:05 UTC
It's not very clear for the --managed-save option in "virsh help".

# virsh help list

--managed-save   mark domains with managed save state


# man virsh 

If --managed-save is specified, then domains that have managed save state (only possible if they are in the shut off state) will instead show as saved in the listing. This flag is usable only with the default --table output.

# virsh list --table --manged-save

only list the running domains.

Comment 3 Peter Krempa 2012-04-10 09:53:49 UTC
We could modify the semantics of the --managed-save flag, that would automaticaly imply listing inactive domains when it's specified or just document that you need to specify --all or --inactive to produce useful results.

What would be the preferred approach?

Comment 4 Daniel Berrangé 2012-04-10 10:00:37 UTC
Just clarify the documentation IMHO

Comment 5 Peter Krempa 2012-04-10 13:57:09 UTC
Added documentation about the usage of --managed-save upstream:

commit cc5100654b2aff0933ab4aa447a71bfd7ddbf2bd
Author: Peter Krempa <pkrempa>
Date:   Tue Apr 10 12:21:03 2012 +0200

    virsh: Clarify use of the --managed-save flag for the list command
    
    The documentation for the flag doesn't clearly state that the flag only
    enhances the output and the user needs to specify other flags to list
    inactive domains, that are enhanced by this flag.

Comment 8 hongming 2012-07-25 07:23:10 UTC
Verify it using the following version.

libvirt-0.9.13-3.el6.x86_64


Steps

# man virsh 

 If --managed-save is specified, then domains that have managed
 save state (only possible if they are in the shut off state, so
 you need to specify --inactive or --all to actually list them)
 will instead show as saved in the listing. This flag is usable
 only with the default --table output.  Note that this flag does
 not filter the list of domains.


The result is expected. So move its status to VERIFIED.

Comment 9 errata-xmlrpc 2013-02-21 07:11:40 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