]> git.proxmox.com Git - mirror_qemu.git/commit - ui/gtk.c
gtk: use qemu_chr_alloc() to allocate CharDriverState
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 21 Jan 2016 11:56:26 +0000 (11:56 +0000)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 2 Feb 2016 13:05:07 +0000 (14:05 +0100)
commit919e11f3735c524e23d049512d3306ea1cc63fba
tree7e028299056ff66593504778e271cc8be457fbed
parent10ae9d76388e3f4a31f6a1475b5e2d1f28404a10
gtk: use qemu_chr_alloc() to allocate CharDriverState

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

  commit d0d7708ba29cbcc343364a46bff981e0ff88366f
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Mon Jan 11 12:44:41 2016 +0000

    qemu-char: add logfile facility to all chardev backends

which exposed the problem as a behaviour regression

Reported-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Hervé Poussineau <hpoussin@reactos.org>
Message-id: 1453377386-10190-1-git-send-email-berrange@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/gtk.c