From nobody Tue May 7 05:08:18 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 1536672968910731.381721269374; Tue, 11 Sep 2018 06:36:08 -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 022FD88309; Tue, 11 Sep 2018 13:36:07 +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 89379D23B7; Tue, 11 Sep 2018 13:36:06 +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 74A5A18005DF; Tue, 11 Sep 2018 13:36:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8BDa4Es011828 for ; Tue, 11 Sep 2018 09:36:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id DA90020159B8; Tue, 11 Sep 2018 13:36:04 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-52.phx2.redhat.com [10.3.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94173201588A for ; Tue, 11 Sep 2018 13:36:04 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 11 Sep 2018 09:35:59 -0400 Message-Id: <20180911133600.2018-2-jferlan@redhat.com> In-Reply-To: <20180911133600.2018-1-jferlan@redhat.com> References: <20180911133600.2018-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] doc: Update the wording around the backingStore 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.28]); Tue, 11 Sep 2018 13:36:07 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit bc6d3121a was far too terse when describing the new elements, attributes, and allow values. Provide a few more words to help describe. Signed-off-by: John Ferlan Reviewed-by: Marc-Andr=C3=A9 Lureau --- docs/formatdomain.html.in | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index eb619a1656..1f12ab5b42 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1150,13 +1150,16 @@ suitable for the specific environment at the same time to mitigate the risks described above. Since 1.0.6
source
-
In this attribute you can switch to file memorybacking or keep - default anonymous.
+
Using the type attribute, it's possible to provide + "file" to utilize file memorybacking or keep the default + "anonymous".
access
-
Specify if memory is shared or private. This can be overridden = per - numa node by memAccess
+
Using the mode attribute, specify if the memory is + to be "shared" or "private". This can be overridden per numa node= by + memAccess.
allocation
-
Specify when allocate the memory
+
Using the mode attribute, specify when to allocate + the memory by supplying either "immediate" or "ondemand".
discard
When set and supported by hypervisor the memory content is discarded just before guest shuts down (or --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 05:08:18 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 1536672978634629.829885944587; Tue, 11 Sep 2018 06:36:18 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id BF5D964134; Tue, 11 Sep 2018 13:36:16 +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 87B8316D5C; Tue, 11 Sep 2018 13:36:16 +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 2F31B181A12F; Tue, 11 Sep 2018 13:36:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8BDa5Be011836 for ; Tue, 11 Sep 2018 09:36:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5795B201588A; Tue, 11 Sep 2018 13:36:05 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-52.phx2.redhat.com [10.3.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1254020159B8 for ; Tue, 11 Sep 2018 13:36:04 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 11 Sep 2018 09:36:00 -0400 Message-Id: <20180911133600.2018-3-jferlan@redhat.com> In-Reply-To: <20180911133600.2018-1-jferlan@redhat.com> References: <20180911133600.2018-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] conf: Move hypervisor specific nhugepage checks 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 11 Sep 2018 13:36:17 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Commit 82327038 moved a couple of checks out of the XML parser into the domain validation; however, those checks seem to be more useful as hypervisor specific checks rather than the more general domain conf checks (nothing in the docs indicate a specific error). Fortunately only QEMU was processing the memoryBacking, thus add the changes to qemuDomainDefValidateMemory and change the code a bit to make usage of the similar deref to def->mem and the mem->nhugepages filter. Signed-off-by: John Ferlan Reviewed-by: Marc-Andr=C3=A9 Lureau --- src/conf/domain_conf.c | 14 -------------- src/qemu/qemu_domain.c | 27 ++++++++++++++++++++++----- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7e14cea128..cbc3497c47 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6182,20 +6182,6 @@ virDomainDefMemtuneValidate(const virDomainDef *def) if (mem->nhugepages =3D=3D 0) return 0; =20 - if (mem->allocation =3D=3D VIR_DOMAIN_MEMORY_ALLOCATION_ONDEMAND) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("hugepages are not allowed with memory " - "allocation ondemand")); - return -1; - } - - if (mem->source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_ANONYMOUS) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("hugepages are not allowed with anonymous " - "memory source")); - return -1; - } - for (i =3D 0; i < mem->nhugepages; i++) { size_t j; ssize_t nextBit; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 5329899b13..30fd21dcdf 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3953,18 +3953,35 @@ static int qemuDomainDefValidateMemory(const virDomainDef *def) { const long system_page_size =3D virGetSystemPageSizeKB(); + const virDomainMemtune *mem =3D &(def->mem); + + if (mem->nhugepages =3D=3D 0) + return 0; + + if (mem->allocation =3D=3D VIR_DOMAIN_MEMORY_ALLOCATION_ONDEMAND) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("hugepages are not allowed with memory " + "allocation ondemand")); + return -1; + } + + if (mem->source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_ANONYMOUS) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("hugepages are not allowed with anonymous " + "memory source")); + return -1; + } =20 /* We can't guarantee any other mem.access * if no guest NUMA nodes are defined. */ - if (def->mem.nhugepages !=3D 0 && - def->mem.hugepages[0].size !=3D system_page_size && + if (mem->hugepages[0].size !=3D system_page_size && virDomainNumaGetNodeCount(def->numa) =3D=3D 0 && - def->mem.access !=3D VIR_DOMAIN_MEMORY_ACCESS_DEFAULT && - def->mem.access !=3D VIR_DOMAIN_MEMORY_ACCESS_PRIVATE) { + mem->access !=3D VIR_DOMAIN_MEMORY_ACCESS_DEFAULT && + mem->access !=3D VIR_DOMAIN_MEMORY_ACCESS_PRIVATE) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("memory access mode '%s' not supported " "without guest numa node"), - virDomainMemoryAccessTypeToString(def->mem.access)); + virDomainMemoryAccessTypeToString(mem->access)); return -1; } =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list