@@ -797,6 +797,15 @@ void qemu_remove_exit_notifier(Notifier *notify)
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);
}
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=on,x-pasid-mode=on: PASID based device IOTLB is not supported qemu-system-x86_64: -device intel-iommu,device-iotlb=on,x-pasid-mode=on: network script /root/qemu/build/qemu-bundle/usr/local/etc/qemu-ifdown failed with status 256 After fix: qemu-system-x86_64: -device intel-iommu,device-iotlb=on,x-pasid-mode=on: PASID based device IOTLB is not supported qemu-system-x86_64: network script /root/qemu/build/qemu-bundle/usr/local/etc/qemu-ifdown failed with status 256 Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com> --- system/runstate.c | 9 +++++++++ 1 file changed, 9 insertions(+)