chardev: fix backend events regression with mux chardev
commitd09c4a47874f30820b08c39ad39bcca9b8cde084
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 3 Nov 2017 15:28:23 +0000 (3 16:28 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 21 Dec 2017 08:30:32 +0000 (21 09:30 +0100)
tree63451b0f382ccf605a509f3873ec44bbe10008b2
parent5a22ab71623c0fb709d49df353bdf2ec7c445c4c
chardev: fix backend events regression with mux chardev

Kirill noticied that on recent versions on QEMU he was not able to
trigger SysRq to invoke debug capabilites of Linux Kernel.  He tracked
it down to qemu_chr_be_event() ignoring CHR_EVENT_BREAK due s->be
being NULL. The bug was introduced in 2.8, commit a4afa548fc6d ("char:
move front end handlers in CharBackend"). Since the commit, the
qemu_chr_be_event() failed to deliver CHR_EVENT_BREAK due to
qemu_chr_fe_init() does not set s->be in case of mux.

Let's fix this by teaching mux to send an event to the frontend with
the focus.

Reported-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Fixes: a4afa548fc6d ("char: move front end handlers in CharBackend")
Message-Id: <20171103152824.21948-2-marcandre.lureau@redhat.com>
Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
chardev/char-mux.c
chardev/char.c
include/chardev/char.h