Created attachment 1116780 [details] libvirtd log and guest XML Description of problem: Set unix channel mode to "connect" and disk image source file pointing to a non-existing path in guest XML, then start guest, libvirtd will crash. Version-Release number of selected component (if applicable): libvirt: # git describe v1.3.1-11-g020135d qemu: # git describe v2.5.0-640-g3db34bf How reproducible: 100% Steps to Reproduce: 1.Prepare guest XML as below: # virsh dumpxml rhel7.2-1 ... <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none'/> <source file='/90121/fjin/r7raw.raw'/> ... <channel type='unix'> <source mode='connect'/> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> ... # ls /90121/fjin/r7raw.raw ls: cannot access /90121/fjin/r7raw.raw: No such file or directory 2. Start guest, libvirtd crashes: # virsh start rhel7.2-1 error: Disconnected from qemu:///system due to I/O error error: Failed to start domain rhel7.2-1 error: End of file while reading data: Input/output error error: One or more references were leaked after disconnect from the hypervisor 3.Set unix channel source mode to bind, libvirtd doesn't crash: # virsh dumpxml rhel7.2-1 ... <channel type='unix'> <source mode='bind'/> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> ... # virsh start rhel7.2-1 error: Failed to start domain rhel7.2-1 error: Cannot access storage file '/90121/fjin/r7raw.raw' (as uid:107, gid:107): No such file or directory Actual results: Libvirtd crashes. Expected results: Libvirtd doesn't crash. Additional info: 1. I test with libvirt-1.2.17-13.el7_2.2.x86_64, set guest xml as below, libvirtd doesn't crash: # virsh dumpxml rhel7.2 ... <channel type='unix'> <source mode='connect' path='/var/lib/libvirt/qemu/channel/target/domain-rhel7.2/org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> ... # virsh start rhel7.2 error: Failed to start domain rhel7.2 error: Cannot access storage file '/var/lib/libvirt/images/rraw.raw' (as uid:107, gid:107): No such file or directory
Created attachment 1116781 [details] backtrace
Fixed upstream by v1.3.1-96-g1794a0103ae4: commit 1794a0103ae4fa91d9c11617e7981471173e27ce Author: Martin Kletzander <mkletzan> Date: Tue Feb 2 22:08:59 2016 +0100 qemu: Don't crash when create fails early