Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1175603

Summary: libvirt should report error when revert to a internal snapshot when we are in external snapshot checkpoint
Product: Red Hat Enterprise Linux 7 Reporter: Luyao Huang <lhuang>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dyuan, mzhan, pkrempa, rbalakri, shyu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-07 09:06:50 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 Luyao Huang 2014-12-18 07:35:25 UTC
description of problem:
libvirt should report error when revert to a internal snapshot when we are in external snapshot

Version-Release number of selected component (if applicable):
libvirt-1.2.8-10.el7.x86_64
qemu-kvm-rhev-2.1.2-17.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1.prepare a running guest have a qcow2 disk
# virsh dumpxml test3
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/test6.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

2.do internal snapshot
# virsh snapshot-create-as test3 s1

Domain snapshot s1 created

3.edit some thing in guest

4.create a external snapshot:
# virsh snapshot-create-as test3 s2 --disk-only
Domain snapshot s2 created

5.revert to internal snapshot s1:
# virsh snapshot-revert test3 s1

# echo $?
0


Actual results:
no error when do snapshot-revert and nothing changed after revert(even reboot then check)
      
Expected results:
output error when snapshot-revert failed, like this:

the snapshot 's1' does not exist, and was not loaded


Some Information:

After i debug libvirt and qemu, i found :
libvirt:                                qemu-kvm:
qemuDomainRevertToSnapshot
    qemuMonitorTextLoadSnapshot
        qemuMonitorHMPCommand
                                        do_loadvm
                                             load_vmstate
                                                 bdrv_snapshot_find
                                               /*cannot find a snapshot*/
                                             return ret
                                        end     
                                        /*no error output when cannot find */
        /*reply = '' so no error */
        ret = 0

And libvirt try to find a error like this:

    else if (strstr(reply, "Could not find snapshot") != NULL) {
        virReportError(VIR_ERR_OPERATION_INVALID,
                       _("the snapshot '%s' does not exist, and was not loaded"),
                       name);
        goto cleanup;
    }

But with qemu-kvm-rhev seems qemu will never output this reply.
So libvirt return success.

Comment 1 Peter Krempa 2015-02-07 09:06:50 UTC
We are already tracking problems with combining external and internal snapshots. I've improved the summary of the original bug as it was not obvious and I'll close this one as a duplicate.

*** This bug has been marked as a duplicate of bug 880565 ***