* [Qemu-devel] [PATCH] gdbstub: init mon_chr through qemu_chr_alloc
@ 2014-09-10 14:34 Pavel Dovgalyuk
2014-09-11 8:25 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Pavel Dovgalyuk @ 2014-09-10 14:34 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, zealot351, maria.klimushenkova, pavel.dovgaluk
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>
---
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 {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] gdbstub: init mon_chr through qemu_chr_alloc
2014-09-10 14:34 [Qemu-devel] [PATCH] gdbstub: init mon_chr through qemu_chr_alloc Pavel Dovgalyuk
@ 2014-09-11 8:25 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2014-09-11 8:25 UTC (permalink / raw)
To: Pavel Dovgalyuk, qemu-devel; +Cc: zealot351, maria.klimushenkova
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 <pavel.dovgaluk@ispras.ru>
> ---
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-11 8:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-10 14:34 [Qemu-devel] [PATCH] gdbstub: init mon_chr through qemu_chr_alloc Pavel Dovgalyuk
2014-09-11 8:25 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).