{
int rc;
- rc = libxl__ev_time_register_rel(gc, &xswa->time_ev,
+ rc = libxl__ev_time_register_rel(xswa->ao, &xswa->time_ev,
xswait_timeout_callback, xswa->timeout_ms);
if (rc) goto err;
libxl__ev_child_init(&aes->child);
}
-int libxl__async_exec_start(libxl__gc *gc, libxl__async_exec_state *aes)
+int libxl__async_exec_start(libxl__async_exec_state *aes)
{
pid_t pid;
/* Convenience aliases */
+ libxl__ao *ao = aes->ao;
+ AO_GC;
libxl__ev_child *const child = &aes->child;
char ** const args = aes->args;
/* Set execution timeout */
- if (libxl__ev_time_register_rel(gc, &aes->time,
+ if (libxl__ev_time_register_rel(ao, &aes->time,
async_exec_timeout,
aes->timeout_ms)) {
LOG(ERROR, "unable to register timeout for executing: %s", aes->what);
* TODO: 4.2 Bodge due to QEMU, see comment on top of
* libxl__initiate_device_remove in libxl_internal.h
*/
- rc = libxl__ev_time_register_rel(gc, &aodev->timeout,
+ rc = libxl__ev_time_register_rel(ao, &aodev->timeout,
device_qemu_timeout,
LIBXL_QEMU_BODGE_TIMEOUT * 1000);
if (rc) {
aes->stdfds[1] = 2;
aes->stdfds[2] = -1;
- rc = libxl__async_exec_start(gc, aes);
+ rc = libxl__async_exec_start(aes);
if (rc)
goto out;
switch_logdirty_xswatch, lds->ret_path);
if (rc) goto out;
- rc = libxl__ev_time_register_rel(gc, &lds->timeout,
+ rc = libxl__ev_time_register_rel(ao, &lds->timeout,
switch_logdirty_timeout, 10*1000);
if (rc) goto out;
rc = libxl__ev_evtchn_wait(gc, &dss->guest_evtchn);
if (rc) goto err;
- rc = libxl__ev_time_register_rel(gc, &dss->guest_timeout,
+ rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
suspend_common_wait_guest_timeout,
60*1000);
if (rc) goto err;
"@releaseDomain");
if (rc) goto err;
- rc = libxl__ev_time_register_rel(gc, &dss->guest_timeout,
+ rc = libxl__ev_time_register_rel(ao, &dss->guest_timeout,
suspend_common_wait_guest_timeout,
60*1000);
if (rc) goto err;
*/
/* Set checkpoint interval timeout */
- rc = libxl__ev_time_register_rel(gc, &dss->checkpoint_timeout,
+ rc = libxl__ev_time_register_rel(ao, &dss->checkpoint_timeout,
remus_next_checkpoint,
dss->interval);
#endif
}
-int libxl__ev_time_register_abs(libxl__gc *gc, libxl__ev_time *ev,
+int libxl__ev_time_register_abs(libxl__ao *ao, libxl__ev_time *ev,
libxl__ev_time_callback *func,
struct timeval absolute)
{
+ AO_GC;
int rc;
CTX_LOCK;
}
-int libxl__ev_time_register_rel(libxl__gc *gc, libxl__ev_time *ev,
+int libxl__ev_time_register_rel(libxl__ao *ao, libxl__ev_time *ev,
libxl__ev_time_callback *func,
int milliseconds /* as for poll(2) */)
{
+ AO_GC;
struct timeval absolute;
int rc;
static inline int libxl__ev_fd_isregistered(const libxl__ev_fd *efd)
{ return efd->fd >= 0; }
-_hidden int libxl__ev_time_register_rel(libxl__gc*, libxl__ev_time *ev_out,
+_hidden int libxl__ev_time_register_rel(libxl__ao*, libxl__ev_time *ev_out,
libxl__ev_time_callback*,
int milliseconds /* as for poll(2) */);
-_hidden int libxl__ev_time_register_abs(libxl__gc*, libxl__ev_time *ev_out,
+_hidden int libxl__ev_time_register_abs(libxl__ao*, libxl__ev_time *ev_out,
libxl__ev_time_callback*,
struct timeval);
_hidden int libxl__ev_time_modify_rel(libxl__gc*, libxl__ev_time *ev,
};
void libxl__async_exec_init(libxl__async_exec_state *aes);
-int libxl__async_exec_start(libxl__gc *gc, libxl__async_exec_state *aes);
+int libxl__async_exec_start(libxl__async_exec_state *aes);
bool libxl__async_exec_inuse(const libxl__async_exec_state *aes);
/*----- device addition/removal -----*/
aes->stdfds[1] = -1;
aes->stdfds[2] = -1;
- rc = libxl__async_exec_start(gc, aes);
+ rc = libxl__async_exec_start(aes);
if (rc)
goto out;
static void occurs(libxl__egc *egc, libxl__ev_time *ev,
const struct timeval *requested_abs);
-static void regs(libxl__gc *gc, int j)
+static void regs(libxl__ao *ao, int j)
{
+ AO_GC;
int rc, i;
LOG(DEBUG,"regs(%d)", j);
for (i=0; i<NTIMES; i++) {
- rc = libxl__ev_time_register_rel(gc, &et[j][i], occurs, ms[j][i]);
+ rc = libxl__ev_time_register_rel(ao, &et[j][i], occurs, ms[j][i]);
assert(!rc);
}
}
libxl__ev_time_init(&et[1][i]);
}
- regs(gc, 0);
+ regs(ao, 0);
return AO_INPROGRESS;
}
assert(ev == &et[0][1]);
libxl__ev_time_deregister(gc, &et[0][0]);
libxl__ev_time_deregister(gc, &et[0][2]);
- regs(gc, 1);
+ regs(tao, 1);
libxl__ev_time_deregister(gc, &et[0][1]);
break;