]> git.proxmox.com Git - mirror_qemu.git/commitdiff
QEMUFileCloseFunc: add return value documentation (v2)
authorEduardo Habkost <ehabkost@redhat.com>
Thu, 10 Nov 2011 12:41:40 +0000 (10:41 -0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 12 Dec 2011 17:47:19 +0000 (11:47 -0600)
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.

Changes v1 -> v2:
 - Cosmetic spelling change on comment text

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/hw.h

diff --git a/hw/hw.h b/hw/hw.h
index ed20f5a27a78a00520563e2feee4debf3e592e70..efa04d1340f9b51a3656be69568c631cf57b3909 100644 (file)
--- 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 back-end being
+ * used.
+ */
 typedef int (QEMUFileCloseFunc)(void *opaque);
 
 /* Called to determine if the file has exceeded it's bandwidth allocation.  The