summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-03-15 10:07:26 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-03-15 16:15:44 +0000
commit03d4345c8c8de4df1c9d4446b0817d85ff378aa9 (patch)
treef77274c3313a7086469608eb589ad1306393afc3
parentd9bdb9587b4e1cad0c3e9997ea7d2b2a07aed0ad (diff)
downloadlibguestfs-03d4345c8c8de4df1c9d4446b0817d85ff378aa9.tar.gz
libguestfs-03d4345c8c8de4df1c9d4446b0817d85ff378aa9.tar.xz
libguestfs-03d4345c8c8de4df1c9d4446b0817d85ff378aa9.zip
sparsify: Use new zero_free_space API.
-rw-r--r--sparsify/sparsify.ml16
1 files changed, 2 insertions, 14 deletions
diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml
index ff2ac5b5..711358e4 100644
--- a/sparsify/sparsify.ml
+++ b/sparsify/sparsify.ml
@@ -1,5 +1,5 @@
(* virt-sparsify
- * Copyright (C) 2011 Red Hat Inc.
+ * Copyright (C) 2011-2012 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -205,19 +205,7 @@ let () =
if not quiet then
printf "Fill free space in %s with zero ...\n%!" fs;
- (* Choose a random filename, just letters and numbers, in
- * 8.3 format. This ought to be compatible with any
- * filesystem and not clash with existing files.
- *)
- let filename = "/" ^ string_random8 () ^ ".tmp" in
-
- (* This command is expected to fail. *)
- (try g#dd "/dev/zero" filename with _ -> ());
-
- (* Make sure the last part of the file is written to disk. *)
- g#sync ();
-
- g#rm filename
+ g#zero_free_space "/"
);
g#umount_all ()