qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] char: Fix return type of qemu_chr_fe_add_watch()
@ 2013-03-19 12:38 Kevin Wolf
  2013-03-19 18:58 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2013-03-19 12:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, amit.shah, aliguori

qemu_chr_fe_add_watch() can return negative errors, therefore it must
not have an unsigned return type. For consistency with other
qemu_chr_fe_* functions, this uses a standard C int instead of glib
types.

In situations where qemu_chr_fe_add_watch() is falsely assumed to have
succeeded, the serial ports would go into a state where it never becomes
ready for transmitting more data; this is fixed by this patch.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 include/char/char.h | 4 ++--
 qemu-char.c         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/char/char.h b/include/char/char.h
index d6a0351..0326b2a 100644
--- a/include/char/char.h
+++ b/include/char/char.h
@@ -153,8 +153,8 @@ void qemu_chr_fe_close(struct CharDriverState *chr);
 void qemu_chr_fe_printf(CharDriverState *s, const char *fmt, ...)
     GCC_FMT_ATTR(2, 3);
 
-guint qemu_chr_fe_add_watch(CharDriverState *s, GIOCondition cond,
-                            GIOFunc func, void *user_data);
+int qemu_chr_fe_add_watch(CharDriverState *s, GIOCondition cond,
+                          GIOFunc func, void *user_data);
 
 /**
  * @qemu_chr_fe_write:
diff --git a/qemu-char.c b/qemu-char.c
index e633797..4e011df 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -3397,8 +3397,8 @@ void qemu_chr_fe_close(struct CharDriverState *chr)
     }
 }
 
-guint qemu_chr_fe_add_watch(CharDriverState *s, GIOCondition cond,
-                            GIOFunc func, void *user_data)
+int qemu_chr_fe_add_watch(CharDriverState *s, GIOCondition cond,
+                          GIOFunc func, void *user_data)
 {
     GSource *src;
     guint tag;
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] char: Fix return type of qemu_chr_fe_add_watch()
  2013-03-19 12:38 [Qemu-devel] [PATCH] char: Fix return type of qemu_chr_fe_add_watch() Kevin Wolf
@ 2013-03-19 18:58 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2013-03-19 18:58 UTC (permalink / raw)
  To: Kevin Wolf, qemu-devel; +Cc: amit.shah, aliguori

Applied.  Thanks.

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-19 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-19 12:38 [Qemu-devel] [PATCH] char: Fix return type of qemu_chr_fe_add_watch() Kevin Wolf
2013-03-19 18:58 ` Anthony Liguori

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).