From d3fe9cc0f018a4bb225d2b8f12fb4d58d1ab568b Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 2 Mar 2023 17:54:19 +0100 Subject: [PATCH] tests: Set the QEMU driver as privileged in common code Most test programs were already doing this, and moving it to the common code ensures we see consistent behavior across all QEMU tests. Signed-off-by: Andrea Bolognani Reviewed-by: Martin Kletzander --- tests/qemumemlocktest.c | 2 -- tests/qemumigrationcookiexmltest.c | 2 -- tests/qemustatusxml2xmltest.c | 2 -- tests/qemuxml2argvtest.c | 2 -- tests/qemuxml2xmltest.c | 1 - tests/testutilsqemu.c | 2 ++ 6 files changed, 2 insertions(+), 9 deletions(-) diff --git a/tests/qemumemlocktest.c b/tests/qemumemlocktest.c index a03ed20a45..2f4fe786f5 100644 --- a/tests/qemumemlocktest.c +++ b/tests/qemumemlocktest.c @@ -51,8 +51,6 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; - driver.privileged = true; - # define DO_TEST(name, memlock) \ do { \ static struct testInfo info = { \ diff --git a/tests/qemumigrationcookiexmltest.c b/tests/qemumigrationcookiexmltest.c index 0e5f956a2a..2f0d84148b 100644 --- a/tests/qemumigrationcookiexmltest.c +++ b/tests/qemumigrationcookiexmltest.c @@ -413,8 +413,6 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; - driver.privileged = true; - if (!(conn = virGetConnect())) goto cleanup; diff --git a/tests/qemustatusxml2xmltest.c b/tests/qemustatusxml2xmltest.c index 7587c4c34f..408955a8f5 100644 --- a/tests/qemustatusxml2xmltest.c +++ b/tests/qemustatusxml2xmltest.c @@ -87,8 +87,6 @@ mymain(void) if (qemuTestDriverInit(&driver) < 0) return EXIT_FAILURE; - driver.privileged = true; - if (!(conn = virGetConnect())) goto cleanup; diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c41c890fc9..289fcf8014 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -830,8 +830,6 @@ mymain(void) linuxCaps = driver.caps; macOSCaps = testQemuCapsInitMacOS(); - driver.privileged = true; - VIR_FREE(driver.config->defaultTLSx509certdir); driver.config->defaultTLSx509certdir = g_strdup("/etc/pki/qemu"); VIR_FREE(driver.config->vncTLSx509certdir); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index ef6c829afe..847ebe85c6 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -148,7 +148,6 @@ mymain(void) macOSCaps = testQemuCapsInitMacOS(); cfg = virQEMUDriverGetConfig(&driver); - driver.privileged = true; VIR_FREE(cfg->nvramDir); cfg->nvramDir = g_strdup("/var/lib/libvirt/qemu/nvram"); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index e47e93e8a6..9983130399 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -683,6 +683,8 @@ int qemuTestDriverInit(virQEMUDriver *driver) qemuTestSetHostCPU(driver, driver->hostarch, NULL); + driver->privileged = true; + return 0; error: -- 2.47.2