[PATCH] tests: simplify storage test cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No need to spawn a child 'rm' process when we can do it ourselves.

* tests/virstoragetest.c (testCleanupImages): Use dedicated
helper.

Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---

Pushing under the trivial rule.

 tests/virstoragetest.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c
index 3089d70..9ec39c7 100644
--- a/tests/virstoragetest.c
+++ b/tests/virstoragetest.c
@@ -62,8 +62,6 @@ static char *abslink2;
 static void
 testCleanupImages(void)
 {
-    virCommandPtr cmd;
-
     VIR_FREE(qemuimg);
     VIR_FREE(absraw);
     VIR_FREE(canonraw);
@@ -79,9 +77,7 @@ testCleanupImages(void)
         return;
     }

-    cmd = virCommandNewArgList("rm", "-rf", datadir, NULL);
-    ignore_value(virCommandRun(cmd, NULL));
-    virCommandFree(cmd);
+    virFileDeleteTree(datadir);
 }

 static int
-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]