From nobody Wed Nov 27 00:32:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1701939786; cv=none; d=zohomail.com; s=zohoarc; b=O0Gx3kArz2FFC9fRATX/IPLkOM5NPIW0nyscC662j39vzY/AvD45qugGOpEDkUpKvYsJ0AEltj/Dswtmky1DWSY21pZFd2IHQX2yXdnpNnRUh89Pf59jxGBI24Es+5jb02hnmd7/gJYnAKp7IQRoL2dkil1sfkDyEdzplIYwu0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701939786; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QBsI9rKuliS+j8BH6HguJ+avdPZAbDdZ0hOY+e9QMl8=; b=I45jpZ1tz9qLBYOnG7WCoriB2Ovm8nqiiNZvp6z/oDqOa1cKlVKwMTmAducYvbuSQrhX/C8HEj/m/eFsc6mmnRpDU3ZOi0bkAA/H0BmF/An7tYHvrFJlewpp4lH8IgkEQ+ZePbo1cXFnaxTzbzfT6WeNGvYXnL7q9mlYFis1n4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1701939786691169.99668938971513; Thu, 7 Dec 2023 01:03:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBAGy-0002Dp-Lx; Thu, 07 Dec 2023 04:02:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBAGl-0002Ad-6t for qemu-devel@nongnu.org; Thu, 07 Dec 2023 04:02:08 -0500 Received: from mgamail.intel.com ([192.55.52.120]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBAGh-00061v-Ac for qemu-devel@nongnu.org; Thu, 07 Dec 2023 04:02:05 -0500 Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 01:01:59 -0800 Received: from duan-server-s2600bt.bj.intel.com ([10.240.192.147]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 01:01:58 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701939723; x=1733475723; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=r7EYI1ufLFFP1XtnWOrwmSb/zRHEopbGjzJeGM0h1CE=; b=OuJl+XjF0Hp1schPIjymH4PEB1MEpq9pkf+ncZdGHRU+b1gajP6xXDfr QMBf4NA0IOtCsxf/cHl4u6mJXtqnEa+uFMRL5J9DafKl6KpcFmNd3LZcB Oul7aNBHKkdLypglWgZMQZHq04E4gSEDUeUXPCzjg4N+d90Gr3DCO/3mt 8/Vq/oRmoO02EOpk1bBzjuFNjxPlEYruO37/dtpxQE7HEKmzK113PREZ2 K08Pgh2RA4bTPwbqu0n1Cz7jFxhmSbpzXNEQ7DvEBNRxmRgfdd5yDMZlh 5JbpSVnkw13yraVgon/cf6ZltnVoq3Tuqg0H2QKrYNcRn/1fAG8kjKth7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="393071087" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="393071087" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="775335181" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="775335181" From: Zhenzhong Duan To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, chao.p.peng@intel.com, Zhenzhong Duan Subject: [PATCH] system: Fix location print in axexit notifier callback Date: Thu, 7 Dec 2023 16:46:09 +0800 Message-Id: <20231207084609.2288573-1-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.120; envelope-from=zhenzhong.duan@intel.com; helo=mgamail.intel.com X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1701939788785100003 Content-Type: text/plain; charset="utf-8" Some exit notifier callbacks call error_report_err if it fails to do the cleanup. If this happens on QEMU command line parse stage, i.e. there is fatal error, the location printed in error_report_err is totally unrelated to exit notifier itself. Set location to none to avoid such confusing. Before fix: qemu-system-x86_64: -device intel-iommu,device-iotlb=3Don,x-pasid-mode=3Don= : PASID based device IOTLB is not supported qemu-system-x86_64: -device intel-iommu,device-iotlb=3Don,x-pasid-mode=3Don= : network script /root/qemu/build/qemu-bundle/usr/local/etc/qemu-ifdown fai= led with status 256 After fix: qemu-system-x86_64: -device intel-iommu,device-iotlb=3Don,x-pasid-mode=3Don= : PASID based device IOTLB is not supported qemu-system-x86_64: network script /root/qemu/build/qemu-bundle/usr/local/e= tc/qemu-ifdown failed with status 256 Signed-off-by: Zhenzhong Duan --- system/runstate.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system/runstate.c b/system/runstate.c index ea9d6c2a32a4..32e9e9b541aa 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -797,6 +797,15 @@ void qemu_remove_exit_notifier(Notifier *notify) =20 static void qemu_run_exit_notifiers(void) { + /* + * Some exit notifier callbacks call error_report_err if it fails + * to do the cleanup. If this happens on QEMU command line parse + * stage, i.e. there is fatal error, the location printed in + * error_report_err is totally unrelated to exit notifier itself. + * Set location to none to avoid such confusing. + */ + loc_set_none(); + notifier_list_notify(&exit_notifiers, NULL); } =20 --=20 2.34.1