From nobody Sun Feb 8 01:34:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1582998720; cv=none; d=zohomail.com; s=zohoarc; b=KJDrWfX1lwOP7vHEqEFnWKQCXRbFucGXOZpeGz/sGtDualVrogRlYz8SVyorFAs0L8CAQ9ieugsBnPCjS2aCntX30kohhYe15WRvE8OtXq8N5Ko6V9ZnSECSkrft9QCGdo5LC2Zy450VRJyTlNRCGoKgEVKqayAqzd6FUQy12Qs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582998720; 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=4HSk5s4pTlJwQMM+rDkEWH3nJafv4cP/rR3tH05P8W4=; b=GpAQnu/+hDdj+d3D/rbssfbpoVQIELUiGV55p7xmdEyVMtgV25+UX4SLYPZ7ZxMtrsh0Yq4KSeV8plLQ85o/OCVdX/IR6tOwWmIsql/25bRDgvm+nC5ZFecc2nmlnDfOCBFPiFPdJVwVuYTiPlVB4F7iNQl1tQ6iZpahKB2lk9Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1582998720161782.3289304396659; Sat, 29 Feb 2020 09:52:00 -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-278-UWVuVWnKOseOy8VTk4zITA-1; Sat, 29 Feb 2020 12:51:56 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28378801E66; Sat, 29 Feb 2020 17:51:51 +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 9D55C8D543; Sat, 29 Feb 2020 17:51:50 +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 0015184484; Sat, 29 Feb 2020 17:51:49 +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 01THpa5j014195 for ; Sat, 29 Feb 2020 12:51:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 598F82063206; Sat, 29 Feb 2020 17:51:36 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51F642026D69 for ; Sat, 29 Feb 2020 17:51:35 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 EF2858007AC for ; Sat, 29 Feb 2020 17:51:34 +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-212-NHRzhAtzPGmmZsJlYsxjUg-1; Sat, 29 Feb 2020 12:51:32 -0500 Received: by mail-qv1-f65.google.com with SMTP id l13so952136qvo.12 for ; Sat, 29 Feb 2020 09:51:32 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:8749:2052:fc6c:a4b4:ccbc]) by smtp.gmail.com with ESMTPSA id b5sm7158282qkh.58.2020.02.29.09.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Feb 2020 09:51:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582998718; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4HSk5s4pTlJwQMM+rDkEWH3nJafv4cP/rR3tH05P8W4=; b=JrPxP/QQCKNBvkStkT8becSHAi6m5Vw0ZFP4B4e5a6fnGhUO2wnegpNqt9DtSuBgTlgSiu CKzjb0OotRVyaTzva81sDnxUfcdFEsyouggXKdMmA+v86wDU2A7D7QXyBevyZoqzoELjYe Q071foCIOFQhWc+tXThz9ZC9VHN4A9E= X-MC-Unique: UWVuVWnKOseOy8VTk4zITA-1 X-MC-Unique: NHRzhAtzPGmmZsJlYsxjUg-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=CFsU2rS2e75B72njkdBXSE8RKzE4Nt1GVdB09x5K+uk=; b=mvGJNtb7pAJnXpsuCeTp0o+96MYmZwXes9Uex0ZrIDWSzhwuRN8S4IQcXaKu/YYUpL NlatfWpn9aRPRmKeOsui5238XLGfoEBcSBJtpoUvTWRhom8IwWdZ83XVOKnepoCroTu5 FpwUo9kBd47Glh4fhxdz9K2arAuZ2Dc8MuTbXMvca+3S/eP0S7VORocVE4fWlo4UrmMK E5JFf17OGk4VlTpgcUV1+/+FdwGYS0LeiI4rQD7SmKtPxU1CuXX6aA/wWeh2bQ9LclBr ft1epogm0lT0bt7FFOe2ni5evaEoGfLuZuvAu/aXJ07R5sUPlOl2O1K9Nn7/2jREn16N rbeg== X-Gm-Message-State: APjAAAXOYnXmoTRpwazDt6KmhBe/5Kv0wHbyKh4xYoLFerBBfw+Hgddd 2f4lM2wU1HraWnhcNmgyOkhv/R/l4dI= X-Google-Smtp-Source: APXvYqyaiMYRt2+22rcn1N4EifYBgvKGZ1WtSapCmmbhMRBAboWjRed7Pq37/4iLija5Js+5ANPILQ== X-Received: by 2002:a0c:ecc6:: with SMTP id o6mr8672344qvq.220.1582998691696; Sat, 29 Feb 2020 09:51:31 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 1/3] qemu_domain.c: make qemuDomainGetMemoryModuleSizeAlignment() public Date: Sat, 29 Feb 2020 14:51:12 -0300 Message-Id: <20200229175114.376223-2-danielhb413@gmail.com> In-Reply-To: <20200229175114.376223-1-danielhb413@gmail.com> References: <20200229175114.376223-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 01THpa5j014195 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.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This function will be used in qemu_hotplug.c in the next patch. While we're at it, we can remove the virDomainMemoryDef argument since the alignment size doesn't change with this object. The only existent caller can also be brought out of a loop which iterates in a virDomainMemoryDef list. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_domain.c | 7 +++---- src/qemu/qemu_domain.h | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 3dfa71650d..27f400005e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -12308,9 +12308,8 @@ qemuDomainGetMemorySizeAlignment(virDomainDefPtr de= f) } =20 =20 -static unsigned long long -qemuDomainGetMemoryModuleSizeAlignment(const virDomainDef *def, - const virDomainMemoryDef *mem G_GNU= C_UNUSED) +unsigned long long +qemuDomainGetMemoryModuleSizeAlignment(const virDomainDef *def) { /* PPC requires the memory sizes to be rounded to 256MiB increments, so * round them to the size always. */ @@ -12368,8 +12367,8 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) } =20 /* Align memory module sizes */ + align =3D qemuDomainGetMemoryModuleSizeAlignment(def); for (i =3D 0; i < def->nmems; i++) { - align =3D qemuDomainGetMemoryModuleSizeAlignment(def, def->mems[i]= ); def->mems[i]->size =3D VIR_ROUND_UP(def->mems[i]->size, align); hotplugmem +=3D def->mems[i]->size; =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index f8fb48f2ff..d27d7e78d9 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -996,6 +996,8 @@ int qemuDomainDefValidateMemoryHotplug(const virDomainD= ef *def, virQEMUCapsPtr qemuCaps, const virDomainMemoryDef *mem); =20 +unsigned long long qemuDomainGetMemoryModuleSizeAlignment(const virDomainD= ef *def); + bool qemuDomainSupportsNewVcpuHotplug(virDomainObjPtr vm); bool qemuDomainHasVcpuPids(virDomainObjPtr vm); pid_t qemuDomainGetVcpuPid(virDomainObjPtr vm, unsigned int vcpuid); --=20 2.24.1