From c6a3b77d5e98e0c82f5fdd8a00049dc6e8ebec8c Mon Sep 17 00:00:00 2001
From: Juan Quintela <quintela@redhat.com>
Date: Thu, 4 Mar 2010 23:11:54 -0300
Subject: [PATCH 32/42] documentation: qemu_write_full don't work with non-blocking fd's

RH-Author: Juan Quintela <quintela@redhat.com>
Message-id: <0de02bd7df8e087d63a173d7107e3e032095d742.1267743950.git.quintela@redhat.com>
Patchwork-id: 7561
O-Subject: [PATCH 32/32] documentation: qemu_write_full don't work with
	non-blocking fd's
Bugzilla: 567099
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 osdep.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 osdep.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/osdep.c b/osdep.c
index 04c9d1d..62c5b49 100644
--- a/osdep.c
+++ b/osdep.c
@@ -261,6 +261,11 @@ int qemu_open(const char *name, int flags, ...)
  *
  * Return the number of bytes transferred.
  * Set errno if fewer than `count' bytes are written.
+ *
+ * This function don't work with non-blocking fd's.
+ * Any of the possibilities with non-bloking fd's is bad:
+ *   - return a short write (then name is wrong)
+ *   - busy wait adding (errno == EAGAIN) to the loop
  */
 ssize_t qemu_write_full(int fd, const void *buf, size_t count)
 {
-- 
1.6.3.rc4.29.g8146

