From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSROF-0006dD-PN for qemu-devel@nongnu.org; Fri, 12 Sep 2014 10:00:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSROA-00013F-Tp for qemu-devel@nongnu.org; Fri, 12 Sep 2014 09:59:55 -0400 Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 12 Sep 2014 15:58:58 +0200 Message-Id: <1410530338-17615-22-git-send-email-pbonzini@redhat.com> In-Reply-To: <1410530338-17615-1-git-send-email-pbonzini@redhat.com> References: <1410530338-17615-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 21/21] gdbstub: init mon_chr through qemu_chr_alloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Pavel Dovgalyuk From: Pavel Dovgalyuk This patch initializes monitor for gdbstub with the qemu_chr_alloc function instead of just allocating the memory. Initialization function call is required, because it also creates chr_write_lock mutex, which is used when writing to this character device. Signed-off-by: Pavel Dovgalyuk Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index 8afe0b7..71aaa23 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1707,7 +1707,7 @@ int gdbserver_start(const char *device) qemu_add_vm_change_state_handler(gdb_vm_state_change, NULL); /* Initialize a monitor terminal for gdb */ - mon_chr = g_malloc0(sizeof(*mon_chr)); + mon_chr = qemu_chr_alloc(); mon_chr->chr_write = gdb_monitor_write; monitor_init(mon_chr, 0); } else { -- 2.1.0