[RFC,02/11] QEMUFileCloseFunc: add return value documentation
diff mbox

Message ID 1320175230-27980-3-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost Nov. 1, 2011, 7:20 p.m. UTC
qemu_fclose() and QEMUFile->close will return -errno on error, and any
positive value on success.

We need the positive non-zero success values because
migration-exec.c:exec_close() relies on non-zero return values to get
the process exit code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
 hw/hw.h |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff mbox

diff --git a/hw/hw.h b/hw/hw.h
index ed20f5a..2e36223 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -27,7 +27,13 @@  typedef int (QEMUFilePutBufferFunc)(void *opaque, const uint8_t *buf,
 typedef int (QEMUFileGetBufferFunc)(void *opaque, uint8_t *buf,
                                     int64_t pos, int size);
-/* Close a file and return an error code */
+/* Close a file
+ *
+ * Return negative error number on error, 0 or positive value on success.
+ *
+ * The meaning of return value on success depends on the specific backend being
+ * used.
+ */
 typedef int (QEMUFileCloseFunc)(void *opaque);
 /* Called to determine if the file has exceeded it's bandwidth allocation.  The