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 869100 - poor error message for virsh snapshot-list --roots --current
Summary: poor error message for virsh snapshot-list --roots --current
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.4
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-23 03:06 UTC by weizhang
Modified: 2013-02-21 07:10 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.10.2-6.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-21 07:10:53 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 weizhang 2012-10-23 03:06:46 UTC
Description of problem:
If I create a snapshot with --no-metadata, then snapshot-list will not list this snapshot with --no-metadata
And with --roots --current, snapshot-list can not list expect result but error
error: --roots and --from are mutually exclusive


Version-Release number of selected component (if applicable):
libvirt-0.10.2-4.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.329.el6.x86_64
kernel-2.6.32-329.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest with qcow2 disk
2. Create snapshot with --no-metadata
# virsh snapshot-create guest --nometadata
Domain snapshot 1350900552 created

3. List snapshots
# virsh snapshot-list guest --no-metadata
 Name                 Creation Time             State
------------------------------------------------------------

4. # virsh snapshot-list guest --roots --current
error: --roots and --from are mutually exclusive
  
Actual results:
1. Can not list no metadata snapshot with --no-metadata
2. list with --roots --current report error

Expected results:
1. Can list no metadata snapshot with --no-metadata
2. list with --roots --current works well


Additional info:

Comment 1 Eric Blake 2012-10-23 03:14:36 UTC
(In reply to comment #0)
> Description of problem:
> If I create a snapshot with --no-metadata, then snapshot-list will not list
> this snapshot with --no-metadata
> And with --roots --current, snapshot-list can not list expect result but
> error
> error: --roots and --from are mutually exclusive
> 
> 
> Version-Release number of selected component (if applicable):
> libvirt-0.10.2-4.el6.x86_64
> qemu-kvm-rhev-0.12.1.2-2.329.el6.x86_64
> kernel-2.6.32-329.el6.x86_64
> 
> How reproducible:
> 100%
> 
> Steps to Reproduce:
> 1. Prepare a guest with qcow2 disk
> 2. Create snapshot with --no-metadata
> # virsh snapshot-create guest --nometadata
> Domain snapshot 1350900552 created
> 

This creates a snapshot, _and then immediately deletes the metadata_.  That is, it is useful for creating snapshot files _without tracking an actual snapshot_.

> 3. List snapshots
> # virsh snapshot-list guest --no-metadata
>  Name                 Creation Time             State
> ------------------------------------------------------------

This is expected.

> 
> 4. # virsh snapshot-list guest --roots --current
> error: --roots and --from are mutually exclusive

This is expected.

>   
> Actual results:
> 1. Can not list no metadata snapshot with --no-metadata

There is no way to list qemu snapshots that lack metadata, yet.  Upstream will eventually add a way to list internal snapshots that do not have libvirt data, but where qemu can use 'loadvm' to revert to that snapshot; but you cannot create this situation from libvirt alone, and it is not yet an upstream feature.

> 2. list with --roots --current report error

That is correct, because once you limit a tree (such as by using --current), then using --roots no longer makes sense (--roots only works when used on the global list of snapshots for a domain).

Hence, I'm closing this as NOTABUG.

Comment 2 weizhang 2012-10-23 03:42:46 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Description of problem:
> > If I create a snapshot with --no-metadata, then snapshot-list will not list
> > this snapshot with --no-metadata
> > And with --roots --current, snapshot-list can not list expect result but
> > error
> > error: --roots and --from are mutually exclusive
> > 
> > 
> > Version-Release number of selected component (if applicable):
> > libvirt-0.10.2-4.el6.x86_64
> > qemu-kvm-rhev-0.12.1.2-2.329.el6.x86_64
> > kernel-2.6.32-329.el6.x86_64
> > 
> > How reproducible:
> > 100%
> > 
> > Steps to Reproduce:
> > 1. Prepare a guest with qcow2 disk
> > 2. Create snapshot with --no-metadata
> > # virsh snapshot-create guest --nometadata
> > Domain snapshot 1350900552 created
> > 
> 
> This creates a snapshot, _and then immediately deletes the metadata_.  That
> is, it is useful for creating snapshot files _without tracking an actual
> snapshot_.
> 
> > 3. List snapshots
> > # virsh snapshot-list guest --no-metadata
> >  Name                 Creation Time             State
> > ------------------------------------------------------------
> 
> This is expected.
> 
> > 
> > 4. # virsh snapshot-list guest --roots --current
> > error: --roots and --from are mutually exclusive
> 
> This is expected.
> 

Can it means that the root of current children? Because I can get the result with perl-Sys-Virt
$snapshot->list_all_children(Sys::Virt::DomainSnapshot::LIST_ROOTS);

else , it also should report "--roots and --current are mutually exclusive"

> >   
> > Actual results:
> > 1. Can not list no metadata snapshot with --no-metadata
> 
> There is no way to list qemu snapshots that lack metadata, yet.  Upstream
> will eventually add a way to list internal snapshots that do not have
> libvirt data, but where qemu can use 'loadvm' to revert to that snapshot;
> but you cannot create this situation from libvirt alone, and it is not yet
> an upstream feature.
> 
> > 2. list with --roots --current report error
> 
> That is correct, because once you limit a tree (such as by using --current),
> then using --roots no longer makes sense (--roots only works when used on
> the global list of snapshots for a domain).
> 
> Hence, I'm closing this as NOTABUG.

Comment 3 Eric Blake 2012-10-23 12:35:59 UTC
(In reply to comment #2)

> > > 4. # virsh snapshot-list guest --roots --current
> > > error: --roots and --from are mutually exclusive
> > 
> > This is expected.
> > 
> 
> Can it means that the root of current children? Because I can get the result
> with perl-Sys-Virt
> $snapshot->list_all_children(Sys::Virt::DomainSnapshot::LIST_ROOTS);

This is a bug in your script.  The value of Sys::Virt::DomainSnapshot::LIST_ROOTS and Sys::Virt::DomainSnapshot::LIST_DESCENDANTS are identical; LIST_ROOTS is for listing snapshots of a domain, while LIST_DESCENDANTS is for listing children of a snapshot.  You are passing the wrong name but the right value for the LIST_DESCENDANTS behavior.

> 
> else , it also should report "--roots and --current are mutually exclusive"

--roots says to filter to snapshots with no parents.  But the moment you limit the tree to a subset, as in using --current, then everything in that subset has a parent, and thus none of them are roots.  Hence, --roots and --current are mutually exclusive.

However, there is an upstream thread about poor error message quality:
https://www.redhat.com/archives/libvir-list/2012-October/msg01183.html

So I will reopen and retitle this bug, as a request to backport the improved error message.

Comment 4 Eric Blake 2012-10-25 21:21:33 UTC
Here's another attempt upstream at improving the situation:
https://www.redhat.com/archives/libvir-list/2012-October/msg01526.html

Comment 7 Huang Wenlong 2012-10-31 03:15:14 UTC
Verify this bug with:
libvirt-0.10.2-6.el6.x86_64

# virsh snapshot-create-as q1 ds1 --disk-only 
Domain snapshot ds1 created

# virsh snapshot-create-as q1 ds2 --disk-only 
Domain snapshot ds2 created


# virsh snapshot-list q1 --roots --current 
error: --roots and --current are mutually exclusive

Comment 8 errata-xmlrpc 2013-02-21 07:10:53 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.