qemu-kvm with snapshot option always fails with Permission denied Could not open disk image
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
QEMU |
Invalid
|
Undecided
|
Unassigned |
Bug Description
I'm trying to use the option: -snapshot write to temporary files instead of disk image files
How to reproduce? See following log:
2013-06-20 02:13:18.532+0000: starting up
LC_ALL=C PATH=/usr/
Domain id=1 is tainted: custom-argv
char device redirected to /dev/pts/18
qemu-system-x86_64: -drive file=/opt/
2013-06-20 02:13:18.683+0000: shutting down
Version: QEMU emulator version 1.0 (qemu-kvm-1.0), Copyright (c) 2003-2008 Fabrice Bellard
Related info:
The disk is a qcow2 image with a backing file. Both the backing file and the disk are cmodded with 777.
This is a log from dmesg related to apparmor:
[ 236.531287] type=1400 audit(137169439
libvirt.xml that I'm using:
<domain type="qemu" xmlns:qemu='http://
<uuid>
<name>
<memory>
<vcpu>1</vcpu>
<os>
<type>
<kernel>
<initrd>
<cmdline>
</os>
<features>
<acpi/>
<apic/>
</features>
<clock offset="utc"/>
<devices>
<disk type="file" device="disk">
<driver name="qemu" type="qcow2" cache="none"/>
<source file="/
<target bus="virtio" dev="vda"/>
</disk>
<disk type="block" device="cdrom">
<driver name="qemu" type="raw"/>
<target tray="open" dev="hdc"/>
<readonly/>
</disk>
<interface type="bridge">
<mac address=
<source bridge="br100"/>
<filterref filter=
<parameter name="IP" value="10.0.0.3"/>
<parameter name="DHCPSERVER" value="10.0.0.1"/>
<parameter name="PROJNET" value="10.0.0.0"/>
<parameter name="PROJMASK" value="
</filterref>
</interface>
<serial type="file">
<source path="/
</serial>
<serial type="pty"/>
<input type="tablet" bus="usb"/>
<graphics type="vnc" autoport="no" port="32768" keymap="en-us" listen=
</devices>
<qemu:commandline>
<qemu:arg value='-snapshot'/>
</qemu:commandline>
</domain>
On 06/19/2013 08:42 PM, Sam Stoelinga wrote:
> Public bug reported:
>
> I'm trying to use the option: -snapshot write to temporary files
> instead of disk image files
>
> libvirt. org/schemas/ domain/ qemu/1. 0'>
> libvirt.xml that I'm using:
> <domain type="qemu" xmlns:qemu='http://
> <qemu:commandline>
> <qemu:arg value='-snapshot'/>
> </qemu:commandline>
> </domain>
This is unsupported usage of libvirt, and not a qemu bug. You'd need to
take this up with the libvirt list to get libvirt to properly support
temporary disk images without needing <qemu:commandline>, and so that
libvirt is properly setting SELinux permissions on the temporary file.
-- libvirt. org
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://