From nobody Sat May 4 04:39:08 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 1554379258109149.80845265703567; Thu, 4 Apr 2019 05:00:58 -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 316993168570; Thu, 4 Apr 2019 12:00:56 +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 0468219C4F; Thu, 4 Apr 2019 12:00:56 +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 81A761819AFA; Thu, 4 Apr 2019 12:00:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x34C0qZn000619 for ; Thu, 4 Apr 2019 08:00:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id DB2EC17C2D; Thu, 4 Apr 2019 12:00:52 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6443F5DD97 for ; Thu, 4 Apr 2019 12:00:52 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Apr 2019 14:00:48 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] qemu: rename function for getting the default hugepage 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: , Content-Type: text/plain; charset="utf-8" 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.41]); Thu, 04 Apr 2019 12:00:57 +0000 (UTC) Use qemuBuildMemoryGetDefaultPagesize. Fixes: 6864d8f740e2502dc7625bdf18ffde4465b14f69 Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 029780fe86..aaca75900b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3409,8 +3409,8 @@ qemuBuildMemoryBackendPropsShare(virJSONValuePtr prop= s, =20 =20 static int -qemuqemuBuildMemoryBackendPropsGetPagesize(virQEMUDriverConfigPtr cfg, - unsigned long long *pagesize) +qemuBuildMemoryGetDefaultPagesize(virQEMUDriverConfigPtr cfg, + unsigned long long *pagesize) { virHugeTLBFSPtr p; =20 @@ -3568,7 +3568,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendP= rops, needHugepage =3D false; useHugepage =3D false; } else if (pagesize =3D=3D 0) { - if (qemuqemuBuildMemoryBackendPropsGetPagesize(cfg, &pagesize) < 0) + if (qemuBuildMemoryGetDefaultPagesize(cfg, &pagesize) < 0) goto cleanup; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 04:39:08 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 1554379267477394.11436920143865; Thu, 4 Apr 2019 05:01:07 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AC707D7A3; Thu, 4 Apr 2019 12:01:05 +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 E04506C74E; Thu, 4 Apr 2019 12:01:04 +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 90109181B9E2; Thu, 4 Apr 2019 12:01:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x34C0rYQ000665 for ; Thu, 4 Apr 2019 08:00:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id AB1EF17C2D; Thu, 4 Apr 2019 12:00:53 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34AAE5DD97 for ; Thu, 4 Apr 2019 12:00:53 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Apr 2019 14:00:49 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] qemu: do not fill in default pagesize in qemuGetDomainHupageMemPath 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: , Content-Type: text/plain; charset="utf-8" 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 04 Apr 2019 12:01:05 +0000 (UTC) Commit 6864d8f740e2502dc7625bdf18ffde4465b14f69 moved this one level up for qemuBuildMemoryBackendProps but left qemuBuildMemPathStr intact. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 8 +++++--- src/qemu/qemu_conf.c | 35 +++++++++++++---------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index aaca75900b..79b9a5d4f9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7847,9 +7847,11 @@ qemuBuildMemPathStr(virQEMUDriverConfigPtr cfg, * if user requested file allocation. */ if (def->mem.nhugepages && def->mem.hugepages[0].size !=3D system_page_size) { - if (qemuGetDomainHupageMemPath(def, cfg, - def->mem.hugepages[0].size, - &mem_path) < 0) + unsigned long long pagesize =3D def->mem.hugepages[0].size; + if (!pagesize && + qemuBuildMemoryGetDefaultPagesize(cfg, &pagesize) < 0) + return -1; + if (qemuGetDomainHupageMemPath(def, cfg, pagesize, &mem_path) < 0) return -1; } else if (def->mem.source =3D=3D VIR_DOMAIN_MEMORY_SOURCE_FILE) { if (qemuGetMemoryBackingPath(def, cfg, "ram", &mem_path) < 0) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 41ce0a978d..4bec885c6b 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1926,8 +1926,6 @@ qemuGetDomainDefaultHugepath(const virDomainDef *def, /** * qemuGetDomainHupageMemPath: Construct HP enabled memory backend path * - * If no specific hugepage size is requested (@pagesize is zero) - * the default hugepage size is used). * The resulting path is stored at @memPath. * * Returns 0 on success, @@ -1948,29 +1946,22 @@ qemuGetDomainHupageMemPath(const virDomainDef *def, return -1; } =20 - if (!pagesize) { - if (!(*memPath =3D qemuGetDomainDefaultHugepath(def, - cfg->hugetlbfs, - cfg->nhugetlbfs))) - return -1; - } else { - for (i =3D 0; i < cfg->nhugetlbfs; i++) { - if (cfg->hugetlbfs[i].size =3D=3D pagesize) - break; - } - - if (i =3D=3D cfg->nhugetlbfs) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Unable to find any usable hugetlbfs " - "mount for %llu KiB"), - pagesize); - return -1; - } + for (i =3D 0; i < cfg->nhugetlbfs; i++) { + if (cfg->hugetlbfs[i].size =3D=3D pagesize) + break; + } =20 - if (!(*memPath =3D qemuGetDomainHugepagePath(def, &cfg->hugetlbfs[= i]))) - return -1; + if (i =3D=3D cfg->nhugetlbfs) { + virReportError(VIR_ERR_INTERNAL_ERROR, + _("Unable to find any usable hugetlbfs " + "mount for %llu KiB"), + pagesize); + return -1; } =20 + if (!(*memPath =3D qemuGetDomainHugepagePath(def, &cfg->hugetlbfs[i]))) + return -1; + return 0; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Sat May 4 04:39:08 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 155437925913047.25929294276409; Thu, 4 Apr 2019 05:00:59 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 88A7C3091784; Thu, 4 Apr 2019 12:00:57 +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 5D99617DD5; Thu, 4 Apr 2019 12:00:57 +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 20B2365D14; Thu, 4 Apr 2019 12:00:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x34C0siF000691 for ; Thu, 4 Apr 2019 08:00:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7DC2517C2D; Thu, 4 Apr 2019 12:00:54 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05FC65DD97 for ; Thu, 4 Apr 2019 12:00:53 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Thu, 4 Apr 2019 14:00:50 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] qemu: remove qemuGetDomainDefaultHugepath 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: , Content-Type: text/plain; charset="utf-8" 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 04 Apr 2019 12:00:58 +0000 (UTC) It is no longer used. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_conf.c | 24 ------------------------ src/qemu/qemu_conf.h | 3 --- 2 files changed, 27 deletions(-) diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 4bec885c6b..daea11dacb 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -1899,30 +1899,6 @@ qemuGetDomainHugepagePath(const virDomainDef *def, } =20 =20 -/** - * qemuGetDomainDefaultHugepath: - * @def: domain definition - * @hugetlbfs: array of configured hugepages - * @nhugetlbfs: number of item in the array - * - * Callers must ensure that @hugetlbfs contains at least one entry. - * - * Returns 0 on success, -1 otherwise. - * */ -char * -qemuGetDomainDefaultHugepath(const virDomainDef *def, - virHugeTLBFSPtr hugetlbfs, - size_t nhugetlbfs) -{ - virHugeTLBFSPtr p; - - if (!(p =3D virFileGetDefaultHugepage(hugetlbfs, nhugetlbfs))) - p =3D &hugetlbfs[0]; - - return qemuGetDomainHugepagePath(def, p); -} - - /** * qemuGetDomainHupageMemPath: Construct HP enabled memory backend path * diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 14c9d15a72..983e74a3cf 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -374,9 +374,6 @@ int qemuTranslateSnapshotDiskSourcePool(virDomainSnapsh= otDiskDefPtr def); char * qemuGetBaseHugepagePath(virHugeTLBFSPtr hugepage); char * qemuGetDomainHugepagePath(const virDomainDef *def, virHugeTLBFSPtr hugepage); -char * qemuGetDomainDefaultHugepath(const virDomainDef *def, - virHugeTLBFSPtr hugetlbfs, - size_t nhugetlbfs); =20 int qemuGetDomainHupageMemPath(const virDomainDef *def, virQEMUDriverConfigPtr cfg, --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list