diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2014-09-10 18:34:14 +0400 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2015-01-04 13:41:55 -0600 |
commit | b5fc105016ce378cd2545c1f3dda9f0f5ead55f8 (patch) | |
tree | a539435799d322ae6a2348e8afc23ea6529f4295 /gdbstub.c | |
parent | e1cf5a23d10d623fda59c1c6c810a9f56776a5e5 (diff) | |
download | qemu-b5fc105016ce378cd2545c1f3dda9f0f5ead55f8.tar.gz |
gdbstub: init mon_chr through qemu_chr_alloc
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 <Pavel.Dovgaluk@ispras.ru>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 462efe9e530e22b1b60aaf01716e1423cd94302c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'gdbstub.c')
-rw-r--r-- | gdbstub.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 { |