[Libguestfs] [PATCH 05/12] Add progress messages to zero command.

Richard Jones rjones at redhat.com
Tue Aug 31 20:11:11 UTC 2010


---
 daemon/zero.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/daemon/zero.c b/daemon/zero.c
index df4ebd6..43089e0 100644
--- a/daemon/zero.c
+++ b/daemon/zero.c
@@ -42,12 +42,14 @@ do_zero (const char *device)
 
   memset (buf, 0, sizeof buf);
 
-  for (i = 0; i < 32; ++i)
+  for (i = 0; i < 32; ++i) {
     if (write (fd, buf, sizeof buf) != sizeof buf) {
       reply_with_perror ("write: %s", device);
       close (fd);
       return -1;
     }
+    notify_progress ((uint64_t) i, 32);
+  }
 
   if (close (fd) == -1) {
     reply_with_perror ("close: %s", device);
-- 
1.7.1




More information about the Libguestfs mailing list