aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xtl_logger_stdio.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:38:56 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-28 09:38:56 +0100
commit455a17fea9f9a5d1a4fa7adbc63a2e8cd5d81d4a (patch)
tree91597d3179a174869dc8391c700c893ebab2de34 /tools/libxc/xtl_logger_stdio.c
parenta2b5973ee0d143545a62903c629f800dc25f2837 (diff)
downloadxen-455a17fea9f9a5d1a4fa7adbc63a2e8cd5d81d4a.tar.gz
xen-455a17fea9f9a5d1a4fa7adbc63a2e8cd5d81d4a.tar.bz2
xen-455a17fea9f9a5d1a4fa7adbc63a2e8cd5d81d4a.zip
xl/libxtl: Remove glitch in xl migrate log output
* Provide a new XTL_STDIOSTREAM_HIDE_PROGRESS flag in the stdio logger * Provide a way to adjust the flags after logger setup * Use these to disable progress output from the migration receiver, as the sender is also sending progress information. 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.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/libxc/xtl_logger_stdio.c b/tools/libxc/xtl_logger_stdio.c
index abe274ab08..1bfa9a9ea4 100644
--- a/tools/libxc/xtl_logger_stdio.c
+++ b/tools/libxc/xtl_logger_stdio.c
@@ -75,6 +75,9 @@ static void stdiostream_progress(struct xentoollog_logger *logger_in,
int newpel, extra_erase;
xentoollog_level this_level;
+ if (!(lg->flags & XTL_STDIOSTREAM_HIDE_PROGRESS))
+ return;
+
if (percent < lg->progress_last_percent) {
this_level = XTL_PROGRESS;
} else if (percent == lg->progress_last_percent) {
@@ -108,6 +111,18 @@ static void stdiostream_destroy(struct xentoollog_logger *logger_in) {
free(lg);
}
+void xtl_stdiostream_set_minlevel(xentoollog_logger_stdiostream *lg,
+ xentoollog_level min_level) {
+ lg->min_level = min_level;
+}
+
+void xtl_stdiostream_adjust_flags(xentoollog_logger_stdiostream *lg,
+ unsigned set_flags, unsigned clear_flags) {
+ unsigned new_flags = (lg->flags & ~clear_flags) | set_flags;
+ if (new_flags & XTL_STDIOSTREAM_HIDE_PROGRESS)
+ progress_erase(lg);
+ lg->flags = new_flags;
+}
xentoollog_logger_stdiostream *xtl_createlogger_stdiostream
(FILE *f, xentoollog_level min_level, unsigned flags) {