diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-09-03 18:41:37 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2010-09-03 18:41:37 +0100 |
commit | 87de0ad2c8062da242fb51a23e70375c1d9624be (patch) | |
tree | ae8e06bffd476e5749abe9979cc412087b89feae /tools/libxc/xtl_logger_stdio.c | |
parent | 59e3c6a2c6cae1d50ec39ef334c8ab346da1c3b9 (diff) | |
download | xen-87de0ad2c8062da242fb51a23e70375c1d9624be.tar.gz xen-87de0ad2c8062da242fb51a23e70375c1d9624be.tar.bz2 xen-87de0ad2c8062da242fb51a23e70375c1d9624be.zip |
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@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xtl_logger_stdio.c')
-rw-r--r-- | tools/libxc/xtl_logger_stdio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/libxc/xtl_logger_stdio.c b/tools/libxc/xtl_logger_stdio.c index de0935ac47..3edf0a2fd7 100644 --- a/tools/libxc/xtl_logger_stdio.c +++ b/tools/libxc/xtl_logger_stdio.c @@ -108,9 +108,12 @@ static void stdiostream_progress(struct xentoollog_logger *logger_in, 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) |