mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
qemu: snapshot: Don't kill access to disk if snapshot creation fails
If snapshot creation failed for example due to invalid use of the "REUSE_EXTERNAL" flag, libvirt killed access to the original image file instead of the new image file. On machines with selinux this kills the whole VM as the selinux context is enforced immediately. * qemu_driver.c:qemuDomainSnapshotUndoSingleDiskActive(): - Kill access to the new image file instead of the old one. Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=906639
This commit is contained in:
parent
6c23d60961
commit
177046753f
@ -11309,7 +11309,7 @@ qemuDomainSnapshotUndoSingleDiskActive(virQEMUDriverPtr driver,
|
||||
(persistDisk && VIR_STRDUP(persistSource, source) < 0))
|
||||
goto cleanup;
|
||||
|
||||
qemuDomainPrepareDiskChainElement(driver, vm, disk, origdisk->src,
|
||||
qemuDomainPrepareDiskChainElement(driver, vm, disk, disk->src,
|
||||
VIR_DISK_CHAIN_NO_ACCESS);
|
||||
if (need_unlink && stat(disk->src, &st) == 0 &&
|
||||
S_ISREG(st.st_mode) && unlink(disk->src) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user