From 5d75a8513d08b33975bdf5971871c0c977167cd1 Mon Sep 17 00:00:00 2001 Message-Id: <5d75a8513d08b33975bdf5971871c0c977167cd1.1374754301.git.minovotn@redhat.com> From: Gerd Hoffmann Date: Mon, 24 Jun 2013 07:05:12 +0200 Subject: [PATCH 01/65] qemu-char: Set foo_tag = 0 when returning FALSE from callbacks RH-Author: Gerd Hoffmann Message-id: <1372057576-26450-2-git-send-email-kraxel@redhat.com> Patchwork-id: 52108 O-Subject: [RHEL-6.5 qemu-kvm PATCH v2 01/65] qemu-char: Set foo_tag = 0 when returning FALSE from callbacks Bugzilla: 676568 RH-Acked-by: Laszlo Ersek RH-Acked-by: Eduardo Habkost RH-Acked-by: Hans de Goede RH-Acked-by: Luiz Capitulino From: Hans de Goede While reviewing some patches I found this problem where tcp_chr_accept does not clear listen_tag when returning FALSE, leading to a double g_source_remove of the underlying source. Not really a problem unless the id gets re-used in between, but still something we should fix. While at it I've also reviewed all the other code in qemu-char.c for similar problems and found that pty_chr_timer has the same problem. Cc: Anthony Liguori Signed-off-by: Hans de Goede Message-id: 1366890782-10311-1-git-send-email-hdegoede@redhat.com Signed-off-by: Anthony Liguori (cherry picked from commit 79f2007578a0a205e25a6f299cc52d6732337089) Signed-off-by: Amit Shah Signed-off-by: Gerd Hoffmann --- qemu-char.c | 2 ++ 1 file changed, 2 insertions(+) Signed-off-by: Michal Novotny --- qemu-char.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index 1e38cbd..6292080 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1049,6 +1049,7 @@ static gboolean pty_chr_timer(gpointer opaque) pty_chr_update_read_handler(chr); out: + s->timer_tag = 0; return FALSE; } @@ -2410,6 +2411,7 @@ static gboolean tcp_chr_accept(GIOChannel *channel, GIOCondition cond, void *opa } fd = qemu_accept(s->listen_fd, addr, &len); if (fd < 0 && errno != EINTR) { + s->listen_tag = 0; return FALSE; } else if (fd >= 0) { if (s->do_telnetopt) -- 1.7.11.7