From: Richard Jones Date: Sat, 28 Aug 2010 13:29:07 +0000 (+0100) Subject: Add progress messages to zero command. X-Git-Tag: 1.5.7~15 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=88ab203e611694bc0d01aca745e8df18cb3f094e;p=libguestfs.git Add progress messages to zero command. --- 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); diff --git a/src/generator.ml b/src/generator.ml index c9a99e1..fb9735a 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -2698,7 +2698,7 @@ Checking or repairing NTFS volumes is not supported This command is entirely equivalent to running C."); - ("zero", (RErr, [Device "device"]), 85, [], + ("zero", (RErr, [Device "device"]), 85, [Progress], [InitBasicFS, Always, TestOutput ( [["umount"; "/dev/sda1"]; ["zero"; "/dev/sda1"];