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.
Description of problem:
Error occurred when revert a running domain to a running snapshot with "--force"
Version-Release number of selected component (if applicable):
libvirt-4.4.0-2.el7.x86_64
How reproducible:
100%
Steps to Reproduce:
1.Start a guest and create a running snapshot
# virsh start avocado-vt-vm4
Domain avocado-vt-vm4 started
# virsh snapshot-create-as avocado-vt-vm4 avocado-vt-vm4.s1
Domain snapshot avocado-vt-vm4.s1 created
2.Add a rng device or attach a second disk
# qemu-img create -f qcow2 /var/lib/libvirt/images/bar.img 10M
Formatting '/var/lib/libvirt/images/bar.img', fmt=qcow2 size=10485760 cluster_size=65536 lazy_refcounts=off refcount_bits=16
# virsh attach-disk avocado-vt-vm4 /var/lib/libvirt/images/bar.img vdb --live
Disk attached successfully
3.Try to revert to the 1st snapshot (Expected failure)
# virsh snapshot-revert avocado-vt-vm4 avocado-vt-vm4.s1
error: revert requires force: Target domain disk count 1 does not match source 2
4.Try to revert with "--force"
# virsh snapshot-revert avocado-vt-vm4 avocado-vt-vm4.s1 --force
error: internal error: unexpected async job 6
5.Check guest status
# virsh list --all
Id Name State
----------------------------------------------------
2 avocado-vt-vm4 paused
# virsh resume avocado-vt-vm4
error: Failed to resume domain avocado-vt-vm4
error: internal error: unable to execute QEMU command 'cont': Expecting capabilities negotiation with 'qmp_capabilities'
Actual results:
In step4, error occurred when snapshot-revert with --force
In step5. guest paused
Expected Results:
Should successfully do "snapshot-revert --force" without error.
Guest should keep running status as the 1st snapshot is.
Additional info:
Not reproduce on libvirt-3.9.0-14.el7_5.6.x86_64.
(In reply to Han Han from comment #4)
> Could you please check if managesave will hang and then libvirtd deadlock
> after snapshot-revert --force?
Checked and the result is yes.
Since it seems this is the root cause of the vmgenid validation effort and resulting needsinfo on me - https://bugzilla.redhat.com/show_bug.cgi?id=1149445#c10 - I investigated whether what I had ready to post would also solve this problem and it did.
So, I posted a patch series upstream to resolve:
https://www.redhat.com/archives/libvir-list/2018-June/msg01425.html
patch 5 is the actual fix, but patches 1-4 get a few things set up and also make a minor adjustment to the way vmgenid (e.g. bz1149445) is handled for the --force option.
This has now been pushed upstream:
commit 0c4408c832368b45c8246175e2a75132d3ff0302
Author: John Ferlan <jferlan>
Date: Tue Jun 19 18:54:19 2018 -0400
qemu: Don't use asyncJob after stop during snapshot revert
...
Attempting to use the FORCE flag for snapshot-revert was resulting
in failures because qemuProcessStart and qemuProcessStartCPUs were
using QEMU_ASYNC_JOB_START after a qemuProcessStop resulting in an
error when entering the monitor:
error: internal error: unexpected async job 6 type expected 0
So create a local @jobType, initialize to QEMU_ASYNC_JOB_START, and
change to QEMU_ASYNC_JOB_NONE if we end up in the --force path
where the qemuProcessStop is run before a Start and StartCPUs.
$ git describe 0c4408c832368b45c8246175e2a75132d3ff0302
v4.4.0-296-g0c4408c832
$
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.
https://access.redhat.com/errata/RHSA-2018:3113