From nobody Mon Feb 9 18:19:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) client-ip=209.85.221.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1612178977; cv=none; d=zohomail.com; s=zohoarc; b=GcpWPDwVGfgMfsuVgvCCnzykT7bTAxcb0+4EV5hp6Pa6YNd+61cq3HYZAfOi5s9HbU9prnJQm1sQXiAynHPrj0BcLkkai8i139WUk1QsZtbCMODBReuCimwe4t/dfyp5fDxJqvKfuzPGodf5Qd89ta4qV5GQnev0M30plyVubbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612178977; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RGHdflD40CpleI2qTHXo49VNZ9h44Tapyh7dWA7hgYU=; b=UnyG35JqIrc1MsWjLnPAk40dw0X79af9buVIg8taYAJuyR21jFbq5Zt8ETsnjobHJc8gsX57mYesB41o4b2Hrv4ipAg8Vyl1/VC5xMA2cxBrQl1KbhYRKadCezE581hERNKwf6Vun99sUvcBIn3Z8wdByDTf+HeJXDEWTsdl5lo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by mx.zohomail.com with SMTPS id 1612178977924387.62760164940516; Mon, 1 Feb 2021 03:29:37 -0800 (PST) Received: by mail-wr1-f41.google.com with SMTP id p15so16125808wrq.8 for ; Mon, 01 Feb 2021 03:29:37 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (7.red-83-57-171.dynamicip.rima-tde.net. [83.57.171.7]) by smtp.gmail.com with ESMTPSA id d30sm28931639wrc.92.2021.02.01.03.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Feb 2021 03:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RGHdflD40CpleI2qTHXo49VNZ9h44Tapyh7dWA7hgYU=; b=FmjS7JgVOCypovovv65rLivJnwALFuw37uvTf4RtBSvcme+5wkDBdr5zU4iNwMntrn Hgt/tdJZflBiPWoHmBRxbG99i1qLXeOQhLcOcdLq9qXB0TmlTxseS1ch4a/PWI2VGyNc KhQhMpM8iJtQ5GJSdlxU9A9hqZKd4pN6UylDzcX8C0OlBu12yLaR09B56wzP2rPTQjLP vVOdaRCOy8DqkeRS6zSuluHJq/mKNmWcbYvw77lsOx940Rm9a7a3DW/Tcykdz5FQtilS Hw5P7oc0/+gBflEG2AzBjwZyrKln8W4hxuuwJMVvRwX92wB1tr9GJV1L07lkC5+RAABP ywOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=RGHdflD40CpleI2qTHXo49VNZ9h44Tapyh7dWA7hgYU=; b=oCJM7GrGo2FMjzhVK2u/LhHQUqDgrmnewt8U1pQuz4pGvGD+JfuX05nMXFYPjDvwQq lQ4rtxUVvego9/QdU8FiqHzfeuPnXl7vJ0KqMR8rS9VCppngUArlROpc9LRMmMI4o6sN uxbaeAYjannyKYy9F4EpWE2iz3A7ZTxbn9vwCDXcelXMKBq1OI0uz1x4VJks2GCiP4Qg cHnFJIIdi+Zgl8W+tnt9Agg8xw/7aw+jYRM9TSs+JBgccK3bb89ywxMK4hfl+eWXwTHx vFpNliuuV6pZj5Ba05c8mW0pJWkYgwCN8IKmJuI9hrQThiiFowMaES4Ge3zLmjqoqH/A Obbg== X-Gm-Message-State: AOAM530cEb+4NMZawVLohwsff85GAtvKoQI0fMDbG9WR6c2+wrOhl2E8 EnPxGtLvVolfgAtQjNk/GKqqJKvHSIc= X-Google-Smtp-Source: ABdhPJzvuBjmMW0UYZ6d5GxA8BEVDlhSDPc0KocqiT7XJMYbQPMV9DKL5NtfvrqJaptzIHmm77u+zg== X-Received: by 2002:adf:d1cb:: with SMTP id b11mr17935101wrd.118.1612178976190; Mon, 01 Feb 2021 03:29:36 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-devel@nongnu.org Cc: Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Stefano Stabellini , Anthony Perard , Paul Durrant , xen-devel@lists.xenproject.org, Richard Henderson , "Michael S. Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v3 5/7] hw/xen: Make xen_shutdown_fatal_error() available out of X86 HVM Date: Mon, 1 Feb 2021 12:29:03 +0100 Message-Id: <20210201112905.545144-6-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210201112905.545144-1-f4bug@amsat.org> References: <20210201112905.545144-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) xen_shutdown_fatal_error() is also used by XEN_PV. This fixes when XEN_PV without XEN_FV: /usr/bin/ld: libqemu-x86_64-softmmu.fa.p/hw_xen_xen_pt_config_init.c.o: i= n function `xen_pt_status_reg_init': hw/xen/xen_pt_config_init.c:281: undefined reference to `xen_shutdown_fat= al_error' /usr/bin/ld: hw/xen/xen_pt_config_init.c:275: undefined reference to `xen= _shutdown_fatal_error' /usr/bin/ld: libqemu-x86_64-softmmu.fa.p/hw_xen_xen_pt.c.o: in function `= xen_pt_pci_read_config': hw/xen/xen_pt.c:220: undefined reference to `xen_shutdown_fatal_error' /usr/bin/ld: libqemu-x86_64-softmmu.fa.p/hw_xen_xen_pt.c.o: in function `= xen_pt_pci_write_config': hw/xen/xen_pt.c:369: undefined reference to `xen_shutdown_fatal_error' Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/xen/xen-hvm.c | 13 ------------- hw/xen/xen-utils.c | 25 +++++++++++++++++++++++++ hw/xen/meson.build | 1 + 3 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 hw/xen/xen-utils.c diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 7156ab13329..69196754a30 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -28,7 +28,6 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/range.h" -#include "sysemu/runstate.h" #include "sysemu/sysemu.h" #include "sysemu/xen.h" #include "trace.h" @@ -1570,18 +1569,6 @@ void xen_register_framebuffer(MemoryRegion *mr) framebuffer =3D mr; } =20 -void xen_shutdown_fatal_error(const char *fmt, ...) -{ - va_list ap; - - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fprintf(stderr, "Will destroy the domain.\n"); - /* destroy the domain */ - qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); -} - void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length) { if (unlikely(xen_in_migration)) { diff --git a/hw/xen/xen-utils.c b/hw/xen/xen-utils.c new file mode 100644 index 00000000000..d6003782420 --- /dev/null +++ b/hw/xen/xen-utils.c @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2010 Citrix Ltd. + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + * + * Contributions after 2012-01-13 are licensed under the terms of the + * GNU GPL, version 2 or (at your option) any later version. + */ + +#include "qemu/osdep.h" +#include "sysemu/runstate.h" +#include "hw/xen/xen_common.h" + +void xen_shutdown_fatal_error(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + fprintf(stderr, "Will destroy the domain.\n"); + /* destroy the domain */ + qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); +} diff --git a/hw/xen/meson.build b/hw/xen/meson.build index 3c2062b9b3e..6c836ae06e4 100644 --- a/hw/xen/meson.build +++ b/hw/xen/meson.build @@ -4,6 +4,7 @@ 'xen-bus.c', 'xen_devconfig.c', 'xen_pvdev.c', + 'xen-utils.c', )) =20 xen_specific_ss =3D ss.source_set() --=20 2.26.2