]> xenbits.xensource.com Git - libvirt.git/commit
qemu: avoid crash on process attach
authorEric Blake <eblake@redhat.com>
Thu, 4 Aug 2011 20:07:58 +0000 (14:07 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 4 Aug 2011 20:18:14 +0000 (14:18 -0600)
commit5ef1b6c54a43112338db7192fa32921bcf7aca81
treeae2151b2f5d5cc6f7a0654297c084b816b91eaef
parent3aa84653d1c457b1c12efd4b8449e31525042254
qemu: avoid crash on process attach

Detected by ccc-analyzer, reported by Alex Jia.

qemuProcessStart always calls qemuProcessWaitForMonitor with a
non-negative position, but qemuProcessAttach always calls with -1.
In the latter case, there is no log file we can scrape, so we
also should not be trying to scrape the logs if the qemu process
died at the very end.

* src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Don't try
to read from log in qemuProcessAttach case.
src/qemu/qemu_process.c