1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-26 03:21:44 +03:00

qemu: capabilities: Drop the virQEMUCapsCacheLookupByArch function

Previous commit removed the last usage of the function. Drop
virQEMUCapsCompareArch as well since virQEMUCapsCacheLookupByArch was
its only caller.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Erik Skultety 2020-07-08 09:58:51 +02:00
parent f3d838237d
commit bc33b8c639
2 changed files with 0 additions and 65 deletions

View File

@ -5668,69 +5668,6 @@ virQEMUCapsCacheLookupCopy(virFileCachePtr cache,
}
static int
virQEMUCapsCompareArch(const void *payload,
const void *name G_GNUC_UNUSED,
const void *opaque)
{
struct virQEMUCapsSearchData *data = (struct virQEMUCapsSearchData *)opaque;
const virQEMUCaps *qemuCaps = payload;
if (qemuCaps->arch != data->arch)
return false;
if (data->binaryFilter &&
!strstr(qemuCaps->binary, data->binaryFilter)) {
return false;
}
return true;
}
virQEMUCapsPtr
virQEMUCapsCacheLookupByArch(virFileCachePtr cache,
virArch arch)
{
virQEMUCapsCachePrivPtr priv = virFileCacheGetPriv(cache);
virQEMUCapsPtr ret = NULL;
const char *binaryFilters[] = {
"qemu-system-",
NULL,
};
virArch archs[] = {
arch,
virQEMUCapsFindTarget(virArchFromHost(), arch),
};
size_t i;
size_t j;
priv->microcodeVersion = virHostCPUGetMicrocodeVersion();
for (i = 0; i < G_N_ELEMENTS(binaryFilters); i++) {
for (j = 0; j < G_N_ELEMENTS(archs); j++) {
struct virQEMUCapsSearchData data = {
.arch = archs[j],
.binaryFilter = binaryFilters[i],
};
ret = virFileCacheLookupByFunc(cache, virQEMUCapsCompareArch, &data);
if (ret)
goto done;
}
}
virReportError(VIR_ERR_INVALID_ARG,
_("unable to find any emulator to serve '%s' "
"architecture"), virArchToString(arch));
done:
VIR_DEBUG("Returning caps %p for arch %s", ret, virArchToString(arch));
return ret;
}
/**
* virQEMUCapsCacheLookupDefault:
* @cache: QEMU capabilities cache

View File

@ -703,8 +703,6 @@ virQEMUCapsPtr virQEMUCapsCacheLookupCopy(virFileCachePtr cache,
virDomainVirtType virtType,
const char *binary,
const char *machineType);
virQEMUCapsPtr virQEMUCapsCacheLookupByArch(virFileCachePtr cache,
virArch arch);
virQEMUCapsPtr virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
const char *binary,
const char *archStr,