Bug 1126329
Summary: | Libvirt should forbid using relative path to the new overaly snapshot image for external snapshots | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Shanzhi Yu <shyu> | |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> | |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | medium | Docs Contact: | ||
Priority: | high | |||
Version: | 7.0 | CC: | dyuan, mzhan, pkrempa, rbalakri, xuzhang, yanyang | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-1.2.8-1.el7 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1127226 (view as bug list) | Environment: | ||
Last Closed: | 2015-03-05 07:41:41 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: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1127226 |
Description
Shanzhi Yu
2014-08-04 08:11:59 UTC
Relative paths shouldn't be used for external snapshot file names. Libvirt shouldn't allow them and to create a relatively addressed snapshot we need a different mechanism. Fixed upstream: commit 29bb066915d0d0480b65fe404479babf5e076ac7 Author: Peter Krempa <pkrempa> Date: Wed Aug 6 15:17:00 2014 +0200 snapshot: conf: Enforce absolute paths on disk and memory images RNG schema as well as the qemu driver requires absolute paths for memory and disk snapshot image files but the XML parser was not enforcing it. Add checks to avoid problems in qemu where the configuration it creates is invalid. v1.2.7-13-g29bb066 Verified on libvirt-1.2.8-5.el7.x86_64 Steps: 1. prepare a running vm # virsh list --all Id Name State ---------------------------------------------------- 4 qe-con1 running 2. create external system checkpoint snapshot # virsh snapshot-create-as qe-con1 s1 --memspec file=./qe-con1.mem --diskspec vda,file=./qe-con1.s1 error: XML error: memory snapshot file path (./qe-con1.mem) must be absolute 3. create external disk only snapshot # virsh snapshot-create-as qe-con1 s1 --disk-only --diskspec vda,file=./qe-con1.s1 error: XML error: disk snapshot image path './qe-con1.s1' must be absolute 4. create snapshot with xml # cat qe-con1.s1.xml <domainsnapshot> <name>s1</name> <disks> <disk name='vda'> <source file='./qe-con1.s1'/> </disk> </disks> </domainsnapshot> # virsh snapshot-create qe-con1 qe-con1.s1.xml --disk-only error: XML error: disk snapshot image path './qe-con1.s1' must be absolute 5. create snapshot with xml # cat qe-con1.s1.xml <domainsnapshot> <name>s1</name> <memory snapshot='external' file='./qe-con1.mem'/> <disks> <disk name='vda'> <source file='./qe-con1.s1'/> </disk> </disks> </domainsnapshot> # virsh snapshot-create qe-con1 qe-con1.s1.xml error: XML error: memory snapshot file path (./qe-con1.mem) must be absolute Since all the steps got the expected results, set it to verified. 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://rhn.redhat.com/errata/RHSA-2015-0323.html |