From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRiyU-00028n-N2 for qemu-devel@nongnu.org; Wed, 10 Sep 2014 10:34:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRiyO-0000hv-Lr for qemu-devel@nongnu.org; Wed, 10 Sep 2014 10:34:22 -0400 Received: from mail.ispras.ru ([83.149.199.45]:34758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRiyO-0000hU-Do for qemu-devel@nongnu.org; Wed, 10 Sep 2014 10:34:16 -0400 From: Pavel Dovgalyuk Date: Wed, 10 Sep 2014 18:34:14 +0400 Message-ID: <20140910143413.6908.43083.stgit@PASHA-ISP> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] 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: pbonzini@redhat.com, zealot351@gmail.com, maria.klimushenkova@ispras.ru, pavel.dovgaluk@ispras.ru 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 --- gdbstub.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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 {