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 <abologna@xxxxxxxxxx> --- 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 afa22275b8..22c0642d25 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 69bff80376..7ccf3ab97f 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 396803c40b..20bf32b321 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -680,6 +680,8 @@ int qemuTestDriverInit(virQEMUDriver *driver) qemuTestSetHostCPU(driver, driver->hostarch, NULL); + driver->privileged = true; + return 0; error: -- 2.39.2