summary refs log tree commit diff stats
path: root/migration/qemu-file.c
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2024-03-04 13:28:24 +0100
committerPeter Xu <peterx@redhat.com>2024-03-11 14:41:40 -0400
commite8c44363fbf25c2601fa2fbf3ec0d6d37c5f1a02 (patch)
treefa6e7dda184987a94da53561c6f676c10232299f /migration/qemu-file.c
parent12ab1e4fe84aafac37e006673f0d01f716a9a058 (diff)
downloadfocaccia-qemu-e8c44363fbf25c2601fa2fbf3ec0d6d37c5f1a02.tar.gz
focaccia-qemu-e8c44363fbf25c2601fa2fbf3ec0d6d37c5f1a02.zip
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>
Diffstat (limited to 'migration/qemu-file.c')
-rw-r--r--migration/qemu-file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/migration/qemu-file.c b/migration/qemu-file.c
index b10c882629..a10882d47f 100644
--- a/migration/qemu-file.c
+++ b/migration/qemu-file.c
@@ -63,6 +63,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
@@ -91,7 +93,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;
     }