From nobody Tue Feb 10 19:14:22 2026 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