qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/6] gtk: add virtual console support
Date: Sat, 25 Feb 2012 15:18:14 -0600	[thread overview]
Message-ID: <4F495016.8070603@codemonkey.ws> (raw)
In-Reply-To: <4F494311.4010909@weilnetz.de>

On 02/25/2012 02:22 PM, Stefan Weil wrote:
> Am 25.02.2012 20:49, schrieb Anthony Liguori:
>> 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 <aliguori@us.ibm.com>
>>>> ---
>>>> 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
>
> Hi Anthony,
>
> there is no book of decisions for QEMU, but there is best practice.
> As far as I remember this topic was first discussed in this
> qemu-devel thread:
>
> http://lists.nongnu.org/archive/html/qemu-devel/2011-10/msg01988.html
>
> a = malloc(sizeof(*a)) is no longer a valid pattern for QEMU
> since you introduced glib-2.0. Those calls were converted
> to a = g_malloc(sizeof(*a)) which was reasonable for a simple
> automated code conversion.
>
> I also used the g_malloc pattern in my patch, but was convinced
> that glib-2.0 offers a better alternative using g_new.

I meant g_malloc of course.

If we want to have a "best practice", we should document it in CODING_STYLE. 
But I wouldn't agree with such a patch to coding style anyway.

Regards,

Anthony Liguori

>
> Kind regards,
>
> Stefan Weil
>
>

  reply	other threads:[~2012-02-25 21:18 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-19 23:44 [Qemu-devel] [PATCH 0/6] Add GTK UI to enable basic accessibility Anthony Liguori
2012-02-19 23:44 ` [Qemu-devel] [PATCH 1/6] console: allow VCs to be overridden by UI Anthony Liguori
2012-02-20  9:17   ` Gerd Hoffmann
2012-02-20 13:45     ` Anthony Liguori
2012-02-20 13:59       ` Gerd Hoffmann
2012-02-20 14:11         ` Anthony Liguori
2012-02-20 14:27           ` Gerd Hoffmann
2012-02-20 15:10             ` Anthony Liguori
2012-02-19 23:45 ` [Qemu-devel] [PATCH 2/6] ui: add basic GTK gui Anthony Liguori
2012-02-20 20:45   ` Stefan Weil
2012-02-21  0:20     ` Anthony Liguori
2012-02-19 23:45 ` [Qemu-devel] [PATCH 3/6] gtk: add virtual console support Anthony Liguori
2012-02-20 21:13   ` Stefan Weil
2012-02-25 16:21   ` Stefan Weil
2012-02-25 19:49     ` Anthony Liguori
2012-02-25 20:22       ` Stefan Weil
2012-02-25 21:18         ` Anthony Liguori [this message]
2012-02-19 23:45 ` [Qemu-devel] [PATCH 4/6] gtk: add support for input grabbing Anthony Liguori
2012-02-20  0:09   ` Anthony Liguori
2012-02-19 23:45 ` [Qemu-devel] [PATCH 5/6] gtk: add support for screen scaling and full screen Anthony Liguori
2012-02-20  7:41   ` Paolo Bonzini
2012-02-20 13:45     ` Anthony Liguori
2012-02-25 15:49   ` Stefan Weil
2012-02-19 23:45 ` [Qemu-devel] [PATCH 6/6] gtk: make default UI Anthony Liguori
2012-02-20  0:15   ` Roy Tam
2012-02-20  1:10     ` Anthony Liguori
2012-02-20  1:50       ` Roy Tam
2012-02-20  2:22         ` Anthony Liguori
2012-02-20  2:24       ` Brad Smith
2012-02-20  2:44         ` Anthony Liguori
2012-02-20  2:50           ` Roy Tam
2012-02-20  2:52           ` Brad Smith
2012-02-20  3:04             ` Anthony Liguori
2012-02-20 14:06               ` Stefano Stabellini
2012-02-20 14:07                 ` Anthony Liguori
2012-02-20 14:44                   ` Stefano Stabellini
2012-02-20 14:46                     ` Roy Tam
2012-02-19 23:59 ` [Qemu-devel] [PATCH 0/6] Add GTK UI to enable basic accessibility Anthony Liguori
2012-02-20 12:17 ` Kevin Wolf
2012-02-20 12:47   ` Kevin Wolf
2012-02-20 14:08     ` Anthony Liguori
2012-02-20 14:04   ` Anthony Liguori
2012-02-20 14:33     ` Kevin Wolf
2012-02-25 17:02 ` Stefan Weil
2012-02-25 20:11   ` Anthony Liguori
2012-02-25 21:15     ` Stefan Weil
2012-02-25 21:47       ` [Qemu-devel] Very small VGA window sizes (was: Re: [PATCH 0/6] Add GTK UI to enable basic accessibility) Stefan Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F495016.8070603@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).