]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Prevent crash of libvirtd without guest agent
authorAlex Jia <ajia@redhat.com>
Thu, 16 Feb 2012 02:32:03 +0000 (10:32 +0800)
committerAlex Jia <ajia@redhat.com>
Thu, 16 Feb 2012 15:26:41 +0000 (23:26 +0800)
commit18942b9bea8a5a8a4d52c0cdde253ae91be338a6
tree5ba731ace58dd09f5dafd5280a856646abbc59c6
parente0d4b0db9e4cc045d9660f955ddccfabd098a91b
qemu: Prevent crash of libvirtd without guest agent

* src/qemu/qemu_process.c (qemuFindAgentConfig): avoid crash libvirtd due to
deref a NULL pointer.

* How to reproduce?
1. virsh edit the following xml into guest configuration:
    <channel type='pty'>
      <target type='virtio'/>
    </channel>
2. virsh start <domain>

or
% virt-install -n foo -r 1024 --disk path=/var/lib/libvirt/images/foo.img,size=1 \
--channel pty,target_type=virtio -l <installation tree>

Signed-off-by: Alex Jia <ajia@redhat.com>
src/qemu/qemu_process.c