[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libxl/save-helper: Code motion of logging functions
commit dd7317a4a24d764d31caf6bc87060b399bfd5648 Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> AuthorDate: Fri Apr 11 16:46:13 2014 +0100 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Wed Apr 16 17:07:52 2014 +0100 libxl/save-helper: Code motion of logging functions ... in preparation for a subsequent functional fix Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx> --- tools/libxl/libxl_save_helper.c | 58 +++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c index 880565e..d6fa5dd 100644 --- a/tools/libxl/libxl_save_helper.c +++ b/tools/libxl/libxl_save_helper.c @@ -47,6 +47,35 @@ #include "xenguest.h" #include "_libxl_save_msgs_helper.h" +/*----- logger -----*/ + +static void tellparent_vmessage(xentoollog_logger *logger_in, + xentoollog_level level, + int errnoval, + const char *context, + const char *format, + va_list al) +{ + char *formatted; + int r = vasprintf(&formatted, format, al); + if (r < 0) { perror("memory allocation failed during logging"); exit(-1); } + helper_stub_log(level, errnoval, context, formatted, 0); + free(formatted); +} + +static void tellparent_progress(struct xentoollog_logger *logger_in, + const char *context, + const char *doing_what, int percent, + unsigned long done, unsigned long total) +{ + helper_stub_progress(context, doing_what, done, total, 0); +} + +static void tellparent_destroy(struct xentoollog_logger *logger_in) +{ + abort(); +} + /*----- globals -----*/ static const char *program = "libxl-save-helper"; @@ -86,39 +115,10 @@ static void *xmalloc(size_t sz) return r; } -/*----- logger -----*/ - typedef struct { xentoollog_logger vtable; } xentoollog_logger_tellparent; -static void tellparent_vmessage(xentoollog_logger *logger_in, - xentoollog_level level, - int errnoval, - const char *context, - const char *format, - va_list al) -{ - char *formatted; - int r = vasprintf(&formatted, format, al); - if (r < 0) { perror("memory allocation failed during logging"); exit(-1); } - helper_stub_log(level, errnoval, context, formatted, 0); - free(formatted); -} - -static void tellparent_progress(struct xentoollog_logger *logger_in, - const char *context, - const char *doing_what, int percent, - unsigned long done, unsigned long total) -{ - helper_stub_progress(context, doing_what, done, total, 0); -} - -static void tellparent_destroy(struct xentoollog_logger *logger_in) -{ - abort(); -} - static xentoollog_logger_tellparent *createlogger_tellparent(void) { xentoollog_logger_tellparent newlogger; -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |