From patchwork Wed Nov 9 22:03:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [02/10] QEMUFileCloseFunc: add return value documentation (v2) X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 124726 Message-Id: <1320876205-16113-3-git-send-email-ehabkost@redhat.com> To: qemu-devel@nongnu.org Cc: Michael Roth , Juan Quintela Date: Wed, 9 Nov 2011 20:03:17 -0200 From: Eduardo Habkost List-Id: 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 --- hw/hw.h | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index ed20f5a..efa04d1 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 back-end being + * used. + */ typedef int (QEMUFileCloseFunc)(void *opaque); /* Called to determine if the file has exceeded it's bandwidth allocation. The