From e6c9172170e03c7af5016aed8fd44033c8e54164 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Fri, 15 Feb 2013 13:32:13 +0000 Subject: tools/xc: log pid in xc_save/xc_restore output If several migrations log their output to xend.log its not clear which line belongs to a which guest. Print entry/exit of xc_save and xc_restore and also request to print pid with each log call. Signed-off-by: Olaf Hering Acked-by: Ian Campbell Committed-by: Ian Campbell --- tools/xcutils/xc_restore.c | 9 +++++++-- tools/xcutils/xc_save.c | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'tools/xcutils') diff --git a/tools/xcutils/xc_restore.c b/tools/xcutils/xc_restore.c index 0235579622..35d725c6cb 100644 --- a/tools/xcutils/xc_restore.c +++ b/tools/xcutils/xc_restore.c @@ -19,17 +19,22 @@ int main(int argc, char **argv) { unsigned int domid, store_evtchn, console_evtchn; - unsigned int hvm, pae, apic; + unsigned int hvm, pae, apic, lflags; xc_interface *xch; int io_fd, ret; int superpages; unsigned long store_mfn, console_mfn; + xentoollog_level lvl; + xentoollog_logger *l; if ( (argc != 8) && (argc != 9) ) errx(1, "usage: %s iofd domid store_evtchn " "console_evtchn hvm pae apic [superpages]", argv[0]); - xch = xc_interface_open(0,0,0); + lvl = XTL_DETAIL; + lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS; + l = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, lvl, lflags); + xch = xc_interface_open(l, 0, 0); if ( !xch ) errx(1, "failed to open control interface"); diff --git a/tools/xcutils/xc_save.c b/tools/xcutils/xc_save.c index 0131f2a257..e34bd2c854 100644 --- a/tools/xcutils/xc_save.c +++ b/tools/xcutils/xc_save.c @@ -184,7 +184,7 @@ main(int argc, char **argv) si.suspend_evtchn = -1; lvl = si.flags & XCFLAGS_DEBUG ? XTL_DEBUG: XTL_DETAIL; - lflags = XTL_STDIOSTREAM_HIDE_PROGRESS; + lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS; l = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, lvl, lflags); si.xch = xc_interface_open(l, 0, 0); if (!si.xch) -- cgit v1.2.3