Created attachment 1314227 [details] Complete libvirt log Description of problem: When trying to run a VM with disk image located at /dev/shm, and connection type qemu:///system, I'm getting the following error: -bash-4.4$ virsh -c qemu:///system create dom.xml error: Failed to create domain from dom.xml error: internal error: Process exited prior to exec: libvirt: QEMU Driver error : Unable to stat /dev/shm/test-with-virsh/centos-7.3.img: No such file or directory domain xml: <domain type='kvm'> <name>demo2</name> <uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa0</uuid> <memory>4096</memory> <vcpu>1</vcpu> <os> <type arch="x86_64">hvm</type> </os> <clock sync="localtime"/> <devices> <emulator>/usr/bin/qemu-kvm</emulator> <disk type='file' device='disk'> <source file='/dev/shm/test-with-virsh/centos-7.3.img'/> <target dev='hda'/> </disk> <console type='pty'> <source path='/dev/pts/4'/> <target port='0'/> </console> </devices> </domain> Relevant part from libvirt's log: error: 2017-08-16 13:34:45.865+0000: 329: debug : virEventPollCalculateTimeout:338 : Calculate expiry of 2 timers 2017-08-16 13:34:45.865+0000: 329: debug : virEventPollCalculateTimeout:346 : Got a timeout scheduled for 1502890490865 Failed to create domain from dom.xml error: 2017-08-16 13:34:45.865+0000: 329: debug : virEventPollCalculateTimeout:359 : Schedule timeout then=1502890490865 now=1502890485865 internal error: Process exited prior to exec: libvirt: QEMU Driver error : Unable to stat /dev/shm/test-with-virsh/centos-7.3.img: No such file or directory Complete libvirt log: attached Version-Release number of selected component (if applicable): libvirt-3.2.1-4.fc26.x86_64 qemu-kvm-2.9.0-3.fc26.x86_64 How reproducible: Run a VM with disk image on /dev/shm and connection type qemu:///system Actual results: VM doesn't start Expected results: VM should start Additional info:
Probably due to some incomplete interaction with the fs namespace stuff, ccing Michal
This is fixed upstream for a while now: commit a7cc039dc796f541793955598377807af48341fb Author: Michal Privoznik <mprivozn> AuthorDate: Thu Apr 27 16:29:21 2017 +0200 Commit: Michal Privoznik <mprivozn> CommitDate: Wed May 3 17:23:03 2017 +0200 qemuDomainBuildNamespace: Move /dev/* mountpoints later When setting up mount namespace for a qemu domain the following steps are executed: 1) get list of mountpoints under /dev/ 2) move them to /var/run/libvirt/qemu/$domName.ext 3) start constructing new device tree under /var/run/libvirt/qemu/$domName.dev 4) move the mountpoint of the new device tree to /dev 5) restore original mountpoints from step 2) Note the problem with this approach is that if some device in step 3) requires access to a mountpoint from step 2) it will fail as the mountpoint is not there anymore. For instance consider the following domain disk configuration: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/dev/shm/vhostmd0'/> <target dev='vdb' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </disk> In this case operation fails as we are unable to create vhostmd0 in the new device tree because after step 2) there is no /dev/shm anymore. Leave aside fact that we shouldn't try to create devices living in other mountpoints. That's a separate bug that will be addressed later. Currently, the order described above is rearranged to: 1) get list of mountpoints under /dev/ 2) start constructing new device tree under /var/run/libvirt/qemu/$domName.dev 3) move them to /var/run/libvirt/qemu/$domName.ext 4) move the mountpoint of the new device tree to /dev 5) restore original mountpoints from step 3) Signed-off-by: Michal Privoznik <mprivozn> Reviewed-by: Cedric Bosdonnat <cbosdonnat> The 3.3.0 release should work. Also, this is the same bug as bug 1449510 which is for RHEL.
libvirt-3.2.1-6.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ff7b30a42d
libvirt-3.2.1-6.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ff7b30a42d
libvirt-3.2.1-6.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.