qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
	Juan Quintela <quintela@redhat.com>
Subject: [Qemu-devel] [PATCH 02/10] QEMUFileCloseFunc: add return value documentation (v2)
Date: Thu, 10 Nov 2011 10:41:40 -0200	[thread overview]
Message-ID: <1320928908-19076-3-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1320928908-19076-1-git-send-email-ehabkost@redhat.com>

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>
---
 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
-- 
1.7.3.2

  parent reply	other threads:[~2011-11-10 12:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 12:41 [Qemu-devel] [PATCH 00/10] qemu_fclose() error handling fixes (v3) Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 01/10] savevm: use qemu_file_set_error() instead of setting last_error directly Eduardo Habkost
2011-11-10 12:41 ` Eduardo Habkost [this message]
2011-11-10 12:41 ` [Qemu-devel] [PATCH 03/10] exec_close(): accept any negative value as qemu_fclose() error Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 04/10] migrate_fd_cleanup: accept any negative qemu_fclose() value as error Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 05/10] qemu_fclose: return last_error if set (v3) Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 06/10] stdio_pclose: return -errno on error (v3) Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 07/10] stdio_fclose: return -errno on errors (v2) Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 08/10] exec_close(): " Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 09/10] tcp_close(): check for close() errors too (v2) Eduardo Habkost
2011-11-10 12:41 ` [Qemu-devel] [PATCH 10/10] unix_close(): " Eduardo Habkost
2011-12-12 18:28 ` [Qemu-devel] [PATCH 00/10] qemu_fclose() error handling fixes (v3) Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2011-11-09 22:03 [Qemu-devel] [PATCH 00/10] qemu_fclose() error handling fixes (v2) Eduardo Habkost
2011-11-09 22:03 ` [Qemu-devel] [PATCH 02/10] QEMUFileCloseFunc: add return value documentation (v2) Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1320928908-19076-3-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).