Lines Matching refs:cds
36 libxl__checkpoint_devices_state *cds, in checkpoint_device_init() argument
42 STATE_AO_GC(cds->ao); in checkpoint_device_init()
46 dev->cds = cds; in checkpoint_device_init()
52 libxl__checkpoint_devices_state *cds);
55 libxl__checkpoint_devices_state *cds) in libxl__checkpoint_devices_setup() argument
59 STATE_AO_GC(cds->ao); in libxl__checkpoint_devices_setup()
61 cds->num_devices = 0; in libxl__checkpoint_devices_setup()
62 cds->num_nics = 0; in libxl__checkpoint_devices_setup()
63 cds->num_disks = 0; in libxl__checkpoint_devices_setup()
65 if (cds->device_kind_flags & (1 << LIBXL__DEVICE_KIND_VIF)) in libxl__checkpoint_devices_setup()
66 cds->nics = libxl__device_list(gc, &libxl__nic_devtype, cds->domid, in libxl__checkpoint_devices_setup()
67 &cds->num_nics); in libxl__checkpoint_devices_setup()
69 if (cds->device_kind_flags & (1 << LIBXL__DEVICE_KIND_VBD)) in libxl__checkpoint_devices_setup()
70 cds->disks = libxl__device_list(gc, &libxl__disk_devtype, cds->domid, in libxl__checkpoint_devices_setup()
71 &cds->num_disks); in libxl__checkpoint_devices_setup()
73 if (cds->num_nics == 0 && cds->num_disks == 0) in libxl__checkpoint_devices_setup()
76 GCNEW_ARRAY(cds->devs, cds->num_nics + cds->num_disks); in libxl__checkpoint_devices_setup()
78 for (i = 0; i < cds->num_nics; i++) { in libxl__checkpoint_devices_setup()
79 cds->devs[cds->num_devices++] = checkpoint_device_init(egc, cds, in libxl__checkpoint_devices_setup()
81 &cds->nics[i]); in libxl__checkpoint_devices_setup()
84 for (i = 0; i < cds->num_disks; i++) { in libxl__checkpoint_devices_setup()
85 cds->devs[cds->num_devices++] = checkpoint_device_init(egc, cds, in libxl__checkpoint_devices_setup()
87 &cds->disks[i]); in libxl__checkpoint_devices_setup()
90 checkpoint_devices_setup(egc, cds); in libxl__checkpoint_devices_setup()
95 cds->callback(egc, cds, 0); in libxl__checkpoint_devices_setup()
99 libxl__checkpoint_devices_state *cds) in checkpoint_devices_setup() argument
103 STATE_AO_GC(cds->ao); in checkpoint_devices_setup()
105 libxl__multidev_begin(ao, &cds->multidev); in checkpoint_devices_setup()
106 cds->multidev.callback = all_devices_setup_cb; in checkpoint_devices_setup()
107 for (i = 0; i < cds->num_devices; i++) { in checkpoint_devices_setup()
108 libxl__checkpoint_device *dev = cds->devs[i]; in checkpoint_devices_setup()
110 libxl__multidev_prepare_with_aodev(&cds->multidev, &dev->aodev); in checkpoint_devices_setup()
118 libxl__multidev_prepared(egc, &cds->multidev, rc); in checkpoint_devices_setup()
133 dev->ops = dev->cds->ops[++dev->ops_index]; in device_setup_iterate()
178 libxl__checkpoint_devices_state *const cds = in all_devices_setup_cb() local
179 CONTAINER_OF(multidev, *cds, multidev); in all_devices_setup_cb()
181 cds->callback(egc, cds, rc); in all_devices_setup_cb()
185 libxl__checkpoint_devices_state *cds) in libxl__checkpoint_devices_teardown() argument
190 STATE_AO_GC(cds->ao); in libxl__checkpoint_devices_teardown()
192 libxl__multidev_begin(ao, &cds->multidev); in libxl__checkpoint_devices_teardown()
193 cds->multidev.callback = devices_teardown_cb; in libxl__checkpoint_devices_teardown()
194 for (i = 0; i < cds->num_devices; i++) { in libxl__checkpoint_devices_teardown()
195 dev = cds->devs[i]; in libxl__checkpoint_devices_teardown()
199 libxl__multidev_prepare_with_aodev(&cds->multidev, &dev->aodev); in libxl__checkpoint_devices_teardown()
203 libxl__multidev_prepared(egc, &cds->multidev, 0); in libxl__checkpoint_devices_teardown()
213 libxl__checkpoint_devices_state *const cds = in devices_teardown_cb() local
214 CONTAINER_OF(multidev, *cds, multidev); in devices_teardown_cb()
217 libxl__device_list_free(&libxl__nic_devtype, cds->nics, cds->num_nics); in devices_teardown_cb()
218 cds->nics = NULL; in devices_teardown_cb()
219 cds->num_nics = 0; in devices_teardown_cb()
222 libxl__device_list_free(&libxl__disk_devtype, cds->disks, cds->num_disks); in devices_teardown_cb()
223 cds->disks = NULL; in devices_teardown_cb()
224 cds->num_disks = 0; in devices_teardown_cb()
226 cds->callback(egc, cds, rc); in devices_teardown_cb()
241 libxl__checkpoint_devices_state *cds) \
246 STATE_AO_GC(cds->ao); \
248 libxl__multidev_begin(ao, &cds->multidev); \
249 cds->multidev.callback = devices_checkpoint_cb; \
250 for (i = 0; i < cds->num_devices; i++) { \
251 dev = cds->devs[i]; \
254 libxl__multidev_prepare_with_aodev(&cds->multidev, &dev->aodev);\
258 libxl__multidev_prepared(egc, &cds->multidev, 0); \
274 libxl__checkpoint_devices_state *const cds = in devices_checkpoint_cb() local
275 CONTAINER_OF(multidev, *cds, multidev); in devices_checkpoint_cb()
277 cds->callback(egc, cds, rc); in devices_checkpoint_cb()