From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GzJ-0003I7-BK for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9GzA-0006Ch-MU for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:13 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:44277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GzA-0006Bl-FB for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:35:04 -0500 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Jan 2015 10:35:03 -0700 From: Michael Roth Date: Thu, 8 Jan 2015 11:33:17 -0600 Message-Id: <1420738472-23267-14-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1420738472-23267-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 13/88] 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 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 (cherry picked from commit 462efe9e530e22b1b60aaf01716e1423cd94302c) Signed-off-by: Michael Roth --- 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 { -- 1.9.1