[libvirt] [PATCH] tests: simplify storage test cleanup

Eric Blake eblake at redhat.com
Wed Apr 2 21:53:21 UTC 2014


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 at redhat.com>
---

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




More information about the libvir-list mailing list