mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 01:18:00 +03:00
qemu: Replace big condition in virQEMUCapsCPUFilterFeatures with array
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
98700d354b
commit
29aa9b02aa
@ -3531,22 +3531,26 @@ virQEMUCapsProbeQMPSGXCapabilities(virQEMUCaps *qemuCaps,
|
|||||||
* QEMU never supported them or they were dropped as they never did anything
|
* QEMU never supported them or they were dropped as they never did anything
|
||||||
* useful.
|
* useful.
|
||||||
*/
|
*/
|
||||||
|
const char *ignoredFeatures[] = {
|
||||||
|
"cmt", "mbm_total", "mbm_local", /* never supported by QEMU */
|
||||||
|
"osxsave", "ospke", /* dropped from QEMU */
|
||||||
|
};
|
||||||
|
|
||||||
bool
|
bool
|
||||||
virQEMUCapsCPUFilterFeatures(const char *name,
|
virQEMUCapsCPUFilterFeatures(const char *name,
|
||||||
virCPUFeaturePolicy policy G_GNUC_UNUSED,
|
virCPUFeaturePolicy policy G_GNUC_UNUSED,
|
||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
virArch *arch = opaque;
|
virArch *arch = opaque;
|
||||||
|
size_t i;
|
||||||
|
|
||||||
if (!ARCH_IS_X86(*arch))
|
if (!ARCH_IS_X86(*arch))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (STREQ(name, "cmt") ||
|
for (i = 0; i < G_N_ELEMENTS(ignoredFeatures); i++) {
|
||||||
STREQ(name, "mbm_total") ||
|
if (STREQ(name, ignoredFeatures[i]))
|
||||||
STREQ(name, "mbm_local") ||
|
return false;
|
||||||
STREQ(name, "osxsave") ||
|
}
|
||||||
STREQ(name, "ospke"))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user