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

[Xen-devel] Question regarding suspend in libxc

  • To: xen-devel@xxxxxxxxxxxxx
  • From: soyer yoo <soyer.yoo@xxxxxxxxx>
  • Date: Fri, 10 May 2013 18:05:45 +0900
  • Delivery-date: Fri, 10 May 2013 09:06:08 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Hi all,

I was reading source code around saving and restoring domains, and I found the following function in _libxl_save_msgs_helper.c, which looks like causing seg fault.

int helper_stub_suspend(void *user)
    unsigned char *buf = 0;
    int len = 0, allocd = 0;
    for (;;) {
        uint16_t_put(buf, &len, 3 /* suspend */);
        if (buf) break;
        buf = helper_allocbuf(len, user);
        allocd = len;
        len = 0;
    assert(len == allocd);
    helper_transmitmsg(buf, len, user);
    int r = helper_getreply(user);
    return r;

Here, buf is null, and inside the for loop it tries to write '3' into buf, which will cause seg fault.
Is it intended for suspending domain or am I misunderstanding?
Also, could you tell me what does '3' do for suspending domain.

On more question:

helper_transmitmsg in the above writes the 'buf' to file descriptor 1 (i.e., /dev/tty1).
I have idea what is going on here, and could anybody please enlighten me?

Xen-devel mailing list



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