aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_save_callout.c
blob: 2f8db9f0b68462db1f9f91fa428fba953f8fcae9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright (C) 2012      Citrix Ltd.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation; version 2.1 only. with the special
 * exception on linking described in file LICENSE.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 */

#include "libxl_osdeps.h"

#include "libxl_internal.h"

void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs,
                              int hvm, int pae, int superpages,
                              int no_incr_generationid)
{
    STATE_AO_GC(dcs->ao);

    /* Convenience aliases */
    const uint32_t domid = dcs->guest_domid;
    const int restore_fd = dcs->restore_fd;
    libxl__domain_build_state *const state = &dcs->build_state;

    int r = xc_domain_restore(CTX->xch, restore_fd, domid,
                              state->store_port, &state->store_mfn,
                              state->store_domid, state->console_port,
                              &state->console_mfn, state->console_domid,
                              hvm, pae, superpages, no_incr_generationid,
                              &state->vm_generationid_addr, &dcs->callbacks);
    libxl__xc_domain_restore_done(egc, dcs, 0, r, errno);
}