From e8cd18a8e8355ebfdcf4d098ec449798f28462a1 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 1 Sep 2023 15:41:10 +0200 Subject: [PATCH] qemuxml2argvtest: Clean up host CPU if overriden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ján Tomko --- tests/qemuxml2argvtest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 5d23c552c5..32affb16c0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -713,6 +713,9 @@ testCompareXMLToArgv(const void *data) ret = 0; cleanup: + /* clear overriden host cpu */ + if (info->args.capsHostCPUModel) + qemuTestSetHostCPU(&driver, driver.hostarch, NULL); virDomainChrSourceDefClear(&monitor_chr); virObjectUnref(vm); virIdentitySetCurrent(NULL);