]> xenbits.xensource.com Git - libvirt.git/commit
qemu: fixing auto-detecting binary in domain capabilities
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 17 Jan 2020 13:25:02 +0000 (13:25 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 23 Jan 2020 16:38:59 +0000 (16:38 +0000)
commit6d786f95a366600e7bbae68c1b324a8131f5e2c5
tree83626fbcb833e70ad1af958acaab5b6c0e22bd62
parente7a65484ba7aa51c99ab3405117667a39b37e386
qemu: fixing auto-detecting binary in domain capabilities

The virConnectGetDomainCapabilities API accepts either a binary path
to the emulator, or desired guest arch. If guest arch is not given,
then the host arch is assumed.

In the case where the binary is not given, the code tried to find the
emulator binary in the existing list of cached emulator capabilities.
This is not valid since we switched to lazy population of the cache in:

  commit 3dd91af01f30c5bda6328454ef49f3afece755d6
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Mon Dec 2 13:04:26 2019 +0000

    qemu: stop creating capabilities at driver startup

As a result of this change, if there are no persistent guests defined
using the requested guest architecture, virConnectGetDomainCapabilities
will fail to find an emulator binary.

The solution is to stop relying on the cached capabilities to find the
binary and instead use the same logic we use to pick default a binary
per arch when populating capabilities.

Tested-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_capabilities.c