From nobody Sun Feb 8 16:05:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1642685733; cv=none; d=zohomail.com; s=zohoarc; b=gk5t8uWc+M9M+bza6YyufTXYe3cUx2zf5m1OP4Tcy6sZHqRKwjm3rVoUHU1adCxrm23RS91tUsWkmAFDY19TQ/9r4ErU73vLn/ZlLlrwltO7dGrAVkPP9YGkbDwcVbjoL1lYsIGoct7ATcy/g7FJSSlftOtY20fZPWhWLdRG1XM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642685733; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vYOX+WkRSHwjIHx0/ZV3GgHk3FtvwhZcayfl5usHGio=; b=LUOmdITj96tgHtqLXORykFIcHqFY2MhMATTiIrJ8/ZesOlgK3w69TjIeKE+k1I4g93pjN/2cT0QcFC7V4KPc/8ztxz98jkqwN3ccIHsdG2Alh4uFmIH3cpMXCDy6rEYuD6Leei0XqUqgAg9nbdHr5HdbTe72et9KKVeAJc8LKtA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1642685733713970.8454051675883; Thu, 20 Jan 2022 05:35:33 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-vDrJMU0wOe-Y5rsBRnIouA-1; Thu, 20 Jan 2022 08:35:30 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2A33801B04; Thu, 20 Jan 2022 13:35:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 558897E225; Thu, 20 Jan 2022 13:35:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 777B01809CBA; Thu, 20 Jan 2022 13:35:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20KDXIdA006121 for ; Thu, 20 Jan 2022 08:33:18 -0500 Received: by smtp.corp.redhat.com (Postfix) id 120F27E239; Thu, 20 Jan 2022 13:33:18 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5466E7E23C; Thu, 20 Jan 2022 13:33:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1642685732; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=vYOX+WkRSHwjIHx0/ZV3GgHk3FtvwhZcayfl5usHGio=; b=bmSaK6ps7Y+meBLCu70F9ZcaCQSfKXxNEbB5wibtb3fUFC70Wgf9A51d8hBJZ3lp4Coy4E T+AU8LhfoK1PIIr1m4yi+yXZM6ZTGUMpVrNqznJXCvlHmricSEOb9qhFHGxcpJIFNY1xWs Y8Xq7B08Nu9FvqoYM9FJsMBcctuaAqY= X-MC-Unique: vDrJMU0wOe-Y5rsBRnIouA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] conf: support firmware ISA debug console Date: Thu, 20 Jan 2022 13:33:02 +0000 Message-Id: <20220120133303.452285-2-berrange@redhat.com> In-Reply-To: <20220120133303.452285-1-berrange@redhat.com> References: <20220120133303.452285-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1642685735838100001 Introduce support for which is used as a way to receive debug messages from the firmware on x86 platforms. The iobase port will default to 0x402 which is what SeaBIOS/OVMF expect normally. Signed-off-by: Daniel P. Berrang=C3=A9 --- docs/formatdomain.rst | 3 ++- docs/schemas/domaincommon.rng | 1 + src/conf/domain_conf.c | 23 +++++++++++++++++------ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 1 + 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index acd9020830..9e4e5fd036 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6483,7 +6483,8 @@ values for the ``type`` attribute are: ``serial`` (de= scribed below); ``virtio`` (usable for s390 and s390x QEMU guests) are supported for compatibility re= asons but should not be used for new guests: use the ``sclpconsole`` and ``sclplmconsole`` target models, respectively, with the ``serial`` element -instead. +instead. ``isa-debug`` provides a virtual console for receiving debug +messages from the firmware on x86 platforms. :since:`Since: 8.1.0`. =20 Of the target types listed above, ``serial`` is special in that it doesn't represents a separate device, but rather the same device as the first ``se= rial`` diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 169b8d8dee..4ff3bcda24 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4387,6 +4387,7 @@ openvz sclp sclplm + isa-debug diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 393f9d9478..c73085a513 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -672,6 +672,7 @@ VIR_ENUM_IMPL(virDomainChrConsoleTarget, "openvz", "sclp", "sclplm", + "isa-debug", ); =20 VIR_ENUM_IMPL(virDomainChrSerialTargetModel, @@ -5382,7 +5383,7 @@ virDomainChrIsaSerialDefPostParse(virDomainDef *def) } =20 =20 -static void +static int virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) { @@ -5391,9 +5392,18 @@ virDomainChrDefPostParse(virDomainChrDef *chr, =20 virDomainChrGetDomainPtrs(def, chr->deviceType, &arrPtr, &cnt); =20 - if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && - chr->targetType =3D=3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE) { - chr->targetType =3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE) { + switch (chr->targetType) { + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE: + chr->targetType =3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; + break; + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_ISA_DEBUG: + if (!ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("isa-debug console type only valid on x86= architecture")); + return -1; + } + } } =20 if (chr->target.port =3D=3D -1 && @@ -5409,6 +5419,8 @@ virDomainChrDefPostParse(virDomainChrDef *chr, =20 chr->target.port =3D maxport + 1; } + + return 0; } =20 =20 @@ -5620,8 +5632,7 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDef = *dev, =20 switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_CHR: - virDomainChrDefPostParse(dev->data.chr, def); - ret =3D 0; + ret =3D virDomainChrDefPostParse(dev->data.chr, def); break; =20 case VIR_DOMAIN_DEVICE_RNG: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e2f35fe20b..7f845b609d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1183,6 +1183,7 @@ typedef enum { VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ, VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP, VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM, + VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_ISA_DEBUG, =20 VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST } virDomainChrConsoleTargetType; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 60b4f96e06..030c27b963 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -10845,6 +10845,7 @@ qemuBuildConsoleChrDeviceProps(const virDomainDef *= def, case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LXC: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ: + case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_ISA_DEBUG: case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("unsupported console target type %s"), --=20 2.33.1