Error reporting for failed QEMU processes isn't too great at the moment.
A couple cases I have hit:
- Trying to start a VM with a cdrom pointing to a nonexistent file. The
svirt hook function choked on this and indicated as much in the domain
log, but I still had to wait for the pidfile timeout (10 seconds), and
the only error reported was 'Domain did not show up'.
- QEMU dies quickly at startup. Happened with the pulse audio issue, or
if we build cli args incorrectly. The reporting here varies: if QEMU dies
before writing out the pidfile, the above case applies. If the pidfile is
written, we timeout in ReadLogOutput, and it's hit or miss whether we even
report the logfile output to the user.
The following patches improve the above cases by ensuring we never have to
wait for a timeout, and that the logfile output is always reported in the
error message.
Changes since v1:
Drop patch 1 + 2 (applied separately)
Patch 7 is pretty isolated, so was resent to list separately.
Don't waitpid in virExecDaemonize if virExec fails.
Remove needless pidfile loop in qemudStartVMDaemon.
Thanks,
Cole
Cole Robinson (4):
Add helper function virExecDaemonize
Report qemu log data if we fail to daemonize the process.
Add pidfile argument to __virExec
Check that QEMU is still alive while reading startup output.
src/libvirt_private.syms | 2 +-
src/proxy_internal.c | 16 +---
src/qemu_conf.c | 7 --
src/qemu_driver.c | 89 +++++++++++--------
src/remote_internal.c | 15 +---
src/uml_driver.c | 11 +--
src/util.c | 90 +++++++++++++++++---
src/util.h | 15 +++-
.../qemuxml2argvdata/qemuxml2argv-boot-cdrom.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-boot-floppy.args | 2 +-
.../qemuxml2argv-boot-network.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-bootloader.args | 2 +-
.../qemuxml2argv-clock-localtime.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-clock-utc.args | 2 +-
.../qemuxml2argv-console-compat.args | 2 +-
.../qemuxml2argv-disk-cdrom-empty.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-cdrom.args | 2 +-
.../qemuxml2argv-disk-drive-boot-cdrom.args | 2 +-
.../qemuxml2argv-disk-drive-boot-disk.args | 2 +-
.../qemuxml2argv-disk-drive-cache-v1-none.args | 2 +-
.../qemuxml2argv-disk-drive-cache-v1-wb.args | 2 +-
.../qemuxml2argv-disk-drive-cache-v1-wt.args | 2 +-
.../qemuxml2argv-disk-drive-cache-v2-none.args | 2 +-
.../qemuxml2argv-disk-drive-cache-v2-wb.args | 2 +-
.../qemuxml2argv-disk-drive-cache-v2-wt.args | 2 +-
.../qemuxml2argv-disk-drive-fmt-qcow.args | 2 +-
.../qemuxml2argv-disk-drive-shared.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-floppy.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-many.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-disk-usb.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-virtio.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-disk-xenvbd.args | 2 +-
.../qemuxml2argv-graphics-sdl-fullscreen.args | 2 +-
.../qemuxml2argv-graphics-sdl.args | 2 +-
.../qemuxml2argv-graphics-vnc-sasl.args | 2 +-
.../qemuxml2argv-graphics-vnc-tls.args | 2 +-
.../qemuxml2argv-graphics-vnc.args | 2 +-
.../qemuxml2argv-hostdev-pci-address.args | 2 +-
.../qemuxml2argv-hostdev-usb-address.args | 2 +-
.../qemuxml2argv-hostdev-usb-product.args | 2 +-
.../qemuxml2argv-input-usbmouse.args | 2 +-
.../qemuxml2argv-input-usbtablet.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-input-xen.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-migrate.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-minimal.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-misc-acpi.args | 2 +-
.../qemuxml2argv-misc-no-reboot.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-misc-uuid.args | 2 +-
.../qemuxml2argv-net-eth-ifname.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-eth.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-net-user.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-net-virtio.args | 2 +-
.../qemuxml2argv-parallel-tcp.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-restore-v1.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-restore-v2.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-dev.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-file.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-many.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-pty.args | 2 +-
.../qemuxml2argv-serial-tcp-telnet.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-tcp.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-udp.args | 2 +-
.../qemuxml2argvdata/qemuxml2argv-serial-unix.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-serial-vc.args | 2 +-
tests/qemuxml2argvdata/qemuxml2argv-sound.args | 2 +-
65 files changed, 211 insertions(+), 148 deletions(-)