• Marc-André Lureau's avatar
    chardev: qom-ify · 777357d7
    Marc-André Lureau authored
    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: 's avatarMarc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
    Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
    777357d7
testdev.c 3.66 KB