]> xenbits.xensource.com Git - libvirt.git/commit
Report original error when QMP probing fails with new QEMU
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 4 Dec 2014 15:26:41 +0000 (15:26 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 5 Dec 2014 10:57:46 +0000 (10:57 +0000)
commit25bf888a6653ecdeca58c597c296757f4cf8a229
treeee07aae2cb71aef493d12b2ff9a7f1f71d55060a
parentd1e460136a8ad1ce7717d2d75cd878812f63f1bb
Report original error when QMP probing fails with new QEMU

If probing capabilities via QMP fails, we now have a check
that prevents us falling back to -help parsing. Unfortunately
the error message

  "Failed to probe capabilities for /usr/bin/qemu-kvm:
   unsupported configuration: QEMU 2.1.2 is too new for help parsing"

is proving rather unhelpful to the user. We need to be telling
them why QMP failed (the root cause), rather than they can't
use -help (the side effect).

To do this we should capture stderr during QMP probing, and
if -help parsing then sees a new QEMU version, we know that
QMP should have worked, and so we can show the messages from
stderr. The message thus becomes

  "Failed to probe capabilities for /usr/bin/qemu-kvm:
   internal error: QEMU / QMP failed: Could not access
   KVM kernel module: No such file or directory
   failed to initialize KVM: No such file or directory"
src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
tests/qemuhelptest.c