
On Fri, Jan 30, 2009 at 11:37:35AM +0000, Daniel P. Berrange wrote:
The recent refactoring of the QEMU startup process now reads the monitor TTY from the logfile. Unfortunately in this refactoring we lost the check for the 'ret == 0' scenario in the read() return value. So if QEMU quits at startup, eg due to missing disk image, we loop forever on read() == 0 because we hit end-of-file and QEMU has quit.
This patch adds back handling for this scenario, and takes care to propagate the contents of the log to the user as an error message
# start demo libvir: QEMU error : internal error unable to start guest: qemu: could not open disk image /home/berrange/Fedora-9-i686-Live.iso error: Failed to start domain demo
In addition, there were a couple of other bugs
- a memory leak where we set the 'monitorpath' variable, even though we'd just set it moments before.
- a missing check for whether the driver VNC password was present when initializing passwords at VM startupo
- missing initialization of the monitor_watch field, and missing checking for whether the watch was set before removing it.
- a gratuitous LOG_INFO when shutting down any VM, which could just be LOG_DEBUG.
Patch looks reasonnable to me, +1 Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/