mirror of https://github.com/xemu-project/xemu.git
migration: Report error when shutdown fails
This will help detect issues regarding I/O channels usage. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Peter Xu <peterx@redhat.com> Signed-off-by: Cédric Le Goater <clg@redhat.com> Link: https://lore.kernel.org/r/20240304122844.1888308-7-clg@redhat.com Signed-off-by: Peter Xu <peterx@redhat.com>
This commit is contained in:
parent
12ab1e4fe8
commit
e8c44363fb
|
@ -63,6 +63,8 @@ struct QEMUFile {
|
||||||
*/
|
*/
|
||||||
int qemu_file_shutdown(QEMUFile *f)
|
int qemu_file_shutdown(QEMUFile *f)
|
||||||
{
|
{
|
||||||
|
Error *err = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We must set qemufile error before the real shutdown(), otherwise
|
* We must set qemufile error before the real shutdown(), otherwise
|
||||||
* there can be a race window where we thought IO all went though
|
* there can be a race window where we thought IO all went though
|
||||||
|
@ -91,7 +93,8 @@ int qemu_file_shutdown(QEMUFile *f)
|
||||||
return -ENOSYS;
|
return -ENOSYS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qio_channel_shutdown(f->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL) < 0) {
|
if (qio_channel_shutdown(f->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, &err) < 0) {
|
||||||
|
error_report_err(err);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue