From nobody Sat Nov 1 07:32:41 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1509715407501881.8844988426773; Fri, 3 Nov 2017 06:23:27 -0700 (PDT) Received: from localhost ([::1]:36735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eAbwF-0005R9-Ka for importer@patchew.org; Fri, 03 Nov 2017 09:23:11 -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 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) X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,338,1505804400"; d="scan'208";a="1213873152" 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 =3D d->mux_cnt++; } else if (s->be) { goto unavailable; - } else { - s->be =3D b; } + s->be =3D b; =20 b->fe_open =3D false; b->tag =3D tag; --=20 2.14.2