qemu deletes the backing file in snapshot mode
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The file removal occurs during the "change" operation. It happens only in snapshot mode.
Minimal steps to reproduce the problem:
$ dd if=/dev/zero of=file.img bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00288727 s, 363 MB/s
$ ls file.img
file.img
$ qemu-system-x86_64 -monitor stdio -snapshot
QEMU 2.0.0 monitor - type 'help' for more information
(qemu) change ide1-cd0 file.img
(qemu) change ide1-cd0 file.img
(qemu) change ide1-cd0 file.img
Could not open 'file.img': No such file or directory
(qemu) q
$ ls file.img
ls: cannot access file.img: No such file or directory
qemu version is 2.0.0 from arch linux, which is the vanilla version plus one patch unrelated to this problem.
info block in snapshot mode reports:
ide1-cd0: /var/tmp/vl.G5WENk (qcow2)
Removable device: not locked, tray closed
Backing file: file.img (chain depth: 1)
whereas info block NOT in snapshot mode correctly reports:
ide1-cd0: file.img (raw, read-only)
Removable device: not locked, tray closed
Just tested qemu 2.1.0 and the bug is fixed in this version.