Red Hat Bugzilla – Bug 653582
Changing media with -snapshot deletes image file
Last modified: 2013-01-09 18:20:27 EST
Description of problem: When using -snapshot, a new qcow2 image is created and marked as temporary so that it gets deleted. When changing media, no new overlay file is created for the new image, however it's still treated as temporary and is therefore deleted. Steps to Reproduce: 1. Create two images, say test1.img and test2.img 2. Start qemu -cdrom test1.img -snapshot 3. In the qemu monitor enter 'change ide1-cd0 test2.img' Actual results: The image representing the CD-ROM is changed. At the same time it's deleted from the file system. Expected results: The image representing the CD-ROM is changed. The file stays unchanged.
Reproduce this bug with qemu-kvm-0.12.1.2-2.113.el6.x86_64. Verify this bug with qemu-kvm-0.12.1.2-2.128.el6.x86_64, #CLI: /usr/libexec/qemu-kvm -cdrom qcow2.2G -snapshot -monitor stdio (qemu) info block ide1-cd0: type=cdrom removable=1 locked=0 file=/tmp/vl.4x0387 backing_file=/root/resize/qcow2.2G ro=0 drv=qcow2 encrypted=0 floppy0: type=floppy removable=1 locked=0 [not inserted] sd0: type=floppy removable=1 locked=0 [not inserted] (qemu) change ide1-cd0 /root/resize/raw.2G (qemu) info block ide1-cd0: type=cdrom removable=1 locked=0 file=/tmp/vl.MA7wH3 backing_file=/root/resize/raw.2G ro=0 drv=qcow2 encrypted=0 floppy0: type=floppy removable=1 locked=0 [not inserted] sd0: type=floppy removable=1 locked=0 [not inserted] # ll /root/resize/ total 144 -rw-r--r-- 1 root root 328192 Dec 23 21:03 qcow2.2G -rw-r--r-- 1 root root 2147483648 Dec 23 22:21 raw.2G So this bug has been resolved.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2011-0534.html