libxl__carefd_close(childs_pipes[1]);
helper_failed(egc, shs, rc);;
}
+static void sendsig(libxl__gc *gc, libxl__save_helper_state *shs, int sig)
+{
+ int r = kill(shs->child.pid, sig);
+ if (r) LOGE(WARN, "failed to kill save/restore helper [%lu] (signal %d)",
+ (unsigned long)shs->child.pid, sig);
+}
static void helper_failed(libxl__egc *egc, libxl__save_helper_state *shs,
int rc)
return;
}
- int r = kill(shs->child.pid, SIGKILL);
- if (r) LOGE(WARN, "failed to kill save/restore helper [%lu]",
- (unsigned long)shs->child.pid);
+ sendsig(gc, shs, SIGKILL);
}
static void helper_stdout_readable(libxl__egc *egc, libxl__ev_fd *ev,
tellparent_destroy,
};
static xc_interface *xch;
+static int io_fd;
/*----- error handling -----*/
if (!strcmp(mode,"--save-domain")) {
- int io_fd = atoi(NEXTARG);
+ io_fd = atoi(NEXTARG);
uint32_t dom = strtoul(NEXTARG,0,10);
uint32_t max_iters = strtoul(NEXTARG,0,10);
uint32_t max_factor = strtoul(NEXTARG,0,10);
} else if (!strcmp(mode,"--restore-domain")) {
- int io_fd = atoi(NEXTARG);
+ io_fd = atoi(NEXTARG);
uint32_t dom = strtoul(NEXTARG,0,10);
unsigned store_evtchn = strtoul(NEXTARG,0,10);
domid_t store_domid = strtoul(NEXTARG,0,10);