]> git.proxmox.com Git - mirror_qemu.git/commit - ui/gtk.c
chardev: qom-ify
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 7 Dec 2016 15:39:10 +0000 (18:39 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 27 Jan 2017 17:08:00 +0000 (18:08 +0100)
commit777357d758d937c9dd83082c39aff9f1e53e9ba3
tree20b236bf5acc7dfc20b4358bb8072dfe983c0e2d
parent5bf5adaeb7245d7037f29429fb231b4b602d5b50
chardev: qom-ify

Turn Chardev into Object.

qemu_chr_alloc() is replaced by the qemu_chardev_new() constructor. It
will call qemu_char_open() to open/intialize the chardev with the
ChardevCommon *backend settings.

The CharDriver::create() callback is turned into a ChardevClass::open()
which is called from the newly introduced qemu_chardev_open().

"chardev-gdb" and "chardev-hci" are internal chardev and aren't
creatable directly with -chardev. Use a new internal flag to disable
them. We may want to use TYPE_USER_CREATABLE interface instead, or
perhaps allow -chardev usage.

Although in general we keep typename and macros private, unless the type
is being used by some other file, in this patch, all types and common
helper macros for qemu-char.c are in char.h. This is to help transition
now (some types must be declared early, while some aren't shared) and
when splitting in several units. This is to be improved later.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
13 files changed:
backends/baum.c
backends/msmouse.c
backends/testdev.c
gdbstub.c
hw/bt/hci-csr.c
include/sysemu/char.h
include/ui/console.h
monitor.c
qemu-char.c
spice-qemu-char.c
ui/console.c
ui/gtk.c
vl.c