Lines Matching refs:dcs

944                                         libxl__domain_create_state *dcs);
956 libxl__domain_create_state *dcs,
972 libxl__domain_create_state *dcs,
1212 libxl__domain_create_state *dcs) in initiate_domain_create() argument
1214 STATE_AO_GC(dcs->ao); in initiate_domain_create()
1219 libxl_domain_config *const d_config = dcs->guest_config; in initiate_domain_create()
1220 libxl__domain_build_state *dbs = &dcs->build_state; in initiate_domain_create()
1222 libxl__xswait_init(&dcs->console_xswait); in initiate_domain_create()
1224 domid = dcs->domid; in initiate_domain_create()
1226 dbs->restore = dcs->restore_fd >= 0; in initiate_domain_create()
1231 ret = libxl__domain_make(gc, d_config, dbs, &domid, dcs->soft_reset); in initiate_domain_create()
1234 dcs->guest_domid = domid; in initiate_domain_create()
1239 dcs->guest_domid = domid; in initiate_domain_create()
1240 dcs->sdss.dm.guest_domid = 0; /* means we haven't spawned */ in initiate_domain_create()
1260 dcs->bl.ao = ao; in initiate_domain_create()
1275 if (dbs->restore || dcs->soft_reset) { in initiate_domain_create()
1277 domcreate_bootloader_done(egc, &dcs->bl, 0); in initiate_domain_create()
1280 dcs->bl.callback = domcreate_bootloader_done; in initiate_domain_create()
1281 dcs->bl.console_available = domcreate_bootloader_console_available; in initiate_domain_create()
1282 dcs->bl.info = &d_config->b_info; in initiate_domain_create()
1283 dcs->bl.disk = bootdisk; in initiate_domain_create()
1284 dcs->bl.domid = dcs->guest_domid; in initiate_domain_create()
1286 dcs->bl.kernel = &dbs->pv_kernel; in initiate_domain_create()
1287 dcs->bl.ramdisk = &dbs->pv_ramdisk; in initiate_domain_create()
1289 libxl__bootloader_run(egc, &dcs->bl); in initiate_domain_create()
1295 domcreate_complete(egc, dcs, ret); in initiate_domain_create()
1301 libxl__domain_create_state *dcs = CONTAINER_OF(bl, *dcs, bl); in domcreate_bootloader_console_available() local
1303 domcreate_console_available(egc, dcs); in domcreate_bootloader_console_available()
1307 libxl__domain_create_state *dcs) { in domcreate_console_available() argument
1308 libxl__ao_progress_report(egc, dcs->ao, &dcs->aop_console_how, in domcreate_console_available()
1310 dcs->guest_domid, in domcreate_console_available()
1311 dcs->aop_console_how.for_event)); in domcreate_console_available()
1318 libxl__domain_create_state *dcs = CONTAINER_OF(bl, *dcs, bl); in domcreate_bootloader_done() local
1322 const uint32_t domid = dcs->guest_domid; in domcreate_bootloader_done()
1323 libxl_domain_config *const d_config = dcs->guest_config; in domcreate_bootloader_done()
1324 const int restore_fd = dcs->restore_fd; in domcreate_bootloader_done()
1325 libxl__domain_build_state *const state = &dcs->build_state; in domcreate_bootloader_done()
1326 const int checkpointed_stream = dcs->restore_params.checkpointed_stream; in domcreate_bootloader_done()
1327 libxl__colo_restore_state *const crs = &dcs->crs; in domcreate_bootloader_done()
1330 &dcs->srs.shs.callbacks.restore.a; in domcreate_bootloader_done()
1333 domcreate_rebuild_done(egc, dcs, rc); in domcreate_bootloader_done()
1345 dcs->sdss.dm.spawn.ao = ao; in domcreate_bootloader_done()
1346 dcs->sdss.dm.guest_config = dcs->guest_config; in domcreate_bootloader_done()
1347 dcs->sdss.dm.build_state = &dcs->build_state; in domcreate_bootloader_done()
1348 dcs->sdss.dm.callback = domcreate_devmodel_started; in domcreate_bootloader_done()
1349 dcs->sdss.callback = domcreate_devmodel_started; in domcreate_bootloader_done()
1351 if (restore_fd < 0 && !dcs->soft_reset) { in domcreate_bootloader_done()
1353 domcreate_rebuild_done(egc, dcs, rc); in domcreate_bootloader_done()
1358 dcs->srs.dcs = dcs; in domcreate_bootloader_done()
1383 dcs->srs.ao = ao; in domcreate_bootloader_done()
1384 dcs->srs.fd = restore_fd; in domcreate_bootloader_done()
1385 dcs->srs.legacy = (dcs->restore_params.stream_version == 1); in domcreate_bootloader_done()
1386 dcs->srs.back_channel = false; in domcreate_bootloader_done()
1387 dcs->srs.completion_callback = domcreate_stream_done; in domcreate_bootloader_done()
1395 crs->send_back_fd = dcs->send_back_fd; in domcreate_bootloader_done()
1402 libxl__remus_restore_setup(egc, dcs); in domcreate_bootloader_done()
1405 libxl__stream_read_start(egc, &dcs->srs); in domcreate_bootloader_done()
1411 domcreate_stream_done(egc, &dcs->srs, rc); in domcreate_bootloader_done()
1418 libxl__domain_create_state *dcs = CONTAINER_OF(crs, *dcs, crs); in libxl__colo_restore_setup_done() local
1423 LOGD(ERROR, dcs->guest_domid, "colo restore setup fails: %d", rc); in libxl__colo_restore_setup_done()
1424 domcreate_stream_done(egc, &dcs->srs, rc); in libxl__colo_restore_setup_done()
1428 libxl__stream_read_start(egc, &dcs->srs); in libxl__colo_restore_setup_done()
1435 libxl__domain_create_state *dcs = shs->caller_state; in libxl__srm_callout_callback_static_data_done() local
1436 STATE_AO_GC(dcs->ao); in libxl__srm_callout_callback_static_data_done()
1439 libxl_domain_config *d_config = dcs->guest_config; in libxl__srm_callout_callback_static_data_done()
1450 libxl__cpuid_legacy(ctx, dcs->guest_domid, true, info); in libxl__srm_callout_callback_static_data_done()
1459 libxl__domain_create_state *dcs = shs->caller_state; in libxl__srm_callout_callback_restore_results() local
1460 STATE_AO_GC(dcs->ao); in libxl__srm_callout_callback_restore_results()
1461 libxl__domain_build_state *const state = &dcs->build_state; in libxl__srm_callout_callback_restore_results()
1474 libxl__domain_create_state *dcs = srs->dcs; in domcreate_stream_done() local
1475 STATE_AO_GC(dcs->ao); in domcreate_stream_done()
1482 const uint32_t domid = dcs->guest_domid; in domcreate_stream_done()
1483 libxl_domain_config *const d_config = dcs->guest_config; in domcreate_stream_done()
1485 libxl__domain_build_state *const state = &dcs->build_state; in domcreate_stream_done()
1486 const int fd = dcs->restore_fd; in domcreate_stream_done()
1562 domcreate_rebuild_done(egc, dcs, ret); in domcreate_stream_done()
1566 libxl__domain_create_state *dcs, in domcreate_rebuild_done() argument
1569 STATE_AO_GC(dcs->ao); in domcreate_rebuild_done()
1572 const uint32_t domid = dcs->guest_domid; in domcreate_rebuild_done()
1573 libxl_domain_config *const d_config = dcs->guest_config; in domcreate_rebuild_done()
1583 libxl__multidev_begin(ao, &dcs->multidev); in domcreate_rebuild_done()
1584 dcs->multidev.callback = domcreate_launch_dm; in domcreate_rebuild_done()
1585 libxl__add_disks(egc, ao, domid, d_config, &dcs->multidev); in domcreate_rebuild_done()
1586 libxl__multidev_prepared(egc, &dcs->multidev, 0); in domcreate_rebuild_done()
1592 domcreate_complete(egc, dcs, ret); in domcreate_rebuild_done()
1598 libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev); in domcreate_launch_dm() local
1599 STATE_AO_GC(dcs->ao); in domcreate_launch_dm()
1603 const uint32_t domid = dcs->guest_domid; in domcreate_launch_dm()
1604 libxl_domain_config *const d_config = dcs->guest_config; in domcreate_launch_dm()
1605 libxl__domain_build_state *const state = &dcs->build_state; in domcreate_launch_dm()
1711 dcs->sdss.dm.guest_domid = domid; in domcreate_launch_dm()
1713 libxl__spawn_stub_dm(egc, &dcs->sdss); in domcreate_launch_dm()
1715 libxl__spawn_local_dm(egc, &dcs->sdss.dm); in domcreate_launch_dm()
1759 dcs->sdss.dm.guest_domid = domid; in domcreate_launch_dm()
1760 libxl__spawn_local_dm(egc, &dcs->sdss.dm); in domcreate_launch_dm()
1763 assert(!dcs->sdss.dm.guest_domid); in domcreate_launch_dm()
1764 domcreate_devmodel_started(egc, &dcs->sdss.dm, 0); in domcreate_launch_dm()
1776 domcreate_complete(egc, dcs, ret); in domcreate_launch_dm()
1827 libxl__domain_create_state *dcs = CONTAINER_OF(dmss, *dcs, sdss.dm); in domcreate_devmodel_started() local
1829 int domid = dcs->guest_domid; in domcreate_devmodel_started()
1836 dcs->device_type_idx = -1; in domcreate_devmodel_started()
1837 domcreate_attach_devices(egc, &dcs->multidev, 0); in domcreate_devmodel_started()
1842 domcreate_complete(egc, dcs, ret); in domcreate_devmodel_started()
1849 libxl__domain_create_state *dcs = CONTAINER_OF(multidev, *dcs, multidev); in domcreate_attach_devices() local
1850 STATE_AO_GC(dcs->ao); in domcreate_attach_devices()
1851 int domid = dcs->guest_domid; in domcreate_attach_devices()
1852 libxl_domain_config *const d_config = dcs->guest_config; in domcreate_attach_devices()
1858 libxl__device_kind_to_string(device_type_tbl[dcs->device_type_idx]->type)); in domcreate_attach_devices()
1862 dcs->device_type_idx++; in domcreate_attach_devices()
1863 dt = device_type_tbl[dcs->device_type_idx]; in domcreate_attach_devices()
1867 libxl__multidev_begin(ao, &dcs->multidev); in domcreate_attach_devices()
1868 dcs->multidev.callback = domcreate_attach_devices; in domcreate_attach_devices()
1869 dt->add(egc, ao, domid, d_config, &dcs->multidev); in domcreate_attach_devices()
1870 libxl__multidev_prepared(egc, &dcs->multidev, 0); in domcreate_attach_devices()
1874 domcreate_attach_devices(egc, &dcs->multidev, 0); in domcreate_attach_devices()
1885 dcs->console_xswait.ao = ao; in domcreate_attach_devices()
1886 dcs->console_xswait.what = GCSPRINTF("domain %d console tty", domid); in domcreate_attach_devices()
1887 dcs->console_xswait.path = tty_path; in domcreate_attach_devices()
1888 dcs->console_xswait.timeout_ms = LIBXL_INIT_TIMEOUT * 1000; in domcreate_attach_devices()
1889 dcs->console_xswait.callback = console_xswait_callback; in domcreate_attach_devices()
1890 ret = libxl__xswait_start(gc, &dcs->console_xswait); in domcreate_attach_devices()
1901 domcreate_complete(egc, dcs, ret); in domcreate_attach_devices()
1908 libxl__domain_create_state *dcs = CONTAINER_OF(xswa, *dcs, console_xswait); in console_xswait_callback() local
1917 domcreate_console_available(egc, dcs); in console_xswait_callback()
1925 domcreate_complete(egc, dcs, rc); in console_xswait_callback()
1929 libxl__domain_create_state *dcs, in domcreate_complete() argument
1932 STATE_AO_GC(dcs->ao); in domcreate_complete()
1933 libxl_domain_config *const d_config = dcs->guest_config; in domcreate_complete()
1934 libxl_domain_config *d_config_saved = &dcs->guest_config_saved; in domcreate_complete()
1936 libxl__xswait_stop(gc, &dcs->console_xswait); in domcreate_complete()
1938 libxl__domain_build_state_dispose(&dcs->build_state); in domcreate_complete()
1941 rc = xc_flask_relabel_domain(CTX->xch, dcs->guest_domid, d_config->b_info.exec_ssidref); in domcreate_complete()
1951 lock = libxl__lock_domain_userdata(gc, dcs->guest_domid); in domcreate_complete()
1957 (gc, dcs->guest_domid, d_config_saved); in domcreate_complete()
1967 if (dcs->guest_domid > 0) { in domcreate_complete()
1968 dcs->dds.ao = ao; in domcreate_complete()
1969 dcs->dds.domid = dcs->guest_domid; in domcreate_complete()
1970 dcs->dds.callback = domcreate_destruction_cb; in domcreate_complete()
1971 libxl__domain_destroy(egc, &dcs->dds); in domcreate_complete()
1974 dcs->guest_domid = INVALID_DOMID; in domcreate_complete()
1976 dcs->callback(egc, dcs, rc, dcs->guest_domid); in domcreate_complete()
1984 libxl__domain_create_state *dcs = CONTAINER_OF(dds, *dcs, dds); in domcreate_destruction_cb() local
1989 dcs->callback(egc, dcs, ERROR_FAIL, dcs->guest_domid); in domcreate_destruction_cb()
1995 libxl__domain_create_state dcs; member
2008 libxl__domain_create_state *dcs,
2022 cdcs->dcs.ao = ao; in do_domain_create()
2023 cdcs->dcs.guest_config = d_config; in do_domain_create()
2024 libxl_domain_config_init(&cdcs->dcs.guest_config_saved); in do_domain_create()
2025 libxl_domain_config_copy(ctx, &cdcs->dcs.guest_config_saved, d_config); in do_domain_create()
2026 cdcs->dcs.restore_fd = cdcs->dcs.libxc_fd = restore_fd; in do_domain_create()
2027 cdcs->dcs.send_back_fd = send_back_fd; in do_domain_create()
2029 cdcs->dcs.restore_params = *params; in do_domain_create()
2030 rc = libxl__fd_flags_modify_save(gc, cdcs->dcs.restore_fd, in do_domain_create()
2032 &cdcs->dcs.restore_fdfl); in do_domain_create()
2035 cdcs->dcs.callback = domain_create_cb; in do_domain_create()
2036 cdcs->dcs.domid = INVALID_DOMID; in do_domain_create()
2037 cdcs->dcs.soft_reset = false; in do_domain_create()
2039 if (cdcs->dcs.restore_params.checkpointed_stream == in do_domain_create()
2041 cdcs->dcs.colo_proxy_script = in do_domain_create()
2042 cdcs->dcs.restore_params.colo_proxy_script; in do_domain_create()
2043 cdcs->dcs.crs.cps.is_userspace_proxy = in do_domain_create()
2044 libxl_defbool_val(cdcs->dcs.restore_params.userspace_colo_proxy); in do_domain_create()
2046 cdcs->dcs.colo_proxy_script = NULL; in do_domain_create()
2047 cdcs->dcs.crs.cps.is_userspace_proxy = false; in do_domain_create()
2050 libxl__ao_progress_gethow(&cdcs->dcs.aop_console_how, aop_console_how); in do_domain_create()
2053 initiate_domain_create(egc, &cdcs->dcs); in do_domain_create()
2076 cdcs->dcs.guest_domid = dds->domid; in domain_soft_reset_cb()
2077 rc = libxl__restore_emulator_xenstore_data(&cdcs->dcs, srs->toolstack_buf, in domain_soft_reset_cb()
2084 if (cdcs->dcs.guest_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) { in domain_soft_reset_cb()
2095 initiate_domain_create(egc, &cdcs->dcs); in domain_soft_reset_cb()
2099 domcreate_complete(egc, &cdcs->dcs, rc); in domain_soft_reset_cb()
2115 libxl__domain_create_state *dcs; in do_domain_soft_reset() local
2125 dcs = &cdcs->dcs; in do_domain_soft_reset()
2126 state = &dcs->build_state; in do_domain_soft_reset()
2129 srs->cdcs.dcs.ao = ao; in do_domain_soft_reset()
2130 srs->cdcs.dcs.guest_config = d_config; in do_domain_soft_reset()
2131 libxl_domain_config_init(&srs->cdcs.dcs.guest_config_saved); in do_domain_soft_reset()
2132 libxl_domain_config_copy(ctx, &srs->cdcs.dcs.guest_config_saved, in do_domain_soft_reset()
2134 cdcs->dcs.restore_fd = -1; in do_domain_soft_reset()
2135 cdcs->dcs.domid = domid; in do_domain_soft_reset()
2136 cdcs->dcs.soft_reset = true; in do_domain_soft_reset()
2137 cdcs->dcs.callback = domain_create_cb; in do_domain_soft_reset()
2138 libxl__ao_progress_gethow(&srs->cdcs.dcs.aop_console_how, in do_domain_soft_reset()
2213 xs_release_domain(CTX->xsh, cdcs->dcs.domid); in soft_reset_dm_suspended()
2216 srs->dds.domid = cdcs->dcs.domid; in soft_reset_dm_suspended()
2223 libxl__domain_create_state *dcs, in domain_create_cb() argument
2226 libxl__app_domain_create_state *cdcs = CONTAINER_OF(dcs, *cdcs, dcs); in domain_create_cb()
2228 STATE_AO_GC(cdcs->dcs.ao); in domain_create_cb()
2232 if (dcs->restore_fd >= 0) { in domain_create_cb()
2234 dcs->restore_fd, dcs->restore_fdfl); in domain_create_cb()