Re: [PATCH] virsh: Improve the job type reported of virsh cmd blockcommit

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

 



On 23.10.2014 12:13, Shanzhi Yu wrote:
When begin a blockcommit job(active) with virsh, it will report
"Block Commit started"(it really donesn't matter much), but for
more preciese it should report "Active Block Commit started"

Signed-off-by: Shanzhi Yu <shyu@xxxxxxxxxx>
---
  tools/virsh-domain.c | 12 +++++++++---
  1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 94ae3d3..3416e31 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -1723,9 +1723,15 @@ cmdBlockCommit(vshControl *ctl, const vshCmd *cmd)
          goto cleanup;

      if (!blocking) {
-        vshPrint(ctl, "%s", _("Block Commit started"));
-        ret = true;
-        goto cleanup;
+        if (active) {
+            vshPrint(ctl, "%s", _("Active Block Commit started"));
+            ret = true;
+            goto cleanup;
+        } else {
+            vshPrint(ctl, "%s", _("Block Commit started"));
+            ret = true;
+            goto cleanup;
+        }
      }

      while (blocking) {


I think a smaller diff would suffice too:

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 94ae3d3..971af83 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -1723,7 +1723,9 @@ cmdBlockCommit(vshControl *ctl, const vshCmd *cmd)
         goto cleanup;

     if (!blocking) {
-        vshPrint(ctl, "%s", _("Block Commit started"));
+        vshPrint(ctl, "%s", active ?
+                 _("Active Block Commit started") :
+                 _("Block Commit started"));
         ret = true;
         goto cleanup;
     }

Changed, ACKed and pushed.

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]