Example #1
0
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;

    unsigned cbflags = libxl__srm_callout_enumcallbacks_restore
        (&dcs->shs.callbacks.restore.a);

    const unsigned long argnums[] = {
        domid,
        state->store_port,
        state->store_domid, state->console_port,
        state->console_domid,
        hvm, pae, superpages, no_incr_generationid,
        cbflags, dcs->checkpointed_stream,
    };

    dcs->shs.ao = ao;
    dcs->shs.domid = domid;
    dcs->shs.recv_callback = libxl__srm_callout_received_restore;
    dcs->shs.completion_callback = libxl__xc_domain_restore_done;
    dcs->shs.caller_state = dcs;
    dcs->shs.need_results = 1;
    dcs->shs.toolstack_data_file = 0;

    run_helper(egc, &dcs->shs, "--restore-domain", restore_fd, 0,0,
               argnums, ARRAY_SIZE(argnums));
}
Example #2
0
void libxl__xc_domain_restore(libxl__egc *egc, libxl__domain_create_state *dcs,
                              libxl__save_helper_state *shs,
                              int hvm, int pae)
{
    STATE_AO_GC(dcs->ao);

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

    unsigned cbflags =
        libxl__srm_callout_enumcallbacks_restore(&shs->callbacks.restore.a);

    const unsigned long argnums[] = {
        domid,
        state->store_port,
        state->store_domid, state->console_port,
        state->console_domid,
        hvm, pae,
        cbflags, dcs->restore_params.checkpointed_stream,
    };

    shs->ao = ao;
    shs->domid = domid;
    shs->recv_callback = libxl__srm_callout_received_restore;
    if (dcs->restore_params.checkpointed_stream ==
        LIBXL_CHECKPOINTED_STREAM_COLO)
        shs->completion_callback = libxl__colo_restore_teardown;
    else
        shs->completion_callback = libxl__xc_domain_restore_done;
    shs->caller_state = dcs;
    shs->need_results = 1;

    run_helper(egc, shs, "--restore-domain", restore_fd, send_back_fd, 0, 0,
               argnums, ARRAY_SIZE(argnums));
}