From patchwork Fri Nov 3 13:19:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A. Shutemov" X-Patchwork-Id: 10040039 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1DEC8602DA for ; Fri, 3 Nov 2017 13:22:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D72029600 for ; Fri, 3 Nov 2017 13:22:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1252A295FC; Fri, 3 Nov 2017 13:22:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF34F295FA for ; Fri, 3 Nov 2017 13:22:54 +0000 (UTC) Received: from localhost ([::1]:36733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAbvw-00050A-CG for patchwork-qemu-devel@patchwork.kernel.org; Fri, 03 Nov 2017 09:22:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAbvC-0004ys-SF for qemu-devel@nongnu.org; Fri, 03 Nov 2017 09:22:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eAbv9-0002yj-NE for qemu-devel@nongnu.org; Fri, 03 Nov 2017 09:22:06 -0400 Received: from mga02.intel.com ([134.134.136.20]:60923) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eAbv9-0002WB-EM for qemu-devel@nongnu.org; Fri, 03 Nov 2017 09:22:03 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Nov 2017 06:21:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.44,338,1505804400"; d="scan'208"; a="1213873152" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 03 Nov 2017 06:21:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id C651750B; Fri, 3 Nov 2017 15:20:03 +0200 (EET) From: "Kirill A. Shutemov" To: Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 3 Nov 2017 16:19:59 +0300 Message-Id: <20171103131959.73560-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.14.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.20 Subject: [Qemu-devel] [PATCH] chardev: don't forget to set backend for mux X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kirill@shutemov.name, qemu-devel@nongnu.org, "Kirill A. Shutemov" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP I noticied that on recent versions on QEMU I was not able to trigger SysRq to invoke debug capabilites of Linux Kernel. I've tracked it down to qemu_chr_be_event() ignoring CHR_EVENT_BREAK due s->be being NULL. Looks like the bug was introduced in 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() forgot to get s->be initialized in case of mux. Let's fix this. Signed-off-by: Kirill A. Shutemov Fixes: a4afa548fc6d ("char: move front end handlers in CharBackend") --- chardev/char-fe.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chardev/char-fe.c b/chardev/char-fe.c index ee6d59610031..d4a54947a567 100644 --- a/chardev/char-fe.c +++ b/chardev/char-fe.c @@ -209,9 +209,8 @@ bool qemu_chr_fe_init(CharBackend *b, Chardev *s, Error **errp) tag = d->mux_cnt++; } else if (s->be) { goto unavailable; - } else { - s->be = b; } + s->be = b; b->fe_open = false; b->tag = tag;