* coroutine, and here we are in the COLO incoming thread, so it is ok to
* set the fd back to blocked.
*/
- qemu_file_set_blocking(mis->from_src_file, true);
+ if (!qemu_file_set_blocking(mis->from_src_file, true, &local_err)) {
+ error_report_err(local_err);
+ goto out;
+ }
colo_incoming_start_dirty_log();
assert(!mis->from_src_file);
mis->from_src_file = f;
- qemu_file_set_blocking(f, false);
+ qemu_file_set_blocking(f, false, &error_abort);
}
void migration_incoming_process(void)
/* This should be set already in migration_incoming_setup() */
assert(mis->from_src_file);
/* Postcopy has standalone thread to do vm load */
- qemu_file_set_blocking(mis->from_src_file, true);
+ qemu_file_set_blocking(mis->from_src_file, true, &error_abort);
/* Re-configure the return path */
mis->to_src_file = qemu_file_get_return_path(mis->from_src_file);
}
migration_rate_set(rate_limit);
- qemu_file_set_blocking(s->to_dst_file, true);
+ if (!qemu_file_set_blocking(s->to_dst_file, true, &local_err)) {
+ goto fail;
+ }
/*
* Open the return path. For postcopy, it is used exclusively. For
* The new loading channel has its own threads, so it needs to be
* blocked too. It's by default true, just be explicit.
*/
- qemu_file_set_blocking(file, true);
+ qemu_file_set_blocking(file, true, &error_abort);
mis->postcopy_qemufile_dst = file;
qemu_sem_post(&mis->postcopy_qemufile_dst_done);
trace_postcopy_preempt_new_channel();
* both directions, and thus changing the blocking on the main
* QEMUFile can also affect the return path.
*/
-void qemu_file_set_blocking(QEMUFile *f, bool block)
+bool qemu_file_set_blocking(QEMUFile *f, bool block, Error **errp)
{
- qio_channel_set_blocking(f->ioc, block, NULL);
+ return qio_channel_set_blocking(f->ioc, block, errp);
}
/*
int qemu_file_shutdown(QEMUFile *f);
QEMUFile *qemu_file_get_return_path(QEMUFile *f);
int qemu_fflush(QEMUFile *f);
-void qemu_file_set_blocking(QEMUFile *f, bool block);
+bool qemu_file_set_blocking(QEMUFile *f, bool block, Error **errp);
int qemu_file_get_to_fd(QEMUFile *f, int fd, size_t size);
void qemu_set_offset(QEMUFile *f, off_t off, int whence);
off_t qemu_get_offset(QEMUFile *f);
* Because we're a thread and not a coroutine we can't yield
* in qemu_file, and thus we must be blocking now.
*/
- qemu_file_set_blocking(f, true);
+ qemu_file_set_blocking(f, true, &error_fatal);
/* TODO: sanity check that only postcopiable data will be loaded here */
load_res = qemu_loadvm_state_main(f, mis);
f = mis->from_src_file;
/* And non-blocking again so we don't block in any cleanup */
- qemu_file_set_blocking(f, false);
+ qemu_file_set_blocking(f, false, &error_fatal);
trace_postcopy_ram_listen_thread_exit();
if (load_res < 0) {