qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 08/12] qemu-img: Enable progress output for c


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v5 08/12] qemu-img: Enable progress output for commit
Date: Tue, 22 Apr 2014 18:24:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 22.04.2014 17:23, Eric Blake wrote:
On 04/17/2014 03:59 PM, Max Reitz wrote:
Implement progress output for the commit command by querying the
progress of the block job.

Signed-off-by: Max Reitz <address@hidden>
---
  qemu-img-cmds.hx |  4 ++--
  qemu-img.c       | 24 ++++++++++++++++++++++--
  qemu-img.texi    |  2 +-
  3 files changed, 25 insertions(+), 5 deletions(-)

+
+    /* A block job may finish instantanously without publishing any progress,
s/instantanously/instantaneously/

When I looked it up I wrote it correctly. *g*

@@ -733,7 +739,7 @@ static int img_commit(int argc, char **argv)
      fmt = NULL;
      cache = BDRV_DEFAULT_CACHE;
      for(;;) {
-        c = getopt(argc, argv, "f:ht:q");
+        c = getopt(argc, argv, "f:ht:qp");
Here, 'p' is last,...

          if (c == -1) {
              break;
          }
@@ -748,11 +754,20 @@ static int img_commit(int argc, char **argv)
          case 't':
              cache = optarg;
              break;
+        case 'p':
+            progress = true;
+            break;
          case 'q':
...but here, 'q' is last.  The OCD side of me likes to list getopt()
arguments in the same order as the case statements in order to more
easily map the two to each other and ensure we aren't missing anything
(the truly OCD person insists on sorting things alphabetically, or at
least case-insensitively).  As order doesn't actually matter to the
compiler, it doesn't invalidate this patch; but something to consider if
you respin for other reasons.  :)

I'll put p in front of q in getopt, as that is the smaller change. On the other hand, I guess I should consider keeping my code OCD hostile, so people will have a longer and closer look at it. *g*

Max



reply via email to

[Prev in Thread] Current Thread [Next in Thread]