Message ID | 20240207133347.1115903-13-clg@redhat.com |
---|---|
State | New |
Headers | show |
Series | migration: Improve error reporting | expand |
On 7/2/24 14:33, Cédric Le Goater wrote: > This will help detect issues regarding I/O channels usage. English isn't my native language but I'd expect "detecting" here. > Signed-off-by: Cédric Le Goater <clg@redhat.com> > --- > migration/qemu-file.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
On Wed, Feb 07, 2024 at 02:33:45PM +0100, Cédric Le Goater wrote: > This will help detect issues regarding I/O channels usage. > > Signed-off-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com>
diff --git a/migration/qemu-file.c b/migration/qemu-file.c index 94231ff2955c80b3d0fab11a40510d34c334a826..b69e0c62e2fcf21d346a3687df7eebee23791fdc 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -62,6 +62,8 @@ struct QEMUFile { */ int qemu_file_shutdown(QEMUFile *f) { + Error *err = NULL; + /* * We must set qemufile error before the real shutdown(), otherwise * there can be a race window where we thought IO all went though @@ -90,7 +92,8 @@ int qemu_file_shutdown(QEMUFile *f) 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; }
This will help detect issues regarding I/O channels usage. Signed-off-by: Cédric Le Goater <clg@redhat.com> --- migration/qemu-file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)