]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Fix virQEMUDriverConfigNew() calling with respect to @root
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Mar 2020 08:55:54 +0000 (09:55 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Apr 2020 13:26:10 +0000 (15:26 +0200)
The virQEMUDriverConfigNew() accepts path to root directory for
embed mode as an argument. If the argument is not NULL it uses
the passed value as prefix for some internal paths (e.g.
cfg->libDir). If it is NULL though, it looks if the other
argument, @privileged is true or false and generates internal
paths accordingly. But when calling the function from the test
suite, instead of passing NULL for @root, an empty string is
passed. Fortunately, this doesn't create a problem because in
both problematic cases the generated paths are "fixed" to point
somewhere into build dir or the code which is tested doesn't
access them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
tests/domaincapstest.c
tests/testutilsqemu.c

index fb803eaa47aef427a71920cec418468c47ffb21b..c3a9f4ef911cc9e60a924e24c57ae07817924228 100644 (file)
@@ -369,7 +369,7 @@ mymain(void)
 #endif
 
 #if WITH_QEMU
-    virQEMUDriverConfigPtr cfg = virQEMUDriverConfigNew(false, "");
+    virQEMUDriverConfigPtr cfg = virQEMUDriverConfigNew(false, NULL);
 
     if (!cfg)
         return EXIT_FAILURE;
index f3b4e2b3b2de33831d9c67c6c6f2799addc70bf3..cb68ac048816e03579dec43debe88dda2b75058f 100644 (file)
@@ -390,7 +390,7 @@ int qemuTestDriverInit(virQEMUDriver *driver)
         return -1;
 
     driver->hostarch = virArchFromHost();
-    driver->config = virQEMUDriverConfigNew(false, "");
+    driver->config = virQEMUDriverConfigNew(false, NULL);
     if (!driver->config)
         goto error;