qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] gtk: use qemu_chr_alloc() to allocate CharDrive


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] gtk: use qemu_chr_alloc() to allocate CharDriverState
Date: Thu, 21 Jan 2016 17:55:28 +0000

On 21 January 2016 at 11:56, Daniel P. Berrange <address@hidden> wrote:
> The gd_vc_handler() callback is using g_malloc0() to
> allocate the CharDriverState struct. As a result the
> logfd field is getting initialized to 0, instead of
> -1 when no logfile is requested.
>
> The result is that when running
>
>  $ qemu-system-i386 -nodefaults -chardev vc,id=mon0 -mon chardev=mon0
>
> qemu duplicates all monitor output to stdout as well
> as the GTK window.
>
> Not using qemu_chr_alloc() was already a bug, but harmless
> until this commit

A quick check with coccinelle:

@@
typedef CharDriverState;
CharDriverState *x;
@@

- x = g_malloc0(...)
+ x = qemu_chr_alloc(foo)


revealed only this ui/gtk.c allocation plus the actual
implementation of qemu_chr_alloc() as places where we try
to do a manual g_malloc0() of a CharDriverState. So I
think this is the only bit that needs changing.

thanks
-- PMM



reply via email to

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