]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Wire up better early error reporting
authorPeter Krempa <pkrempa@redhat.com>
Wed, 18 Sep 2013 14:23:14 +0000 (16:23 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 25 Sep 2013 11:50:57 +0000 (13:50 +0200)
commitef29de14c37d14abc546e90555a0093797facfdd
tree4178f533323e32caaed7619e66ba214dea24b6c0
parent90139a6236eb20a5cd2595af39ea11adae7d54de
qemu: Wire up better early error reporting

The previous patches added infrastructure to report better errors from
monitor in some cases. This patch finalizes this "feature" by enabling
this enhanced error reporting on early phases of VM startup. In these
phases the possibility of qemu producing a useful error message is
really high compared to running it during the whole life cycle. After
the start up is complete, the feature is disabled to provide the usual
error messages so that users are not confused by possibly irrelevant
messages that may be in the domain log.

The original motivation to do this enhancement is to capture errors when
using VFIO device passthrough, where qemu reports errors after the
monitor is initialized and the existing error catching code couldn't
catch this producing a unhelpful message:

 # virsh start test
 error: Failed to start domain test
 error: Unable to read from monitor: Connection reset by peer

With this change, the message is changed to:

 # virsh start test
 error: Failed to start domain test
 error: internal error: early end of file from monitor: possible problem:
 qemu-system-x86_64: -device vfio-pci,host=00:1a.0,id=hostdev0,bus=pci.0,addr=0x5: vfio: error, group 8 is not viable, please ensure all devices within the iommu_group are bound to their vfio bus driver.
 qemu-system-x86_64: -device vfio-pci,host=00:1a.0,id=hostdev0,bus=pci.0,addr=0x5: vfio: failed to get group 8
 qemu-system-x86_64: -device vfio-pci,host=00:1a.0,id=hostdev0,bus=pci.0,addr=0x5: Device 'vfio-pci' could not be initialized
src/qemu/qemu_process.c