From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRzhO-0006vP-Kz for qemu-devel@nongnu.org; Thu, 11 Sep 2014 04:25:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRzhJ-0006iF-NY for qemu-devel@nongnu.org; Thu, 11 Sep 2014 04:25:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25588) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRzhJ-0006iA-Gq for qemu-devel@nongnu.org; Thu, 11 Sep 2014 04:25:45 -0400 Message-ID: <54115C7E.5040305@redhat.com> Date: Thu, 11 Sep 2014 10:25:34 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140910143413.6908.43083.stgit@PASHA-ISP> In-Reply-To: <20140910143413.6908.43083.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] gdbstub: init mon_chr through qemu_chr_alloc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: zealot351@gmail.com, maria.klimushenkova@ispras.ru Il 10/09/2014 16:34, Pavel Dovgalyuk ha scritto: > 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 { > Thanks, will send a pull request soon. Paolo