From nobody Sun May 19 01:43:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1643805929; cv=none; d=zohomail.com; s=zohoarc; b=lefDrJI/n3cPQIbWUgFVtKbRjSvF/Leuo73B84Ow41rP4EARUZWDi/MGACifgFr8Sdk8drDtjcMD9CeldoGGpq1gGdxMq9kLcohraQTaTZp83pXKPtC8z++rz5lWWjqdBwYUzyyrTiCdqVdkjA5n3nCic1w2n0+fX78BBCVbMTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643805929; 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=2kCmaZ4OAQoMznCzjoXVMBIf6sDp5XxVjx5AF62EfNg=; b=gwHKNproZXr5f1krEwYYnkAqlFSTmqCAxgR42vYDndhvE9Q40KiXljb8jvKaMlGKngS63pIGWx2QoH5pkaJ7zTowJ2ISKay+kVmJw96OdAbxIYNfKA2c8KJhPGh4hlqvmpMgrPS8xWr8sTDz4SaoumcnhZ3ANjfkIHhDT04tVmg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1643805929600751.0560571596949; Wed, 2 Feb 2022 04:45:29 -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-516-STEVHFznMZSHA7N8Jkmp7A-1; Wed, 02 Feb 2022 07:45:27 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0912084BA42; Wed, 2 Feb 2022 12:45:22 +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 D9AB423796; Wed, 2 Feb 2022 12:45:21 +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 9AF211806D2C; Wed, 2 Feb 2022 12:45:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 212CjKRc023910 for ; Wed, 2 Feb 2022 07:45:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1E40323796; Wed, 2 Feb 2022 12:45:20 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 69FCD27C2A; Wed, 2 Feb 2022 12:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643805928; 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=2kCmaZ4OAQoMznCzjoXVMBIf6sDp5XxVjx5AF62EfNg=; b=IIL/W3A/zNk1m83tIY7wRNOvaOOQrOLqJJWQVLkFJbMWp4vaIClNVkFt9T8Nx874rm3e0Q hv9iJqZH0JSm+QhyR2XPNgZjX7JQ80f5w7oYN4RZoLwAv7obt01PlYjiMfzP1Yw9ngDNPG yV8BP1vh6DCXe3zwypl1rUuFYoOngG0= X-MC-Unique: STEVHFznMZSHA7N8Jkmp7A-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/3] conf: validate serial port model in ABI checks Date: Wed, 2 Feb 2022 12:44:43 +0000 Message-Id: <20220202124445.503425-2-berrange@redhat.com> In-Reply-To: <20220202124445.503425-1-berrange@redhat.com> References: <20220202124445.503425-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.84 on 10.5.11.23 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: 1643805931712100001 The serial port model cannot be allowed to change across migration as it affects ABI. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Andrea Bolognani --- src/conf/domain_conf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 58e696416d..9415ecb13b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -21095,6 +21095,14 @@ virDomainSerialDefCheckABIStability(virDomainChrDe= f *src, return false; } =20 + if (src->targetModel !=3D dst->targetModel) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target serial model %s does not match source %s"= ), + virDomainChrSerialTargetModelTypeToString(dst->targ= etModel), + virDomainChrSerialTargetModelTypeToString(src->targ= etModel)); + return false; + } + if (src->target.port !=3D dst->target.port) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target serial port %d does not match source %d"), --=20 2.34.1 From nobody Sun May 19 01:43:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1643805934; cv=none; d=zohomail.com; s=zohoarc; b=OYbqCptlPvrQhTVZpTcD4T7ne1JtVDLIb72kSVDg1mQk+zBpJfWus1ySG21hslsAyq9wQO96NC6WIBAVzbj5Ggx8VQqpCLnSOKoP0XFS3iq9Nf7rWhSHGC1Ip3sDmax2Z37KnNQEdiUvPpzgLRjVRFL+86Qz+Fc9usg8ebN+T3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643805934; 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=5iEhlyqlfvWdnsndbeo7SHYvDXN/dnBMWFI03zLU2hY=; b=ZP1+VTGFZO2uC37Z4WCrnhWznJ4PBb0dW0BwDawKHBxQi0jQDX5/pr2BEjD+F7NTxfr72Jr2IaTKxsZ4cqcv+AHTKFaLikedpARoAo4FSh4+/+b+Tjwsghpq3HZT+kyphF2P4rZ524IiTyczyUblQHMzZs7hqbWGCYUQBCCN4S4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1643805934065540.7895724781561; Wed, 2 Feb 2022 04:45:34 -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-38-urhZUPMhPk224w1kO8FOPw-1; Wed, 02 Feb 2022 07:45:29 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6854D2F50; Wed, 2 Feb 2022 12:45:24 +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 49C1A78AB4; Wed, 2 Feb 2022 12:45:24 +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 DF4CD1806D2D; Wed, 2 Feb 2022 12:45:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 212CjLNG023915 for ; Wed, 2 Feb 2022 07:45:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 561732379F; Wed, 2 Feb 2022 12:45:21 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7085723796; Wed, 2 Feb 2022 12:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643805933; 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=5iEhlyqlfvWdnsndbeo7SHYvDXN/dnBMWFI03zLU2hY=; b=bsGNWM0nsVvlgLlGlDYWN5xTGssYprqsyzvUXOkIodcfmDbrAu/F6k/2zLVDTF2+cgr0/C ISZByKq2KYf6xtRZgl1tucSfhLqsAo6RODoNLp1zBU6v7B18Pku0Ozp9I2Wa5jnvs/pcuY lSW8jvg9VVvGZjz0uwQps46gHD36R18= X-MC-Unique: urhZUPMhPk224w1kO8FOPw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 2/3] conf: support firmware ISA debug console Date: Wed, 2 Feb 2022 12:44:44 +0000 Message-Id: <20220202124445.503425-3-berrange@redhat.com> In-Reply-To: <20220202124445.503425-1-berrange@redhat.com> References: <20220202124445.503425-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.14 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: 1643805936918100001 Introduce support for
which is used as a way to receive debug messages from the firmware on x86 platforms. Note that the default port is 0x0xe9 since that's the original Bochs debug port. Thus for use with SeaBIOS/OVMF, the iobase port needs to be explicitly set to 0x402. Signed-off-by: Daniel P. Berrang=C3=A9 --- docs/formatdomain.rst | 14 +++++++++----- docs/schemas/domaincommon.rng | 2 ++ src/conf/domain_conf.c | 18 +++++++++++++++--- src/conf/domain_conf.h | 2 ++ src/qemu/qemu_command.c | 2 ++ src/qemu/qemu_domain.c | 4 ++++ src/qemu/qemu_domain_address.c | 1 + src/qemu/qemu_validate.c | 5 +++++ 8 files changed, 40 insertions(+), 8 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index e2f99c60a6..8fa5940469 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6418,8 +6418,9 @@ values are, :since:`since 1.0.2` , ``isa-serial`` (us= able with x86 guests), ``usb-serial`` (usable whenever USB support is available) and ``pci-serial= `` (usable whenever PCI support is available); :since:`since 3.10.0` , ``spapr-vio-serial`` (usable with ppc64/pseries guests), ``system-serial`` -(usable with aarch64/virt and, :since:`since 4.7.0` , riscv/virt guests) a= nd -``sclp-serial`` (usable with s390 and s390x guests) are available as well. +(usable with aarch64/virt and, :since:`since 4.7.0` , riscv/virt guests), +``sclp-serial`` (usable with s390 and s390x guests) are available as well +and :since:`since 8.1.0` ``isa-debug`` (usable with x86 guests). =20 :since:`Since 3.10.0` , the ``target`` element can have an optional ``mode= l`` subelement; valid values for its ``name`` attribute are: ``isa-serial`` (u= sable @@ -6428,9 +6429,12 @@ with the ``isa-serial`` target type); ``usb-serial``= (usable with the target type); ``spapr-vty`` (usable with the ``spapr-vio-serial`` target t= ype); ``pl011`` and, :since:`since 4.7.0` , ``16550a`` (usable with the ``system-serial`` target type); ``sclpconsole`` and ``sclplmconsole`` (usa= ble -with the ``sclp-serial`` target type). Providing a target model is usually -unnecessary: libvirt will automatically pick one that's suitable for the c= hosen -target type, and overriding that value is generally not recommended. +with the ``sclp-serial`` target type). ``isa-debugcon`` (usable with the +``isa-debug`` target type); provides a virtual console for receiving debug +messages from the firmware on x86 platforms. :since:`Since: 8.1.0`. +Providing a target model is usually unnecessary: libvirt will automatically +pick one that's suitable for the chosen target type, and overriding that +value is generally not recommended. =20 If any of the attributes is not specified by the user, libvirt will choose= a value suitable for most users. diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 64a797de46..964b0c9e2f 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4401,6 +4401,7 @@ spapr-vio-serial system-serial sclp-serial + isa-debug @@ -4417,6 +4418,7 @@ 16550a sclpconsole sclplmconsole + isa-debugcon diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9415ecb13b..3266dd0412 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -652,6 +652,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTarget, "spapr-vio-serial", "system-serial", "sclp-serial", + "isa-debug", ); =20 VIR_ENUM_IMPL(virDomainChrChannelTarget, @@ -686,6 +687,7 @@ VIR_ENUM_IMPL(virDomainChrSerialTargetModel, "sclpconsole", "sclplmconsole", "16550a", + "isa-debugcon", ); =20 VIR_ENUM_IMPL(virDomainChrDevice, @@ -4953,6 +4955,7 @@ virDomainDefAddConsoleCompat(virDomainDef *def) =20 case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: /* Nothing to do */ break; @@ -5397,7 +5400,7 @@ virDomainChrIsaSerialDefPostParse(virDomainDef *def) } =20 =20 -static void +static int virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) { @@ -5411,6 +5414,14 @@ virDomainChrDefPostParse(virDomainChrDef *chr, chr->targetType =3D VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL; } =20 + if (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL && + chr->targetType =3D=3D VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG= && + !ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("isa-debug serial type only valid on x86 architec= ture")); + return -1; + } + if (chr->target.port =3D=3D -1 && (chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL || chr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL || @@ -5424,6 +5435,8 @@ virDomainChrDefPostParse(virDomainChrDef *chr, =20 chr->target.port =3D maxport + 1; } + + return 0; } =20 =20 @@ -5635,8 +5648,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 0731007355..b2922e8cff 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1161,6 +1161,7 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM, VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP, + VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST } virDomainChrSerialTargetType; @@ -1204,6 +1205,7 @@ typedef enum { VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE, VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_16550A, + VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_DEBUGCON, =20 VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST } virDomainChrSerialTargetModel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fc778901d1..c29543396a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9351,6 +9351,7 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTarg= etModel targetModel) case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_PL011: return QEMU_CAPS_DEVICE_PL011; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_16550A: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_DEBUGCON: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: break; @@ -10762,6 +10763,7 @@ qemuBuildSerialChrDeviceProps(const virDomainDef *d= ef, case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SPAPR_VTY: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_DEBUGCON: =20 caps =3D qemuChrSerialTargetModelToCaps(serial->targetModel); =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6b915d7535..647bb8839c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5196,6 +5196,9 @@ qemuDomainChrDefPostParse(virDomainChrDef *chr, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCO= NSOLE; break; + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG: + chr->targetModel =3D VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_DE= BUGCON; + break; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: /* Nothing to do */ @@ -6203,6 +6206,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriver *driver, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: /* Nothing to do */ diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 3e6eed6ec9..13aad4fc4d 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -995,6 +995,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDevic= eDef *dev, case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SYSTEM: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST: return 0; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 3bf39f8d93..f27e480696 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1817,6 +1817,7 @@ qemuValidateChrSerialTargetTypeToAddressType(int targ= etType) { switch ((virDomainChrSerialTargetType)targetType) { case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG: return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_ISA; case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: return VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB; @@ -1853,6 +1854,8 @@ qemuValidateChrSerialTargetModelToTargetType(int targ= etModel) case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SCLP; + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_DEBUGCON: + return VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG; case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_NONE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_LAST: break; @@ -1876,6 +1879,7 @@ qemuValidateDomainChrTargetDef(const virDomainChrDef = *chr) case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI: case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_SPAPR_VIO: + case VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA_DEBUG: =20 expected =3D qemuValidateChrSerialTargetTypeToAddressType(chr-= >targetType); =20 @@ -1915,6 +1919,7 @@ qemuValidateDomainChrTargetDef(const virDomainChrDef = *chr) case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPCONSOLE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_SCLPLMCONSOLE: case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_16550A: + case VIR_DOMAIN_CHR_SERIAL_TARGET_MODEL_ISA_DEBUGCON: =20 expected =3D qemuValidateChrSerialTargetModelToTargetType(chr-= >targetModel); =20 --=20 2.34.1 From nobody Sun May 19 01:43:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1643805937; cv=none; d=zohomail.com; s=zohoarc; b=KK/ry63EY19FyPYf7KiS07yIE927GUoCnfOBXnM/4sDdoR5pO+CelWcTllMVHL+07HrqrsT/oyZu/xHXwIiKwxC9l/rcdBQhsxQR4PbWM7FmcgVit7q6W2LgvMqaYE4cygNcbuOv6pV1eE/nrUY7yda9TJwNczvdYkE9uCbM0sw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643805937; 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=SFy8r/+QuQhmN3cDplg6GX+0hM5JZvgUSZY5M9n6uR8=; b=drlyHxuoVk+rzXmMJwXVIOyOS1EsmOMfrEDhHu1U+PNJeMnZEDZx/M8BT0y3C76x+sfv2IBby41n2SpC20gmRjL6kaRxYa10cuiH0u8X/cyIIqJJHzU2Ka9U5+f7IHhb9cscWT4SqiYdDKBzZMQgy9OYxM1z1Hp9R1rP7AiOjTI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1643805937414777.5187135642542; Wed, 2 Feb 2022 04:45:37 -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-330-Z2i0wGGAMhO3maoAu274-g-1; Wed, 02 Feb 2022 07:45:34 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1FD7B190B2C4; Wed, 2 Feb 2022 12:45:28 +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 955632A18C; Wed, 2 Feb 2022 12:45:27 +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 5FBCB1806D2D; Wed, 2 Feb 2022 12:45:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 212CjMUU023928 for ; Wed, 2 Feb 2022 07:45:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 733FA23796; Wed, 2 Feb 2022 12:45:22 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.33.36.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id B18D926347; Wed, 2 Feb 2022 12:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643805936; 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=SFy8r/+QuQhmN3cDplg6GX+0hM5JZvgUSZY5M9n6uR8=; b=LcanmQbg69Gt2yAnKXeu9lAf/qcPXqKpJbMmUME1zZXEcjFjNN7mnZtgCL14ULTZd5kvi5 Wh3rDnBRPltutLT4vDaSxt5EJpbj9JM8pGUhvof7HbOK46lRP4OFIRpIL8iw8F2gaqGeQo jE5T1ESLjX+eFLB7lGnnLqYDdCogj48= X-MC-Unique: Z2i0wGGAMhO3maoAu274-g-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 3/3] qemu: add tests for the ISA debug console command line Date: Wed, 2 Feb 2022 12:44:45 +0000 Message-Id: <20220202124445.503425-4-berrange@redhat.com> In-Reply-To: <20220202124445.503425-1-berrange@redhat.com> References: <20220202124445.503425-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.84 on 10.5.11.23 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: 1643805939517100001 The XML-to-XML test validates that we don't accidentally copy the isa-debug into a . Signed-off-by: Daniel P. Berrang=C3=A9 --- .../serial-debugcon.x86_64-latest.args | 39 +++++++++++++++++ tests/qemuxml2argvdata/serial-debugcon.xml | 29 +++++++++++++ tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmloutdata/serial-debugcon.xml | 43 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 5 files changed, 113 insertions(+) create mode 100644 tests/qemuxml2argvdata/serial-debugcon.x86_64-latest.ar= gs create mode 100644 tests/qemuxml2argvdata/serial-debugcon.xml create mode 100644 tests/qemuxml2xmloutdata/serial-debugcon.xml diff --git a/tests/qemuxml2argvdata/serial-debugcon.x86_64-latest.args b/te= sts/qemuxml2argvdata/serial-debugcon.x86_64-latest.args new file mode 100644 index 0000000000..4e026e7afa --- /dev/null +++ b/tests/qemuxml2argvdata/serial-debugcon.x86_64-latest.args @@ -0,0 +1,39 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram \ +-accel tcg \ +-cpu qemu64 \ +-m 214 \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw= ","file":"libvirt-1-storage"}' \ +-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-form= at","id":"ide0-0-0","bootindex":1}' \ +-chardev pty,id=3Dcharserial0 \ +-device '{"driver":"isa-debugcon","chardev":"charserial0","id":"serial0","= iobase":1026}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/serial-debugcon.xml b/tests/qemuxml2arg= vdata/serial-debugcon.xml new file mode 100644 index 0000000000..a41be242d2 --- /dev/null +++ b/tests/qemuxml2argvdata/serial-debugcon.xml @@ -0,0 +1,29 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 96d30f2475..b9d8885912 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1717,6 +1717,7 @@ mymain(void) DO_TEST_CAPS_LATEST("serial-file-log"); DO_TEST_CAPS_LATEST("serial-spiceport"); DO_TEST_CAPS_LATEST("serial-spiceport-nospice"); + DO_TEST_CAPS_LATEST("serial-debugcon"); =20 DO_TEST_CAPS_LATEST("console-compat"); DO_TEST_CAPS_LATEST("console-compat-auto"); diff --git a/tests/qemuxml2xmloutdata/serial-debugcon.xml b/tests/qemuxml2x= mloutdata/serial-debugcon.xml new file mode 100644 index 0000000000..6b6126fed1 --- /dev/null +++ b/tests/qemuxml2xmloutdata/serial-debugcon.xml @@ -0,0 +1,43 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + +
+ + + +
+ + + + + +
+ + + +