From: Michal Privoznik Date: Thu, 24 Jul 2014 14:40:01 +0000 (+0200) Subject: qemuConnectGetDomainCapabilities: Report error on unknown arch X-Git-Tag: v1.2.7-rc1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d968f409fa7f5bf95069ea08983b1454992d166;p=thirdparty%2Flibvirt.git qemuConnectGetDomainCapabilities: Report error on unknown arch If user hasn't provided any @emulatorbin, the qemuCaps are searched by @arch provided (which in fact can be guessed from the host). However, there's no guarantee that the qemu binary for @arch will exist. Therefore qemu capabilities may be nonexistent too. If that's the case, we should throw an error message prior jumping onto 'cleanup' label as the helper lookup function remains silent on no search result. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index be622af6c0..ca0d77f1f2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16976,8 +16976,12 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, } } else { if (!(qemuCaps = virQEMUCapsCacheLookupByArch(driver->qemuCapsCache, - arch))) + arch))) { + virReportError(VIR_ERR_INVALID_ARG, + _("unable to find any emulator to serve '%s' " + "architecture"), virArchToString(arch)); goto cleanup; + } emulatorbin = virQEMUCapsGetBinary(qemuCaps); }