[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] function snprintf() in xen_save_domain.c for debugged

  • To: Olaf Hering <olaf@xxxxxxxxx>, Xen <xen-devel@xxxxxxxxxxxxx>
  • From: Adel Amani <adel.amani66@xxxxxxxxx>
  • Date: Tue, 4 Feb 2014 22:50:40 -0800 (PST)
  • Delivery-date: Wed, 05 Feb 2014 07:59:38 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=KBSeHB5+g39/5gn75nihWdlckpMoa6HqpLursIV9pXaUe0bVj6ZayXds9wI835hscgIVg+y0ylZSPSm8+eYYw/hpiUKBdLhNcf1UKrEMQt8ZEwj+aZ08Rox1lAL5LgHZVpj1wuIBNHKASrDsspun0VI049ENCcs7/QNEtea4RKk=;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

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:

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...
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");
        port = xs_suspend_evtchn_port(si.domid);

        if (port < 0)
            warnx("failed to get the suspend evtchn port\n");
            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)


    return ret;
Adel Amani
M.Sc. Candidate@Computer Engineering Department, University of Isfahan
Email: A.Amani@xxxxxxxxxxxx

On Monday, February 3, 2014 4:41 PM, Olaf Hering <olaf@xxxxxxxxx> 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.


> For an example how a logger could look like see the xc_interface_open
> call in tools/xenpaging/xenpaging.c.

Attachment: xend.log
Description: Binary data

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.