Bug 2039136

Summary: Snapshot-revert failed with 'cause is unknown' error
Product: Red Hat Enterprise Linux 9 Reporter: Yanqiu Zhang <yanqzhan>
Component: libvirtAssignee: Ján Tomko <jtomko>
libvirt sub component: Storage QA Contact: liang cong <lcong>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: jdenemar, jtomko, lmen, virt-maint, xuzhang, yanqzhan, yisun
Version: 9.0Keywords: Regression
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-8.0.0-2.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2043584 (view as bug list) Environment:
Last Closed: 2022-05-17 12:46:17 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: 8.1.0
Embargoed:
Bug Depends On:    
Bug Blocks: 2043584    

Description Yanqiu Zhang 2022-01-11 03:42:13 UTC
Description of problem:
 Snapshot-revert failed with 'cause is unknown' error

Version-Release number of selected component (if applicable):
libvirt-8.0.0-0rc1.1.el9.x86_64
qemu-kvm-6.2.0-3.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a shutoff domain
# virsh snapshot-create-as vm  s1
Domain snapshot s1 created

2.# virsh edit vm  (e.g. remove rng device in xml)
Domain 'vm' XML configuration edited.

3.# virsh snapshot-create-as vm  s2
Domain snapshot s2 created

4. # virsh snapshot-revert vm s1
error: An error occurred, but the cause is unknown

Actual results:


Expected results:
Should succeed

Additional info:
Not reproduced in libvirt-7.10.0-1.el9.x86_64

Comment 1 Ján Tomko 2022-01-20 14:18:26 UTC
Fixed upstream by:
commit 76deb656132bb8817ddae4b7f417930c4db824c9
Author:     Ján Tomko <jtomko>
CommitDate: 2022-01-20 15:16:18 +0100

    qemu: fix inactive snapshot revert

git describe: v8.0.0-124-g76deb65613

Comment 3 liang cong 2022-01-21 11:10:16 UTC
Preverify on:
libvirt: v8.0.0-130-g2b7f9506b1
qemu-6.2.0-2.fc36.x86_64
qemu-kvm-6.2.0-2.fc36.x86_64

steps:
1. Prepare a shutoff domain
# virsh list --inactive
 Id   Name   State
-----------------------
 -    vm1    shut off

2. create a internal snapshot
# virsh snapshot-create-as vm1 s1
Domain snapshot s1 created

3. virsh edit vm1 (e.g. remove rng device in xml)
# virsh edit vm1
Domain 'vm1' XML configuration edited.

4. create another internal snapshot
# virsh snapshot-create-as vm1 s2
Domain snapshot s2 created


5. revert snapshot
# virsh snapshot-revert vm1 s1
# virsh snapshot-revert vm1 s2

Actual results: no erro occurrs.

Also tried active snapshot revert and get no error.

Comment 6 liang cong 2022-01-27 01:58:53 UTC
Verified on libvirt-8.0.0-2.el9.x86_64

# rpm -q libvirt qemu-kvm
libvirt-8.0.0-2.el9.x86_64
qemu-kvm-6.2.0-5.el9.x86_64

# virsh destroy vm1
Domain 'vm1' destroyed

# virsh list --inactive
 Id   Name   State
-----------------------
 -    vm1    shut off

# virsh snapshot-create-as vm1 s1
Domain snapshot s1 created

# virsh edit vm1
Domain 'vm1' XML configuration edited.

# virsh snapshot-create-as vm1 s2
Domain snapshot s2 created

# virsh snapshot-revert vm1 s1

# virsh start vm1
Domain 'vm1' started

# virsh snapshot-revert vm1 s2

Comment 8 errata-xmlrpc 2022-05-17 12:46:17 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 (new packages: libvirt), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2390