[libvirt] [PATCH 3/3] tests: Call virFileWrapperClearPrefixes() for tests using virFileWrapper

Michal Privoznik mprivozn at redhat.com
Wed Mar 13 10:13:09 UTC 2019


This is mostly to avoid a memleak that is not a true memleak
anyway - prefixes will be freed by kernel upon test exit.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 tests/qemufirmwaretest.c | 2 ++
 tests/qemuxml2argvtest.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c
index 3fbeb2b852..340344ebba 100644
--- a/tests/qemufirmwaretest.c
+++ b/tests/qemufirmwaretest.c
@@ -128,6 +128,8 @@ mymain(void)
     if (virTestRun("QEMU FW precedence test", testFWPrecedence, NULL) < 0)
         ret = -1;
 
+    virFileWrapperClearPrefixes();
+
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
 
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index bd9619ae38..03e8d79595 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -3044,6 +3044,7 @@ mymain(void)
     qemuTestDriverFree(&driver);
     VIR_FREE(fakerootdir);
     virHashFree(capslatest);
+    virFileWrapperClearPrefixes();
 
     return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-- 
2.19.2




More information about the libvir-list mailing list