]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
qemu-file: Simplify qemu_file_shutdown()
authorJuan Quintela <quintela@redhat.com>
Tue, 30 May 2023 18:39:40 +0000 (20:39 +0200)
committerJuan Quintela <quintela@redhat.com>
Wed, 26 Jul 2023 08:55:56 +0000 (10:55 +0200)
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-ID: <20230530183941.7223-20-quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/qemu-file.c

index 9a89e17924419f5d1f51b4b5f9c213008c2ed264..4c577bdff80e85260541101965142d22db19caf0 100644 (file)
@@ -65,8 +65,6 @@ struct QEMUFile {
  */
 int qemu_file_shutdown(QEMUFile *f)
 {
-    int ret = 0;
-
     /*
      * We must set qemufile error before the real shutdown(), otherwise
      * there can be a race window where we thought IO all went though
@@ -96,10 +94,10 @@ int qemu_file_shutdown(QEMUFile *f)
     }
 
     if (qio_channel_shutdown(f->ioc, QIO_CHANNEL_SHUTDOWN_BOTH, NULL) < 0) {
-        ret = -EIO;
+        return -EIO;
     }
 
-    return ret;
+    return 0;
 }
 
 bool qemu_file_mode_is_not_valid(const char *mode)