diff options
author | Ian Jackson <ian.jackson@eu.citrix.com> | 2012-05-11 18:59:01 +0100 |
---|---|---|
committer | Ian Jackson <ian.jackson@eu.citrix.com> | 2012-05-11 18:59:01 +0100 |
commit | 5ff68cd59c8c817490f17ea0bd61466c2b5b03d8 (patch) | |
tree | 16f5600bc0bf32ee57dcf8858cc13d40397254a7 /tools/libxl/libxl_aoutils.c | |
parent | f14122b5d7eb4c4ef1611252b806ab8e0f4334cb (diff) | |
download | xen-5ff68cd59c8c817490f17ea0bd61466c2b5b03d8.tar.gz xen-5ff68cd59c8c817490f17ea0bd61466c2b5b03d8.tar.bz2 xen-5ff68cd59c8c817490f17ea0bd61466c2b5b03d8.zip |
libxl: log bootloader output
This involves adding a new log feature to libxl__datacopier, and then
using it.
If the bootloader exits nonzero we print the log filename in a log
message from libxl.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_aoutils.c')
-rw-r--r-- | tools/libxl/libxl_aoutils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c index 734a5dc29c..91e34dea95 100644 --- a/tools/libxl/libxl_aoutils.c +++ b/tools/libxl/libxl_aoutils.c @@ -118,6 +118,16 @@ static void datacopier_readable(libxl__egc *egc, libxl__ev_fd *ev, libxl__ev_fd_deregister(gc, &dc->toread); break; } + if (dc->log) { + int wrote = fwrite(buf->buf + buf->used, 1, r, dc->log); + if (wrote != r) { + assert(ferror(dc->log)); + assert(errno); + LOGE(ERROR, "error logging %s", dc->copywhat); + datacopier_callback(egc, dc, 0, errno); + return; + } + } buf->used += r; dc->used += r; assert(buf->used <= sizeof(buf->buf)); |