qemuxml2argvtest: Clean up host CPU if overriden

If a test uses ARG_CAPS_HOST_CPU_MODEL feature we override the global
host cpu model to the selected CPU but don't clear it afterwards. This
can trip up fake caps tests following a test which uses this feature.

This does not happen with real caps, because unless overriden, the host
cpu from capabilities is always populated as the host cpu.

Clear the CPU on cleanup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2023-09-01 15:41:10 +02:00
parent 748dc3b1d3
commit e8cd18a8e8

View File

@ -713,6 +713,9 @@ testCompareXMLToArgv(const void *data)
ret = 0; ret = 0;
cleanup: cleanup:
/* clear overriden host cpu */
if (info->args.capsHostCPUModel)
qemuTestSetHostCPU(&driver, driver.hostarch, NULL);
virDomainChrSourceDefClear(&monitor_chr); virDomainChrSourceDefClear(&monitor_chr);
virObjectUnref(vm); virObjectUnref(vm);
virIdentitySetCurrent(NULL); virIdentitySetCurrent(NULL);