Bug 1707708
Summary: | libvirtd crashes when undefine vm with --snapshots-metadata option | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Dan Zheng <dzheng> | ||||
Component: | libvirt | Assignee: | Eric Blake <eblake> | ||||
Status: | CLOSED ERRATA | QA Contact: | yisun | ||||
Severity: | high | Docs Contact: | |||||
Priority: | unspecified | ||||||
Version: | 8.1 | CC: | chhu, dyuan, eblake, hhan, jdenemar, lmen, pkrempa, xuzhang, yalzhang, yisun | ||||
Target Milestone: | rc | Keywords: | Automation, Regression | ||||
Target Release: | 8.0 | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | libvirt-5.4.0-1.el8 | Doc Type: | If docs needed, set a value | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2019-11-06 07:14:47 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: | |||||||
Attachments: |
|
Description
Dan Zheng
2019-05-08 07:32:17 UTC
No symbols in backtrace. Please install the libvirt-debuginfo-5.3.0-1.module+el8.1.0+3164+94495c71.x86_64 and libvirt-debugsource-5.3.0-1.module+el8.1.0+3164+94495c71.x86_64, then try to reproduce it again Created attachment 1565541 [details]
gdb log
virQEMUMomentRemovePtr->momentDiscard is passed in as NULL from qemuDomainSnapshotDiscardAllMetadata to qemuDomainMomentDiscardAll and unconditionally dereferenced. The code was introduced in commit a487890d371b8cc3662c1717dfe07eea3f1ef1c0 Author: Eric Blake <eblake> Date: Wed Mar 27 02:12:37 2019 -0500 snapshot: Refactor qemu to utilize virDomainMoment more Use the common base class virDomainMoment for iterator callbacks related to snapshots from the qemu code, so that when checkpoint operations are introduced, they can share the same callbacks. Simplify the code for qemuDomainSnapshotCurrent by better utilizing virDomainMoment helpers. Patch proposed upstream: https://www.redhat.com/archives/libvir-list/2019-May/msg00249.html This is already fixed upstream by commit 9dd5bc151c51980807a29d59220290173f260b5a Refs: v5.3.0-62-g9dd5bc151c Author: Eric Blake <eblake> AuthorDate: Fri May 10 09:38:31 2019 -0500 Commit: Eric Blake <eblake> CommitDate: Fri May 10 10:50:16 2019 -0500 qemu: Fix regression with undefine --snapshots-metadata In refactoring the snapshot code to prepare for checkpoints, I changed qemuDomainMomentDiscardAll to take a callback that would handle the cleanup of either a snapshot or a checkpoint, but failed to set the callback on one of the two snapshot callers. As a result, 'virsh undefine $dom --snapshots-metadata' crashed on a NULL function dereference. Fixes: a487890d371b8cc3662c1717dfe07eea3f1ef1c0 Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1707708 Signed-off-by: Eric Blake <eblake> Acked-by: Peter Krempa <pkrempa> Verified and PASSED [root@hp-dl320eg8-13 ~]# rpm -qa | egrep "qemu-kvm-4|libvirt-5" libvirt-5.4.0-1.module+el8.1.0+3304+7eb41d5f.x86_64 python3-libvirt-5.4.0-1.module+el8.1.0+3305+28419a35.x86_64 qemu-kvm-4.0.0-4.module+el8.1.0+3356+cda7f1ee.x86_64 [root@hp-dl320eg8-13 ~]# virsh start avocado-vt-vm1 Domain avocado-vt-vm1 started [root@hp-dl320eg8-13 ~]# for i in s1 s2 s3 s4; do virsh snapshot-create-as avocado-vt-vm1 $i --disk-only ;done Domain snapshot s1 created Domain snapshot s2 created Domain snapshot s3 created Domain snapshot s4 created [root@hp-dl320eg8-13 ~]# virsh snapshot-list avocado-vt-vm1 Name Creation Time State --------------------------------------------------- s1 2019-06-14 02:09:19 -0400 disk-snapshot s2 2019-06-14 02:09:19 -0400 disk-snapshot s3 2019-06-14 02:09:19 -0400 disk-snapshot s4 2019-06-14 02:09:19 -0400 disk-snapshot [root@hp-dl320eg8-13 ~]# virsh destroy avocado-vt-vm1 Domain avocado-vt-vm1 destroyed [root@hp-dl320eg8-13 ~]# virsh domstate avocado-vt-vm1 shut off [root@hp-dl320eg8-13 ~]# ps -C libvirtd PID TTY TIME CMD 16097 ? 00:00:00 libvirtd [root@hp-dl320eg8-13 ~]# virsh undefine avocado-vt-vm1 error: Failed to undefine domain avocado-vt-vm1 error: Requested operation is not valid: cannot delete inactive domain with 4 snapshots [root@hp-dl320eg8-13 ~]# ps -C libvirtd PID TTY TIME CMD 16097 ? 00:00:00 libvirtd [root@hp-dl320eg8-13 ~]# virsh undefine avocado-vt-vm1 --snapshots-metadata Domain avocado-vt-vm1 has been undefined [root@hp-dl320eg8-13 ~]# ps -C libvirtd PID TTY TIME CMD 16097 ? 00:00:00 libvirtd [root@hp-dl320eg8-13 ~]# virsh domstate avocado-vt-vm1 error: failed to get domain 'avocado-vt-vm1' 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/RHBA-2019:3723 |