Hello Mr Olaf,
I tried for change code xc_save.c to attention backported, But not answer me :-(...
Should I change code xc_domain_save.c ? in this code used function 'static int print_stats(...)' .
I attache file xend.log later use of Code changing xc_save.c:main:
int
main(int argc, char **argv)
{
unsigned int maxit, max_f, lflags; //Change, added lflags...
int io_fd, ret, port;
struct save_callbacks
callbacks;
xentoollog_level lvl;//added...
xentoollog_logger *l;//added...
if (argc != 6)
errx(1, "usage: %s iofd domid maxit maxf flags", argv[0]);
io_fd = atoi(argv[1]);
si.domid = atoi(argv[2]);
maxit = atoi(argv[3]);
max_f = atoi(argv[4]);
si.flags = atoi(argv[5]);
si.suspend_evtchn = -1;
lvl = si.flags & XCFLAGS_DEBUG ? XTL_DEBUG: XTL_DETAIL;//added...
lflags = XTL_STDIOSTREAM_SHOW_PID | XTL_STDIOSTREAM_HIDE_PROGRESS;//added...
l = (xentoollog_logger *)xtl_createlogger_stdiostream(stderr, lvl, lflags);//added...
si.xch = xc_interface_open(l,0,0);//Change, orginal: si.xch = xc_interface_open(0,0,0);
if (!si.xch)
errx(1, "failed to open control interface");
si.xce = xc_evtchn_open(NULL, 0);
if (si.xce == NULL)
warnx("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");
else
{
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, "
"using slow path");
}
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.suspend = suspend;
callbacks.switch_qemu_logdirty = switch_qemu_logdirty;
ret = xc_domain_save(si.xch, io_fd, si.domid, maxit, max_f, si.flags,
&callbacks, !!(si.flags & XCFLAGS_HVM));
//in code xen 4.3.1 added parametr vm_generationid_addr to xc_domain_save(...) but here don't need
if (si.suspend_evtchn > 0)
xc_suspend_evtchn_release(si.xch, si.xce, si.domid, si.suspend_evtchn);
if (si.xce > 0)
xc_evtchn_close(si.xce);
xc_interface_close(si.xch);
return ret;
}
Adel Amani
M.Sc. Candidate@Computer Engineering Department, University of Isfahan
Email: A.Amani@eng.ui.ac.ir
On Monday, February 3, 2014 4:41 PM, Olaf Hering <olaf@aepfle.de> wrote:
On Mon, Feb 03, Adel Amani wrote:
> Thanks, how i define logger for xc_interface_open to output print?!
See the example I gave in my reply. I quoted it again (see below) for
your convenience.
> can i use of code xc_save.c in xen 4.3.1 for logger in xen 4.1.2?!
If all required changes are backported, most likely yes.
Olaf
> For an example how a logger could look like see the xc_interface_open
> call in
tools/xenpaging/xenpaging.c.