From nobody Mon Apr 29 05:29:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526914865237921.704049738452; Mon, 21 May 2018 08:01:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 442F8AD8A7; Mon, 21 May 2018 15:01:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 37BD060A9E; Mon, 21 May 2018 15:01:01 +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 D531D4CA95; Mon, 21 May 2018 15:00:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LF0v7O018114 for ; Mon, 21 May 2018 11:00:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6C096215CDAC; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49A20215CDA7 for ; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 505CF12001F for ; Mon, 21 May 2018 17:00:56 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:00:49 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/5] docs: Tiny fix for the SMM description 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 21 May 2018 15:01:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The default is actually `on` when `` is specified. Signed-off-by: Martin Kletzander Reviewed-by: John Ferlan --- docs/formatdomain.html.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0d0fd3b9f3ea..403b638bd4bd 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2052,9 +2052,9 @@ Since 1.2.16
smm
-
Enable System Management Mode. Possible values are - on and off. The default is left - for hypervisor to decide. +
Depending on the state attribute (values on, + off, default on) enable or disable + System Management Mode. Since 2.1.0
ioapic
--=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:29:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526914865217231.61255121274928; Mon, 21 May 2018 08:01:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31C563113B46; Mon, 21 May 2018 15:01:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BC7B5D756; Mon, 21 May 2018 15:01:01 +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 EA0AE4CAA0; Mon, 21 May 2018 15:00:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LF0vcK018115 for ; Mon, 21 May 2018 11:00:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92D812024CC7; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 54484200BCCB for ; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 5B62E120020 for ; Mon, 21 May 2018 17:00:56 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:00:50 +0200 Message-Id: <85e343de944def6154c599ecda53bc70688ab60a.1526913931.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/5] qemu: Move checks for SMM from command-line creation into validation phase 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 21 May 2018 15:01:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We are still hoping all of such checks will be moved there and this is one = small step in that direction. One of the things that this is improving is the error message you get when starting a domain with SMM and i440fx, for example. Instead of saying that= the QEMU binary doesn't support that option, we correctly say that it is only supported with q35 machine type. Signed-off-by: Martin Kletzander Reviewed-by: John Ferlan --- src/qemu/qemu_capabilities.c | 21 +++++++++++++++------ src/qemu/qemu_capabilities.h | 4 ++-- src/qemu/qemu_command.c | 12 ++---------- src/qemu/qemu_domain.c | 12 +++++++++--- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bface72de272..ebe35573e7cd 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4561,14 +4561,23 @@ virQEMUCapsSupportsVmport(virQEMUCapsPtr qemuCaps, } =20 =20 -bool -virQEMUCapsSupportsSMM(virQEMUCapsPtr qemuCaps, - const virDomainDef *def) +int +virQEMUCapsCheckSMMSupport(virQEMUCapsPtr qemuCaps, + const virDomainDef *def) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_SMM_OPT)) - return false; + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_SMM_OPT)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("smm is not available with this QEMU binary")); + return -1; + } =20 - return qemuDomainIsQ35(def); + if (!qemuDomainIsQ35(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("smm is only supported with q35 machine type")); + return -1; + } + + return 0; } =20 =20 diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 6f9953478a4e..8b6c0c89f4f5 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -497,8 +497,8 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps, bool virQEMUCapsSupportsVmport(virQEMUCapsPtr qemuCaps, const virDomainDef *def); =20 -bool virQEMUCapsSupportsSMM(virQEMUCapsPtr qemuCaps, - const virDomainDef *def); +int virQEMUCapsCheckSMMSupport(virQEMUCapsPtr qemuCaps, + const virDomainDef *def); =20 char *virQEMUCapsFlagsString(virQEMUCapsPtr qemuCaps); =20 diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 9da2d609e8b7..328f3c0a2386 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7041,16 +7041,8 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virTristateSwitchTypeToString(vmport)); } =20 - if (smm) { - if (!virQEMUCapsSupportsSMM(qemuCaps, def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("smm is not available with this QEMU binary")= ); - goto cleanup; - } - - virBufferAsprintf(&buf, ",smm=3D%s", - virTristateSwitchTypeToString(smm)); - } + if (smm) + virBufferAsprintf(&buf, ",smm=3D%s", virTristateSwitchTypeToString= (smm)); =20 if (def->mem.dump_core) { virBufferAsprintf(&buf, ",dump-guest-core=3D%s", diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d3beee5d8760..881d0ea46a75 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3430,7 +3430,8 @@ qemuDomainDefGetVcpuHotplugGranularity(const virDomai= nDef *def) =20 =20 static int -qemuDomainDefValidateFeatures(const virDomainDef *def) +qemuDomainDefValidateFeatures(const virDomainDef *def, + virQEMUCapsPtr qemuCaps) { size_t i; =20 @@ -3477,6 +3478,12 @@ qemuDomainDefValidateFeatures(const virDomainDef *de= f) } break; =20 + case VIR_DOMAIN_FEATURE_SMM: + if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON && + virQEMUCapsCheckSMMSupport(qemuCaps, def) < 0) + return -1; + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: @@ -3489,7 +3496,6 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_VMPORT: - case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_VMCOREINFO: case VIR_DOMAIN_FEATURE_LAST: break; @@ -3612,7 +3618,7 @@ qemuDomainDefValidate(const virDomainDef *def, } } =20 - if (qemuDomainDefValidateFeatures(def) < 0) + if (qemuDomainDefValidateFeatures(def, qemuCaps) < 0) goto cleanup; =20 ret =3D 0; --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:29:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526914864389391.23205926453477; Mon, 21 May 2018 08:01:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D139C1217E2; Mon, 21 May 2018 15:01:02 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3FADF977D5; Mon, 21 May 2018 15:01:01 +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 A91A34CAA7; Mon, 21 May 2018 15:01:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LF0vkI018116 for ; Mon, 21 May 2018 11:00:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9BBDA215CDA7; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5DD5B215CDAA for ; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 667AF120022 for ; Mon, 21 May 2018 17:00:56 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:00:51 +0200 Message-Id: <30454d50d4748d2430f0fc14db9acedb8258030c.1526913931.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/5] conf, schema, docs: Add support for TSEG size setting 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 21 May 2018 15:01:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" TSEG (Top of Memory Segment) is one of many regions that SMM (System Manage= ment Mode) can occupy. This one, however is special, because a) most of the SMM= code lives in TSEG nowadays and b) QEMU just (well, some time ago) added support= for so called 'extended' TSEG. The difference to the TSEG implemented in real = q35's MCH (Memory Controller Hub) is that it can have any size from 1 MiB up to 6= 5534 MiB in 1 MiB increments. But more about that in the QEMU patch. Signed-off-by: Martin Kletzander Reviewed-by: John Ferlan --- docs/formatdomain.html.in | 39 +++++++++++++++++++ docs/schemas/domaincommon.rng | 5 +++ src/conf/domain_conf.c | 60 ++++++++++++++++++++++++++++- src/conf/domain_conf.h | 1 + tests/genericxml2xmlindata/tseg.xml | 23 +++++++++++ tests/genericxml2xmltest.c | 2 + 6 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 tests/genericxml2xmlindata/tseg.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 403b638bd4bd..39ebfe398bd7 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1897,6 +1897,9 @@ <ioapic driver=3D'qemu'/> <hpt resizing=3D'required'/> <vmcoreinfo state=3D'on'/> + <smm state=3D'on'> + <tseg unit=3D'MiB'>48</tseg> + </smm> </features> ... =20 @@ -2056,6 +2059,42 @@ off, default on) enable or disable System Management Mode. Since 2.1.0 + + Optional sub-element tseg can be used to specify the + amount of memory dedicated to SMM TSEG. The size can be specifie= d as a + value of that element, optional attribute unit can = be + used to specify the unit of the aforementioned value (defaults to + 'MiB'). + + This value is configurable due to the fact that the calculation = cannot + be done right with the guarantee that it will work correctly. F= or + QEMU TSEG was disabled up to and including pc-q35-2.9 (it + does not make sense fo any other machine type than q35). + From pc-q35-2.10 the default value was changed to 1= 6 MiB. + That should suffice for up to 272 VCPUs, 5 GiB guest RAM in tota= l, no + hotplug memory range, and 32 GiB of 64-bit PCI MMIO aperture. O= r for + 48 VCPUs, with 1TB of guest RAM, no hotplug DIMM range, and 32GB= of + 64-bit PCI MMIO aperture. The values may also vary based on the = loader + the VM is using. + + Additional size might be needed for significantly higher VCPU co= unts + or increased address space (that can be memory, maxMemory, 64-bi= t PCI + MMIO aperture size; roughly 8 MiB of TSEG per 1 TiB of address s= pace) + which can also be rounded up. + + Due to the nature of this setting being similar to "how much RAM + should the guest have" users are advised to either consult the + documentation of the guest OS or loader (if there is any), or te= st + this by trial-and-error changing the value until the VM boots + successfully. Yet another guiding value for users might be the = fact + that 48 MiB should be enough for pretty large guests (240 VCPUs = and + 4TB guest RAM), but it is on purpose not set as default as 48 Mi= B of + unavailable RAM might be too much for small guests (e.g. with 51= 2 MiB + of RAM). + + See Memory Allocation + for more details about the unit attribute. + Since 4.5.0 (QEMU only)
ioapic
Tune the I/O APIC. Possible values for the diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 71ac3d079c32..664ec79933f0 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4785,6 +4785,11 @@ + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 3689ac0a82ce..6a4f8243183d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -19647,6 +19647,16 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(nodes); } =20 + if (def->features[VIR_DOMAIN_FEATURE_SMM] =3D=3D VIR_TRISTATE_SWITCH_O= N && + virDomainParseScaledValue("string(./features/smm/tseg)", + "string(./features/smm/tseg/@unit)", + ctxt, + &def->tseg_size, + 1024 * 1024, /* Defaults to mebibytes */ + ULLONG_MAX, + false) < 0) + goto error; + if ((n =3D virXPathNodeSet("./features/capabilities/*", ctxt, &nodes))= < 0) goto error; =20 @@ -21741,6 +21751,23 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } } =20 + /* smm */ + if (src->features[VIR_DOMAIN_FEATURE_SMM] =3D=3D VIR_TRISTATE_SWITCH_O= N && + src->tseg_size !=3D dst->tseg_size) { + const char *unit_src, *unit_dst; + unsigned long long short_size_src =3D virFormatIntPretty(src->tseg= _size, + &unit_src); + unsigned long long short_size_dst =3D virFormatIntPretty(dst->tseg= _size, + &unit_dst); + + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Size of SMM TSEG size differs: " + "source: '%llu %s', destination: '%llu %s'"), + short_size_src, unit_src, + short_size_dst, unit_dst); + return false; + } + return true; } =20 @@ -27059,7 +27086,6 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_VMPORT: - case VIR_DOMAIN_FEATURE_SMM: switch ((virTristateSwitch) def->features[i]) { case VIR_TRISTATE_SWITCH_LAST: case VIR_TRISTATE_SWITCH_ABSENT: @@ -27076,6 +27102,38 @@ virDomainDefFormatInternal(virDomainDefPtr def, =20 break; =20 + case VIR_DOMAIN_FEATURE_SMM: + switch ((virTristateSwitch) def->features[i]) { + case VIR_TRISTATE_SWITCH_LAST: + case VIR_TRISTATE_SWITCH_ABSENT: + break; + + case VIR_TRISTATE_SWITCH_ON: + virBufferAddLit(buf, "tseg_size) { + virBufferAddLit(buf, "/>\n"); + } else { + const char *unit; + unsigned long long short_size =3D virFormatIntPret= ty(def->tseg_size, + = &unit); + + virBufferAddLit(buf, ">\n"); + virBufferAdjustIndent(buf, 2); + virBufferAsprintf(buf, "%llu\n", + unit, short_size); + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + } + + break; + + case VIR_TRISTATE_SWITCH_OFF: + virBufferAddLit(buf, "\n"); + break; + } + + break; + case VIR_DOMAIN_FEATURE_APIC: if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) { virBufferAddLit(buf, " + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + 48 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index d8270a6cae82..daad6e0f78d8 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -141,6 +141,8 @@ mymain(void) DO_TEST_FULL("cachetune-colliding-types", false, true, TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE); =20 + DO_TEST("tseg"); + virObjectUnref(caps); virObjectUnref(xmlopt); =20 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:29:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526914878036912.0235606045175; Mon, 21 May 2018 08:01:18 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 937B430C09B4; Mon, 21 May 2018 15:01:14 +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 37BDE6016F; Mon, 21 May 2018 15:01:14 +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 A2E62180B536; Mon, 21 May 2018 15:01:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LF0wx5018129 for ; Mon, 21 May 2018 11:00:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id E1806200BCCB; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 695942017D20 for ; Mon, 21 May 2018 15:00:57 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 719CB120023 for ; Mon, 21 May 2018 17:00:56 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:00:52 +0200 Message-Id: <1903d95bcfd661592d030fb098c028ed8e692864.1526913931.git.mkletzan@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/5] qemu: Add capability flag for setting the extended tseg size 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 21 May 2018 15:01:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Martin Kletzander Reviewed-by: John Ferlan --- src/qemu/qemu_capabilities.c | 10 +++ src/qemu/qemu_capabilities.h | 2 + .../caps_1.5.3.x86_64.replies | 38 +++++++++-- .../caps_1.5.3.x86_64.xml | 3 +- .../caps_1.6.0.x86_64.replies | 38 +++++++++-- .../caps_1.6.0.x86_64.xml | 3 +- .../caps_1.7.0.x86_64.replies | 38 +++++++++-- .../caps_1.7.0.x86_64.xml | 3 +- .../caps_2.1.1.x86_64.replies | 38 +++++++++-- .../caps_2.1.1.x86_64.xml | 3 +- .../caps_2.10.0.x86_64.replies | 48 ++++++++++--- .../caps_2.10.0.x86_64.xml | 3 +- .../caps_2.12.0.x86_64.replies | 67 +++++++++++++++---- .../caps_2.12.0.x86_64.xml | 4 +- .../caps_2.4.0.x86_64.replies | 38 +++++++++-- .../caps_2.4.0.x86_64.xml | 3 +- .../caps_2.5.0.x86_64.replies | 40 +++++++++-- .../caps_2.5.0.x86_64.xml | 3 +- .../caps_2.6.0.x86_64.replies | 40 +++++++++-- .../caps_2.6.0.x86_64.xml | 3 +- .../caps_2.7.0.x86_64.replies | 40 +++++++++-- .../caps_2.7.0.x86_64.xml | 3 +- .../caps_2.8.0.x86_64.replies | 40 +++++++++-- .../caps_2.8.0.x86_64.xml | 3 +- .../caps_2.9.0.x86_64.replies | 48 ++++++++++--- .../caps_2.9.0.x86_64.xml | 3 +- 26 files changed, 458 insertions(+), 104 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ebe35573e7cd..025f3617fee5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -487,6 +487,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, /* 300 */ "sdl-gl", "screendump_device", + "mch", + "mch.extended-tseg-mbytes", ); =20 =20 @@ -1117,6 +1119,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[= ] =3D { { "pr-manager-helper", QEMU_CAPS_PR_MANAGER_HELPER }, { "virtual-css-bridge", QEMU_CAPS_CCW }, { "vfio-ccw", QEMU_CAPS_DEVICE_VFIO_CCW }, + { "mch", QEMU_CAPS_DEVICE_MCH }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[]= =3D { @@ -1262,6 +1265,10 @@ static struct virQEMUCapsStringFlags virQEMUCapsObje= ctPropsVirtualCSSBridge[] =3D { "cssid-unrestricted", QEMU_CAPS_CCW_CSSID_UNRESTRICTED }, }; =20 +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsMCH[] =3D { + { "extended-tseg-mbytes", QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES }, +}; + /* see documentation for virQEMUQAPISchemaPathGet for the query format */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] =3D { { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUS= TER_DEBUG_LEVEL}, @@ -1391,6 +1398,9 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDevicePr= ops[] =3D { { "virtual-css-bridge", virQEMUCapsObjectPropsVirtualCSSBridge, ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtualCSSBridge), QEMU_CAPS_CCW }, + { "mch", virQEMUCapsDevicePropsMCH, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsMCH), + QEMU_CAPS_DEVICE_MCH }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFi= le[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 8b6c0c89f4f5..5c4b83d83a1e 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -471,6 +471,8 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ /* 300 */ QEMU_CAPS_SDL_GL, /* -sdl gl */ QEMU_CAPS_SCREENDUMP_DEVICE, /* screendump command accepts device & he= ad */ + QEMU_CAPS_DEVICE_MCH, /* Northbridge in q35 machine types */ + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES, /* -global mch.extended-tseg-mbyte= s */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies b/tests/q= emucapabilitiesdata/caps_1.5.3.x86_64.replies index 8da1b149d09f..dd501221ade9 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.replies @@ -2044,6 +2044,32 @@ "id": "libvirt-36" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-37" +} + { "return": [ { @@ -2114,7 +2140,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -2192,19 +2218,19 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { "return": [ ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -2905,7 +2931,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -2915,7 +2941,7 @@ "capability": "xbzrle" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.5.3.x86_64.xml index e7c2e9a181aa..556466b858aa 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.5.3.x86_64.xml @@ -105,9 +105,10 @@ + 1005003 0 - 46523 + 46889 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_1.6.0.x86_64.replies index d53fb576d266..09b2b9d4a4fa 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.replies @@ -2089,6 +2089,32 @@ "id": "libvirt-36" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-37" +} + { "return": [ { @@ -2167,7 +2193,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -2245,19 +2271,19 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { "return": [ ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -2860,7 +2886,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -2882,7 +2908,7 @@ "capability": "zero-blocks" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.6.0.x86_64.xml index e57dec321d4c..9a7ad7c3e6ee 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.6.0.x86_64.xml @@ -110,9 +110,10 @@ + 1006000 0 - 44752 + 45118 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_1.7.0.x86_64.replies index 4fcc7aa25a2e..72ba4c27e833 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.replies @@ -2106,6 +2106,32 @@ "id": "libvirt-36" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-37" +} + { "return": [ { @@ -2192,7 +2218,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -2270,19 +2296,19 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { "return": [ ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -3075,7 +3101,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -3097,7 +3123,7 @@ "capability": "zero-blocks" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_1.7.0.x86_64.xml index 39ec8f9b1d71..5f83d26045bf 100644 --- a/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_1.7.0.x86_64.xml @@ -112,9 +112,10 @@ + 1007000 0 - 50196 + 50562 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.1.1.x86_64.replies index 543bce9defc1..1a21b7e8d9a7 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.replies @@ -2523,6 +2523,32 @@ "id": "libvirt-36" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-37" +} + { "return": [ { @@ -2625,7 +2651,7 @@ "cpu-max": 255 } ], - "id": "libvirt-37" + "id": "libvirt-38" } =20 { @@ -2706,21 +2732,21 @@ "name": "qemu64" } ], - "id": "libvirt-38" + "id": "libvirt-39" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-39" + "id": "libvirt-40" } =20 { "return": [ "passthrough" ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -3580,7 +3606,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -3602,7 +3628,7 @@ "capability": "zero-blocks" } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.1.1.x86_64.xml index afe0882dde28..e3c168de2428 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.1.1.x86_64.xml @@ -128,9 +128,10 @@ + 2001001 0 - 58992 + 59358 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies b/tests/= qemucapabilitiesdata/caps_2.10.0.x86_64.replies index 6c6ecc26874c..a32bcc7ba0fa 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.replies @@ -4471,6 +4471,32 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -4657,7 +4683,7 @@ "alias": "q35" } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -4992,21 +5018,21 @@ "migration-safe": true } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -6285,7 +6311,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -6335,7 +6361,7 @@ "capability": "return-path" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -16058,7 +16084,7 @@ "meta-type": "object" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -16237,7 +16263,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } =20 { @@ -16480,7 +16506,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } =20 { @@ -16659,7 +16685,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } =20 { @@ -16902,7 +16928,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.10.0.x86_64.xml index 77ca3013b5ab..1fea178f2b68 100644 --- a/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.10.0.x86_64.xml @@ -197,9 +197,10 @@ + 2010000 0 - 344938 + 345304 (v2.10.0) x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/= qemucapabilitiesdata/caps_2.12.0.x86_64.replies index c40046beef6b..78e1b450cda3 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -4605,6 +4605,49 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "x-pcie-lnksta-dllla", + "description": "on/off", + "type": "bool" + }, + { + "name": "multifunction", + "description": "on/off", + "type": "bool" + }, + { + "name": "extended-tseg-mbytes", + "type": "uint16" + }, + { + "name": "romfile", + "type": "str" + }, + { + "name": "x-pcie-extcap-init", + "description": "on/off", + "type": "bool" + }, + { + "name": "command_serr_enable", + "description": "on/off", + "type": "bool" + }, + { + "name": "addr", + "description": "Slot and optional function number, example: 06.0 or = 06", + "type": "int32" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -4656,7 +4699,7 @@ "type": "string" } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -4855,7 +4898,7 @@ "cpu-max": 255 } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { @@ -5369,7 +5412,7 @@ "migration-safe": true } ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { @@ -5377,7 +5420,7 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -5385,7 +5428,7 @@ "passthrough", "emulator" ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -6672,7 +6715,7 @@ "option": "drive" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -6734,7 +6777,7 @@ "capability": "dirty-bitmaps" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -18102,7 +18145,7 @@ "meta-type": "object" } ], - "id": "libvirt-47" + "id": "libvirt-48" } =20 { @@ -18292,7 +18335,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } =20 { @@ -18547,7 +18590,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } =20 { @@ -18737,7 +18780,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } =20 { @@ -18992,7 +19035,7 @@ } } }, - "id": "libvirt-51" + "id": "libvirt-52" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemu= capabilitiesdata/caps_2.12.0.x86_64.xml index 820b3ef75984..3c4bdcfd9094 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -201,9 +201,11 @@ + + 2011090 0 - 390813 + 391586 v2.12.0-rc0 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.4.0.x86_64.replies index 68ecb0c17dc7..bf8e7b4379ff 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.replies @@ -3114,6 +3114,32 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -3240,7 +3266,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -3330,21 +3356,21 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -4352,7 +4378,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4382,7 +4408,7 @@ "capability": "events" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.4.0.x86_64.xml index 871eb5e4a702..2c2162460072 100644 --- a/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.4.0.x86_64.xml @@ -154,9 +154,10 @@ + 2004000 0 - 75406 + 75772 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.5.0.x86_64.replies index 5bc505abb32c..57bf70f0e29b 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.replies @@ -3277,6 +3277,32 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -3411,7 +3437,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -3501,21 +3527,21 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -4560,7 +4586,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4594,7 +4620,7 @@ "capability": "x-postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -12139,7 +12165,7 @@ "meta-type": "array" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.5.0.x86_64.xml index 90dce5a700be..3f33a272677c 100644 --- a/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.5.0.x86_64.xml @@ -160,9 +160,10 @@ + 2005000 0 - 216528 + 216894 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.6.0.x86_64.replies index 73a22ed0bb95..436c824c14e8 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.replies @@ -3359,6 +3359,32 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -3469,7 +3495,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -3559,21 +3585,21 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -4667,7 +4693,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4701,7 +4727,7 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -12706,7 +12732,7 @@ "meta-type": "array" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.6.0.x86_64.xml index 4c6371a6cd07..88b33038fb81 100644 --- a/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.6.0.x86_64.xml @@ -172,9 +172,10 @@ + 2006000 0 - 227332 + 227698 x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.7.0.x86_64.replies index eaa84d3381a6..9d71070b0831 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.replies @@ -3554,6 +3554,32 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -3700,7 +3726,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -3793,21 +3819,21 @@ "name": "qemu64" } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -4905,7 +4931,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -4939,7 +4965,7 @@ "capability": "postcopy-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -13295,7 +13321,7 @@ "meta-type": "object" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.7.0.x86_64.xml index c322d18d7da5..e4e7a7b0e167 100644 --- a/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.7.0.x86_64.xml @@ -177,9 +177,10 @@ + 2007000 0 - 239029 + 239395 (v2.7.0) x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.8.0.x86_64.replies index 30d28c7b5f4a..336f9fbca2f6 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.replies @@ -3696,6 +3696,32 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -3862,7 +3888,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -4068,21 +4094,21 @@ "static": false } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -5205,7 +5231,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -5243,7 +5269,7 @@ "capability": "x-colo" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -14013,7 +14039,7 @@ "meta-type": "object" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.8.0.x86_64.xml index 7c329ad4c702..3b93c5871527 100644 --- a/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.8.0.x86_64.xml @@ -179,9 +179,10 @@ + 2008000 0 - 255684 + 256050 (v2.8.0) x86_64 diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies b/tests/q= emucapabilitiesdata/caps_2.9.0.x86_64.replies index 5da1b41c2ee1..b03e3d495045 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.replies @@ -4015,6 +4015,32 @@ "id": "libvirt-39" } =20 +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-40" +} + { "return": [ { @@ -4191,7 +4217,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } =20 { @@ -4473,21 +4499,21 @@ "migration-safe": true } ], - "id": "libvirt-41" + "id": "libvirt-42" } =20 { "return": [ "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } =20 { "return": [ "passthrough" ], - "id": "libvirt-43" + "id": "libvirt-44" } =20 { @@ -5736,7 +5762,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } =20 { @@ -5778,7 +5804,7 @@ "capability": "release-ram" } ], - "id": "libvirt-45" + "id": "libvirt-46" } =20 { @@ -15064,7 +15090,7 @@ "meta-type": "object" } ], - "id": "libvirt-46" + "id": "libvirt-47" } =20 { @@ -15243,7 +15269,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } =20 { @@ -15484,7 +15510,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } =20 { @@ -15663,7 +15689,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } =20 { @@ -15904,7 +15930,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } =20 { diff --git a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml b/tests/qemuc= apabilitiesdata/caps_2.9.0.x86_64.xml index 0701c244f63a..47fda742634c 100644 --- a/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml @@ -192,9 +192,10 @@ + 2009000 0 - 320947 + 321313 (v2.9.0) x86_64 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 05:29:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526914878424180.4257769944993; Mon, 21 May 2018 08:01:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C2B1398A4F; Mon, 21 May 2018 15:01:14 +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 3048710018F9; Mon, 21 May 2018 15:01:14 +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 A1AC51801250; Mon, 21 May 2018 15:01:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LF11cp018152 for ; Mon, 21 May 2018 11:01:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1CC928577A; Mon, 21 May 2018 15:01:01 +0000 (UTC) Received: from caroline (unknown [10.43.2.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5802AFD79 for ; Mon, 21 May 2018 15:00:58 +0000 (UTC) Received: from caroline.brq.redhat.com (caroline.usersys.redhat.com [127.0.0.1]) by caroline (Postfix) with ESMTP id 7CDDD120024 for ; Mon, 21 May 2018 17:00:56 +0200 (CEST) From: Martin Kletzander To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:00:53 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/5] qemu: Add support for setting the TSEG size 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 21 May 2018 15:01:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1469338 Signed-off-by: Martin Kletzander Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_command.c | 18 ++++ src/qemu/qemu_domain.c | 84 +++++++++++++++++++ .../qemuxml2argvdata/tseg-explicit-size.args | 28 +++++++ tests/qemuxml2argvdata/tseg-explicit-size.xml | 23 +++++ tests/qemuxml2argvdata/tseg-i440fx.xml | 23 +++++ tests/qemuxml2argvdata/tseg-invalid-size.xml | 23 +++++ .../tseg-old-machine-type.args | 27 ++++++ .../tseg-old-machine-type.xml | 21 +++++ tests/qemuxml2argvdata/tseg.args | 28 +++++++ tests/qemuxml2argvdata/tseg.xml | 21 +++++ tests/qemuxml2argvtest.c | 48 +++++++++++ .../qemuxml2xmloutdata/tseg-explicit-size.xml | 46 ++++++++++ .../tseg-old-machine-type.xml | 44 ++++++++++ tests/qemuxml2xmloutdata/tseg.xml | 46 ++++++++++ tests/qemuxml2xmltest.c | 25 ++++++ 15 files changed, 505 insertions(+) create mode 100644 tests/qemuxml2argvdata/tseg-explicit-size.args create mode 100644 tests/qemuxml2argvdata/tseg-explicit-size.xml create mode 100644 tests/qemuxml2argvdata/tseg-i440fx.xml create mode 100644 tests/qemuxml2argvdata/tseg-invalid-size.xml create mode 100644 tests/qemuxml2argvdata/tseg-old-machine-type.args create mode 100644 tests/qemuxml2argvdata/tseg-old-machine-type.xml create mode 100644 tests/qemuxml2argvdata/tseg.args create mode 100644 tests/qemuxml2argvdata/tseg.xml create mode 100644 tests/qemuxml2xmloutdata/tseg-explicit-size.xml create mode 100644 tests/qemuxml2xmloutdata/tseg-old-machine-type.xml create mode 100644 tests/qemuxml2xmloutdata/tseg.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 328f3c0a2386..36f557676fb0 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7200,6 +7200,22 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, return ret; } =20 + +static void +qemuBuildTSEGCommandLine(virCommandPtr cmd, + const virDomainDef *def) +{ + if (!def->tseg_size) + return; + + virCommandAddArg(cmd, "-global"); + + /* PostParse callback guarantees that the size is divisible by 1 MiB */ + virCommandAddArgFormat(cmd, "mch.extended-tseg-mbytes=3D%llu", + def->tseg_size >> 20); +} + + static int qemuBuildSmpCommandLine(virCommandPtr cmd, virDomainDefPtr def) @@ -9921,6 +9937,8 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, if (qemuBuildMachineCommandLine(cmd, cfg, def, qemuCaps) < 0) goto error; =20 + qemuBuildTSEGCommandLine(cmd, def); + if (qemuBuildCpuCommandLine(cmd, driver, def, qemuCaps) < 0) goto error; =20 diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 881d0ea46a75..3ea9e3d47344 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3319,6 +3319,87 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def) } =20 =20 +static int +qemuDomainSetDefaultTsegSize(virDomainDef *def, + virQEMUCapsPtr qemuCaps) +{ + const char *machine =3D NULL; + char *end_ptr =3D NULL; + unsigned int major =3D 0; + unsigned int minor =3D 0; + + def->tseg_size =3D 0; + + if (!qemuDomainIsQ35(def)) + return 0; + + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES)) + return 0; + + machine =3D STRSKIP(def->os.machine, "pc-q35-"); + + if (!machine) + goto error; + + if (virStrToLong_uip(machine, &end_ptr, 10, &major) < 0) + goto error; + + if (*end_ptr !=3D '.') + goto error; + + machine =3D end_ptr + 1; + + if (virStrToLong_uip(machine, &end_ptr, 10, &minor) < 0) + goto error; + if (*end_ptr !=3D '\0') + goto error; + + /* QEMU started defaulting to 16MiB after 2.9 */ + if (major > 2 || (major =3D=3D 2 && minor > 9)) + def->tseg_size =3D 16 * 1024 * 1024; + + return 0; + + error: + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Cannot parse QEMU machine type version '%s'"), + def->os.machine); + return -1; +} + + +static int +qemuDomainDefTsegPostParse(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) +{ + if (def->features[VIR_DOMAIN_FEATURE_SMM] !=3D VIR_TRISTATE_SWITCH_ON) + return 0; + + if (!def->tseg_size) + return qemuDomainSetDefaultTsegSize(def, qemuCaps); + + if (!qemuDomainIsQ35(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("SMM TSEG is only supported with q35 machine type= ")); + return -1; + } + + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Setting TSEG size is not supported with this QEM= U binary")); + return -1; + } + + if (VIR_ROUND_UP(def->tseg_size, 1024 * 1024) !=3D def->tseg_size) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("SMM TSEG size must be divisible by 1 MiB")); + return -1; + } + + return 0; +} + + static int qemuDomainDefPostParseBasic(virDomainDefPtr def, virCapsPtr caps, @@ -3389,6 +3470,9 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuDomainDefCPUPostParse(def) < 0) goto cleanup; =20 + if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0) + goto cleanup; + ret =3D 0; cleanup: virObjectUnref(cfg); diff --git a/tests/qemuxml2argvdata/tseg-explicit-size.args b/tests/qemuxml= 2argvdata/tseg-explicit-size.args new file mode 100644 index 000000000000..d49c81697e43 --- /dev/null +++ b/tests/qemuxml2argvdata/tseg-explicit-size.args @@ -0,0 +1,28 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc-q35-2.10,accel=3Dtcg,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ +-global mch.extended-tseg-mbytes=3D48 \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot c \ +-device i82801b11-bridge,id=3Dpci.1,bus=3Dpcie.0,addr=3D0x1e \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.1,addr=3D0x0 \ +-device ioh3420,port=3D0x10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x2= \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.2,addr=3D0x1 diff --git a/tests/qemuxml2argvdata/tseg-explicit-size.xml b/tests/qemuxml2= argvdata/tseg-explicit-size.xml new file mode 100644 index 000000000000..ae3121048495 --- /dev/null +++ b/tests/qemuxml2argvdata/tseg-explicit-size.xml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + 48 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/qemuxml2argvdata/tseg-i440fx.xml b/tests/qemuxml2argvdat= a/tseg-i440fx.xml new file mode 100644 index 000000000000..5bd832d50829 --- /dev/null +++ b/tests/qemuxml2argvdata/tseg-i440fx.xml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + 48 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/qemuxml2argvdata/tseg-invalid-size.xml b/tests/qemuxml2a= rgvdata/tseg-invalid-size.xml new file mode 100644 index 000000000000..3ac8069a81ce --- /dev/null +++ b/tests/qemuxml2argvdata/tseg-invalid-size.xml @@ -0,0 +1,23 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + 12345 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/qemuxml2argvdata/tseg-old-machine-type.args b/tests/qemu= xml2argvdata/tseg-old-machine-type.args new file mode 100644 index 000000000000..ebbdb15e68f2 --- /dev/null +++ b/tests/qemuxml2argvdata/tseg-old-machine-type.args @@ -0,0 +1,27 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc-q35-2.9,accel=3Dtcg,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot c \ +-device i82801b11-bridge,id=3Dpci.1,bus=3Dpcie.0,addr=3D0x1e \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.1,addr=3D0x0 \ +-device ioh3420,port=3D0x10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x2= \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.2,addr=3D0x1 diff --git a/tests/qemuxml2argvdata/tseg-old-machine-type.xml b/tests/qemux= ml2argvdata/tseg-old-machine-type.xml new file mode 100644 index 000000000000..d1e42586f144 --- /dev/null +++ b/tests/qemuxml2argvdata/tseg-old-machine-type.xml @@ -0,0 +1,21 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/qemuxml2argvdata/tseg.args b/tests/qemuxml2argvdata/tseg= .args new file mode 100644 index 000000000000..995957ef1d58 --- /dev/null +++ b/tests/qemuxml2argvdata/tseg.args @@ -0,0 +1,28 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/home/test \ +USER=3Dtest \ +LOGNAME=3Dtest \ +QEMU_AUDIO_DRV=3Dnone \ +/usr/bin/qemu-system-x86_64 \ +-name QEMUGuest1 \ +-S \ +-machine pc-q35-2.10,accel=3Dtcg,usb=3Doff,smm=3Don,dump-guest-core=3Doff \ +-global mch.extended-tseg-mbytes=3D16 \ +-m 214 \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,path=3D/tmp/lib/domain--1-QEMUGuest1/moni= tor.sock,\ +server,nowait \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-no-acpi \ +-boot c \ +-device i82801b11-bridge,id=3Dpci.1,bus=3Dpcie.0,addr=3D0x1e \ +-device pci-bridge,chassis_nr=3D2,id=3Dpci.2,bus=3Dpci.1,addr=3D0x0 \ +-device ioh3420,port=3D0x10,chassis=3D3,id=3Dpci.3,bus=3Dpcie.0,addr=3D0x2= \ +-device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.2,addr=3D0x1 diff --git a/tests/qemuxml2argvdata/tseg.xml b/tests/qemuxml2argvdata/tseg.= xml new file mode 100644 index 000000000000..7a31e348b258 --- /dev/null +++ b/tests/qemuxml2argvdata/tseg.xml @@ -0,0 +1,21 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 78454acb1a41..633dfaaee9a4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2827,6 +2827,54 @@ mymain(void) =20 DO_TEST_CAPS_LATEST("disk-virtio-scsi-reservations"); =20 + DO_TEST("tseg", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + DO_TEST("tseg-explicit-size", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + DO_TEST("tseg-old-machine-type", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + DO_TEST_PARSE_ERROR("tseg-i440fx", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + DO_TEST_PARSE_ERROR("tseg-explicit-size", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI); + DO_TEST_PARSE_ERROR("tseg-invalid-size", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + /* Test disks with format probing enabled for legacy reasons. * New tests should not go in this section. */ driver.config->allowDiskFormatProbing =3D true; diff --git a/tests/qemuxml2xmloutdata/tseg-explicit-size.xml b/tests/qemuxm= l2xmloutdata/tseg-explicit-size.xml new file mode 100644 index 000000000000..e1a6e15b610e --- /dev/null +++ b/tests/qemuxml2xmloutdata/tseg-explicit-size.xml @@ -0,0 +1,46 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + 48 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/tseg-old-machine-type.xml b/tests/qem= uxml2xmloutdata/tseg-old-machine-type.xml new file mode 100644 index 000000000000..594c5c025d2e --- /dev/null +++ b/tests/qemuxml2xmloutdata/tseg-old-machine-type.xml @@ -0,0 +1,44 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/tseg.xml b/tests/qemuxml2xmloutdata/t= seg.xml new file mode 100644 index 000000000000..954ee9d9ee24 --- /dev/null +++ b/tests/qemuxml2xmloutdata/tseg.xml @@ -0,0 +1,46 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + 16 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 7cedc2b999b3..14824679b81c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1181,6 +1181,31 @@ mymain(void) QEMU_CAPS_DEVICE_VIRTIO_MOUSE_CCW, QEMU_CAPS_DEVICE_VIRTIO_TABLET_CCW); =20 + DO_TEST("tseg", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + DO_TEST("tseg-explicit-size", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + DO_TEST("tseg-old-machine-type", + QEMU_CAPS_DEVICE_DMI_TO_PCI_BRIDGE, + QEMU_CAPS_DEVICE_PCI_BRIDGE, + QEMU_CAPS_DEVICE_IOH3420, + QEMU_CAPS_ICH9_AHCI, + QEMU_CAPS_MACHINE_SMM_OPT, + QEMU_CAPS_VIRTIO_SCSI, + QEMU_CAPS_MCH_EXTENDED_TSEG_MBYTES); + /* Test disks with format probing enabled for legacy reasons. * New tests should not go in this section. */ driver.config->allowDiskFormatProbing =3D true; --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list