WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxc: logger: add newline when progress

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxc: logger: add newline when progress is complete
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Sep 2010 14:40:15 -0700
Delivery-date: Fri, 10 Sep 2010 14:40:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1283535697 -3600
# Node ID 30c74192c3613e90a715c729fd0087ac8f361f71
# Parent  9aa2e9cc1b24bc516dcff13181dc4bd2d9e51922
libxc: logger: add newline when progress is complete

In xc_domain_save ensure that we signal completion at the end of each
batch.

This ensures that the next logged line starts on a new line. e.g. instead of:
     Savefile contains xl domain config
    xc: Saving memory: iter 3 (last sent 0 skipped 0): 0/32768    0%migration 
target: Transfer complete, requesting permission to start domain.
    migration sender: Target has acknowledged transfer.
what is desired is:
     Savefile contains xl domain config
    xc: Saving memory: iter 0 (last sent 0 skipped 0): 32768/32768  100%
    xc: Saving memory: iter 1 (last sent 32576 skipped 192): 32768/32768  100%
    xc: Saving memory: iter 2 (last sent 217 skipped 0): 32768/32768  100%
    xc: Saving memory: iter 3 (last sent 0 skipped 0): 32768/32768  100%
    migration target: Transfer complete, requesting permission to start domain.
    migration sender: Target has acknowledged transfer.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxc/xc_domain_save.c   |    2 ++
 tools/libxc/xtl_logger_stdio.c |    7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff -r 9aa2e9cc1b24 -r 30c74192c361 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Fri Sep 03 18:38:11 2010 +0100
+++ b/tools/libxc/xc_domain_save.c      Fri Sep 03 18:41:37 2010 +0100
@@ -1461,6 +1461,8 @@ int xc_domain_save(xc_interface *xch, in
 
       skip:
 
+        xc_report_progress_step(xch, dinfo->p2m_size, dinfo->p2m_size);
+
         total_sent += sent_this_iter;
 
         if ( last_iter )
diff -r 9aa2e9cc1b24 -r 30c74192c361 tools/libxc/xtl_logger_stdio.c
--- a/tools/libxc/xtl_logger_stdio.c    Fri Sep 03 18:38:11 2010 +0100
+++ b/tools/libxc/xtl_logger_stdio.c    Fri Sep 03 18:41:37 2010 +0100
@@ -108,9 +108,12 @@ static void stdiostream_progress(struct 
     if (lg->progress_erase_len)
         putc('\r', lg->f);
 
-    newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%",
+    lg->progress_last_percent = percent;
+
+    newpel = fprintf(lg->f, "%s%s" "%s: %lu/%lu  %3d%%%s",
                      context?context:"", context?": ":"",
-                     doing_what, done, total, percent);
+                     doing_what, done, total, percent,
+                    done == total ? "\n" : "");
 
     extra_erase = lg->progress_erase_len - newpel;
     if (extra_erase > 0)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxc: logger: add newline when progress is complete, Xen patchbot-unstable <=