void *config_data = 0;
int config_len = 0;
int restore_fd = -1;
+ int restore_fd_to_close = -1;
const libxl_asyncprogress_how *autoconnect_console_how;
struct save_file_header hdr;
fprintf(stderr, "Can't open restore file: %s\n", strerror(errno));
return ERROR_INVAL;
}
+ restore_fd_to_close = restore_fd;
rc = libxl_fd_set_cloexec(ctx, restore_fd, 1);
if (rc) return rc;
}
release_lock();
+ if (restore_fd_to_close >= 0) {
+ if (close(restore_fd_to_close))
+ fprintf(stderr, "Failed to close restoring file, fd %d, errno %d\n",
+ restore_fd_to_close, errno);
+ restore_fd_to_close = -1;
+ }
+
if (!paused)
libxl_domain_unpause(ctx, domid);