tools/xc: print messages from xc_save with xc_report
PATCH 1/1 tools/xc: print messages from xc_save with xc_report
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1360958742 -3600
# Node ID 83a05c99299d60197fbb7eac219054b371d61eff # Parent 6ff99ddc4c41af31863393cd2239bc03fb63642c tools/xc: print messages from xc_save with xc_report
Make use of xc_report in xc_save to log also pid if some error occoured. Rework code in switch_qemu_logdirty, fix memleak.
Signed-off-by Olaf Hering <[email protected]>
tools/libxc/xc_private.h +1 -0
@@ -119,6 +119,7 @@ void xc_report_progress_step(xc_interfac/* anamorphic macros: struct xc_interface *xch must be in scope */ +#define WPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_WARN,0, _f , ## _a) #define IPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_INFO,0, _f , ## _a) #define DPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_DETAIL,0, _f , ## _a) #define DBGPRINTF(_f, _a...) xc_report(xch, xch->error_handler, XTL_DEBUG,0, _f , ## _a)
tools/xcutils/xc_restore.c +1 -0
@@ -56,6 +56,7 @@ main(int argc, char **argv)if ( ret ==0 ) { +/* xend expects this output, part of protocol */ printf ("store-mfn %li\n" , store_mfn);if ( !hvm )printf ("console-mfn %li\n" , console_mfn);
tools/xcutils/xc_save.c +54 -45
175 lines not on this page · raw message
Quoted 13 lines · Olaf Hering
+++
b/tools/xcutils/xc_save.csi.xce = xc_evtchn_open(NULL, 0); if (si.xce == NULL)tools/xcutils/xc_save.c +2
-2-warnx ("failed to open event channel handle" ); +WPRINTF ("failed to open event channel handle" ); else { port =xs_suspend_evtchn_port (si.domid);if (port <0 ) -warnx ("failed to get the suspend evtchn port\n" ); +WPRINTF ("failed to get the suspend evtchn port\n" );
tools/xcutils/xc_save.c main(int argc, char **argv) · line 219
Quoted 10 lines
tools/xcutils/xc_save.c +1
-1else { si.suspend_evtchn =xc_suspend_evtchn_init (si.xch, si.xce, si.domid, port);if (si.suspend_evtchn <0 ) -warnx ("suspend event channel initialization failed, " +WPRINTF ("suspend event channel initialization failed, " "using slow path" ); }
Is this path well tested, or should these three be fatal errors?
Olaf