From nobody Mon Feb 9 13:01:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1605132602; cv=none; d=zohomail.com; s=zohoarc; b=gBbcOmkUJJO3jeVteUYZv3/aJPXOyDs4A6q6niMaS+GYTEoFPjOBnKw6DemgZ2FJg0JqMI790j0nJI8DGnThzn2R1RQaXByx2GhYt/wrAWtA8d9lLEAzXlnuarLFs05mY9c0HUI8hiJvcbiFwRU/2aMm7YqD6gMQRLAE+8IPT/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605132602; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YRp+9ZFE7j+W80UZgxx3EAp/wCQ3WaRve3Zuy1w+glI=; b=Pa6aU/bTaMDzl6ExkXYLHoaPTok8Do85IEr68eG9wUyte598HMfnYzOCOoWZXGe/i5DYcvBUUI7ylzdeiEvJxRsWsB2Nl01/o47/aNFO3Xq6/XbD/MBvraE3uzEXhUGaW7TNPutCyRWpCJfh+xssck1i/KruozcdYOTrWsqiIB8= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1605132602020792.5125171898709; Wed, 11 Nov 2020 14:10:02 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-572-52z3KdlrM7mmUZBkYmoIaw-1; Wed, 11 Nov 2020 17:09:58 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id A8BE8188C131; Wed, 11 Nov 2020 22:09:53 +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 860DF1002C0E; Wed, 11 Nov 2020 22:09:53 +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 5249B58103; Wed, 11 Nov 2020 22:09:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0ABM7ioX006102 for ; Wed, 11 Nov 2020 17:07:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 27F11115D348; Wed, 11 Nov 2020 22:07:44 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 237B1115D342 for ; Wed, 11 Nov 2020 22:07:44 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0CE06185A7A2 for ; Wed, 11 Nov 2020 22:07:44 +0000 (UTC) Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-572-Ourp9EyGOZWLikmil9SXIA-1; Wed, 11 Nov 2020 17:07:39 -0500 Received: by mail-qv1-f65.google.com with SMTP id z17so1742559qvy.11 for ; Wed, 11 Nov 2020 14:07:39 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:b9cd:904e:d02:53c4:1c05]) by smtp.gmail.com with ESMTPSA id a200sm3427842qkb.66.2020.11.11.14.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 14:07:38 -0800 (PST) X-MC-Unique: 52z3KdlrM7mmUZBkYmoIaw-1 X-MC-Unique: Ourp9EyGOZWLikmil9SXIA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YRp+9ZFE7j+W80UZgxx3EAp/wCQ3WaRve3Zuy1w+glI=; b=oabIMz4g+gyMGM3UCNPhJYVm5LR/Re/ZJO7Hc2e2RZAKL7bFws1CTCrl+NS62aCp4I d5SrEjf6eknPtrI1ky2QrZ6ytktFBAxGkFFKuqMX13dmY/WJAj52M7ZQFwXPeSuB7Xf6 9TrqpOvCnEvUQjMPwPeZrLoEjCHUP+QPOfEKJ2DaYBPaP14jGlzP4fOKEHzZH0t5kDrz ladhHsrm+9v16m7+NxM3JSl56uipTRilxTLe7VK0hUBjoY0a8epd8asKaQ91RWUk2fV0 WnEKZKfhhHE2VjLMO6uH0TJlNjEKERwvrvORKZtFejXtdRO2w8Z+LZbhwBB8fahU288W 03BA== X-Gm-Message-State: AOAM533Sc5K+jMQg8JvrcPK20IQFcH5hXWm/LXYmxD9P1Kz8ZyNz4Mdz nEoF6CXpyII6trA7EIx5SsvEr5Flqhwy0A== X-Google-Smtp-Source: ABdhPJzCLA5yjHcg69xpBTSjUD71PC80lTReOXX2ZXe7rFoCo9loLSa0sYjBKhcT2GzfEVzDVaXifA== X-Received: by 2002:ad4:56b2:: with SMTP id bd18mr17973584qvb.22.1605132459109; Wed, 11 Nov 2020 14:07:39 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 04/10] qemu_domain.c: simplify qemuDomainGetMemoryModuleSizeAlignment() Date: Wed, 11 Nov 2020 19:07:19 -0300 Message-Id: <20201111220725.356297-5-danielhb413@gmail.com> In-Reply-To: <20201111220725.356297-1-danielhb413@gmail.com> References: <20201111220725.356297-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The function is no longer used for ppc64 alignment. This allow us to exclude the 'def' argument and simplify its usage. Let's also make it clearer in the comment that the function is now returning x86 specific values. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 33a5765c57..e40c122311 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8043,16 +8043,10 @@ qemuDomainGetMemorySizeAlignment(const virDomainDef= *def) =20 =20 static unsigned long long -qemuDomainGetMemoryModuleSizeAlignment(const virDomainDef *def, - const virDomainMemoryDef *mem G_GNU= C_UNUSED) +qemuDomainGetMemoryModuleSizeAlignment(void) { - /* PPC requires the memory sizes to be rounded to 256MiB increments, so - * round them to the size always. */ - if (ARCH_IS_PPC64(def->os.arch)) - return 256 * 1024; - - /* dimm memory modules require 2MiB alignment rather than the 1MiB we = are - * using elsewhere. */ + /* For x86, dimm memory modules require 2MiB alignment rather than + * the 1MiB we are using elsewhere. */ return 2048; } =20 @@ -8089,7 +8083,7 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) for (i =3D 0; i < def->nmems; i++) { /* ppc64 memory modules are aligned by virDomainMemoryDefPostParse= (). */ if (!ARCH_IS_PPC64(def->os.arch)) { - align =3D qemuDomainGetMemoryModuleSizeAlignment(def, def->mem= s[i]); + align =3D qemuDomainGetMemoryModuleSizeAlignment(); def->mems[i]->size =3D VIR_ROUND_UP(def->mems[i]->size, align); } =20 --=20 2.26.2