qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/6] gtk: add virtual console support


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 3/6] gtk: add virtual console support
Date: Sat, 25 Feb 2012 13:49:23 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15

On 02/25/2012 10:21 AM, Stefan Weil wrote:
Am 20.02.2012 00:45, schrieb Anthony Liguori:
This enables VteTerminal to be used to render the text consoles. VteTerminal is
the same widget used by gnome-terminal which means it's VT100 emulation is as
good as they come.

It's also screen reader accessible, supports copy/paste, proper scrolling and
most of the other features you would expect from a terminal widget.

Signed-off-by: Anthony Liguori <address@hidden>
---
ui/gtk.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 138 insertions(+), 0 deletions(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 502705b..bf65a4f 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
[...]
+static int gd_vc_handler(QemuOpts *opts, CharDriverState **chrp)
+{
+ CharDriverState *chr;
+
+ chr = g_malloc0(sizeof(*chr));

Some time ago, there was a decision to prefer g_new / g_new0:

I'm not sure where the book of decisions is kept, but I certainly don't agree. a = malloc(sizeof(*a)) is an incredibly common pattern in QEMU.

It would be silly to change this pattern without good cause.

Regards,

Anthony Liguori


chr = g_new0(CharDriverState, 1);

In function gtk_display_init there is also a g_malloc0 which
should be replaced by g_new0.

Regards,

Stefan Weil






reply via email to

[Prev in Thread] Current Thread [Next in Thread]