mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
qemu: Prefer qemu-system-* binaries
We already prefer them in capabilities, and domcapabilities should be consistent with that. This commit is best viewed with 'git show -w'. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
parent
7948ad4129
commit
1a3de67001
@ -583,6 +583,7 @@ struct _virQEMUCaps {
|
|||||||
|
|
||||||
struct virQEMUCapsSearchData {
|
struct virQEMUCapsSearchData {
|
||||||
virArch arch;
|
virArch arch;
|
||||||
|
const char *binaryFilter;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -4743,7 +4744,15 @@ virQEMUCapsCompareArch(const void *payload,
|
|||||||
struct virQEMUCapsSearchData *data = (struct virQEMUCapsSearchData *)opaque;
|
struct virQEMUCapsSearchData *data = (struct virQEMUCapsSearchData *)opaque;
|
||||||
const virQEMUCaps *qemuCaps = payload;
|
const virQEMUCaps *qemuCaps = payload;
|
||||||
|
|
||||||
return qemuCaps->arch == data->arch;
|
if (qemuCaps->arch != data->arch)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (data->binaryFilter &&
|
||||||
|
!strstr(qemuCaps->binary, data->binaryFilter)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4752,21 +4761,29 @@ virQEMUCapsCacheLookupByArch(virFileCachePtr cache,
|
|||||||
virArch arch)
|
virArch arch)
|
||||||
{
|
{
|
||||||
virQEMUCapsPtr ret = NULL;
|
virQEMUCapsPtr ret = NULL;
|
||||||
|
const char *binaryFilters[] = {
|
||||||
|
"qemu-system-",
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
virArch archs[] = {
|
virArch archs[] = {
|
||||||
arch,
|
arch,
|
||||||
virQEMUCapsFindTarget(virArchFromHost(), arch),
|
virQEMUCapsFindTarget(virArchFromHost(), arch),
|
||||||
};
|
};
|
||||||
|
size_t i;
|
||||||
size_t j;
|
size_t j;
|
||||||
|
|
||||||
|
for (i = 0; i < ARRAY_CARDINALITY(binaryFilters); i++) {
|
||||||
for (j = 0; j < ARRAY_CARDINALITY(archs); j++) {
|
for (j = 0; j < ARRAY_CARDINALITY(archs); j++) {
|
||||||
struct virQEMUCapsSearchData data = {
|
struct virQEMUCapsSearchData data = {
|
||||||
.arch = archs[j],
|
.arch = archs[j],
|
||||||
|
.binaryFilter = binaryFilters[i],
|
||||||
};
|
};
|
||||||
|
|
||||||
ret = virFileCacheLookupByFunc(cache, virQEMUCapsCompareArch, &data);
|
ret = virFileCacheLookupByFunc(cache, virQEMUCapsCompareArch, &data);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virReportError(VIR_ERR_INVALID_ARG,
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
_("unable to find any emulator to serve '%s' "
|
_("unable to find any emulator to serve '%s' "
|
||||||
|
Loading…
Reference in New Issue
Block a user