mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +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 {
|
||||
virArch arch;
|
||||
const char *binaryFilter;
|
||||
};
|
||||
|
||||
|
||||
@ -4743,7 +4744,15 @@ virQEMUCapsCompareArch(const void *payload,
|
||||
struct virQEMUCapsSearchData *data = (struct virQEMUCapsSearchData *)opaque;
|
||||
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,20 +4761,28 @@ virQEMUCapsCacheLookupByArch(virFileCachePtr cache,
|
||||
virArch arch)
|
||||
{
|
||||
virQEMUCapsPtr ret = NULL;
|
||||
const char *binaryFilters[] = {
|
||||
"qemu-system-",
|
||||
NULL,
|
||||
};
|
||||
virArch archs[] = {
|
||||
arch,
|
||||
virQEMUCapsFindTarget(virArchFromHost(), arch),
|
||||
};
|
||||
size_t i;
|
||||
size_t j;
|
||||
|
||||
for (j = 0; j < ARRAY_CARDINALITY(archs); j++) {
|
||||
struct virQEMUCapsSearchData data = {
|
||||
.arch = archs[j],
|
||||
};
|
||||
for (i = 0; i < ARRAY_CARDINALITY(binaryFilters); i++) {
|
||||
for (j = 0; j < ARRAY_CARDINALITY(archs); j++) {
|
||||
struct virQEMUCapsSearchData data = {
|
||||
.arch = archs[j],
|
||||
.binaryFilter = binaryFilters[i],
|
||||
};
|
||||
|
||||
ret = virFileCacheLookupByFunc(cache, virQEMUCapsCompareArch, &data);
|
||||
if (ret)
|
||||
goto done;
|
||||
ret = virFileCacheLookupByFunc(cache, virQEMUCapsCompareArch, &data);
|
||||
if (ret)
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
|
Loading…
Reference in New Issue
Block a user