From nobody Mon Feb 9 06:05:35 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 ARC-Seal: i=1; a=rsa-sha256; t=1570111736; cv=none; d=zoho.com; s=zohoarc; b=AEslaiCH0B/lUOf324dcrNTl/5pxoau2NORXPbamaUIjd5qOHLJJ4McBsQNuS22nGwZa02zGbTcvE1z/YkFWlEE0KCYVTod2OVm6VlJRIidhbc7BtSoSnqUc8nfMaHYqYvM2AUecDowSHEFKSELuNMFVE0AXAkjSaBiDAmrACbc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570111736; h=Content-Type:Content-Transfer-Encoding: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:ARC-Authentication-Results; bh=MAcnjzDozm2YUhb94Gica8aB/wIyNfbsRkzXzbXP6kA=; b=lkQJfaRWdDbC8EPGtCcQMNT2aip2NzYSehtJDjzi0/dZC0TF5slC5ZgjplrRmFZein+MXnOTaKePu2HDAVOrH8gveXJIFRCieVaIodq+LHLzUQMF55SCqaCBd/lf/ujlVMJF8JkfBkg4sb7ib8Ui+RJHhlxoffWnXqJTmUSuFRk= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1570111736022395.1880388847412; Thu, 3 Oct 2019 07:08:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6203C2100; Thu, 3 Oct 2019 14:08:54 +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 369595C226; Thu, 3 Oct 2019 14:08:54 +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 6CE74180B761; Thu, 3 Oct 2019 14:08:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x93E5qcB021152 for ; Thu, 3 Oct 2019 10:05:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 846F5194B2; Thu, 3 Oct 2019 14:05:52 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A3AD19D70 for ; Thu, 3 Oct 2019 14:05:50 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 7B7C7100605; Thu, 3 Oct 2019 16:05:43 +0200 (CEST) From: Jiri Denemark To: libvir-list@redhat.com Date: Thu, 3 Oct 2019 16:00:33 +0200 Message-Id: <50a965fba6e5a8257ef14b03cac7abf6766ae302.1570111135.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 15/22] conf: Drop virDomainCapsCPUModelsAddSteal 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-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Thu, 03 Oct 2019 14:08:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Both virDomainCapsCPUModelsAdd and virDomainCapsCPUModelsAddSteal are so simple we can just squash the code in a single function. Signed-off-by: Jiri Denemark --- src/conf/domain_capabilities.c | 33 ++++++++++----------------------- src/conf/domain_capabilities.h | 4 ---- src/libvirt_private.syms | 1 - 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index e3bed42e59..8536fa7bfa 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -185,27 +185,6 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr o= ld) } =20 =20 -int -virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, - char **name, - virDomainCapsCPUUsable usable, - char ***blockers) -{ - if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max, - cpuModels->nmodels, 1) < 0) - return -1; - - cpuModels->models[cpuModels->nmodels].usable =3D usable; - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].name, *name); - - if (blockers) - VIR_STEAL_PTR(cpuModels->models[cpuModels->nmodels].blockers, *blo= ckers); - - cpuModels->nmodels++; - return 0; -} - - int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, @@ -214,6 +193,7 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpu= Models, { VIR_AUTOFREE(char *) nameCopy =3D NULL; VIR_AUTOSTRINGLIST blockersCopy =3D NULL; + virDomainCapsCPUModelPtr cpu; =20 if (VIR_STRDUP(nameCopy, name) < 0) return -1; @@ -221,10 +201,17 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr c= puModels, if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) return -1; =20 - if (virDomainCapsCPUModelsAddSteal(cpuModels, &nameCopy, - usable, &blockersCopy) < 0) + if (VIR_RESIZE_N(cpuModels->models, cpuModels->nmodels_max, + cpuModels->nmodels, 1) < 0) return -1; =20 + cpu =3D cpuModels->models + cpuModels->nmodels; + cpuModels->nmodels++; + + cpu->usable =3D usable; + VIR_STEAL_PTR(cpu->name, nameCopy); + VIR_STEAL_PTR(cpu->blockers, blockersCopy); + return 0; } =20 diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index ad5b22ca9a..ed47a81772 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -192,10 +192,6 @@ virDomainCapsPtr virDomainCapsNew(const char *path, =20 virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels); virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModel= sPtr old); -int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModelsPtr cpuModels, - char **name, - virDomainCapsCPUUsable usable, - char ***blockers); int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, virDomainCapsCPUUsable usable, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6069a3efd4..4b28ee4b28 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -190,7 +190,6 @@ virDomainAuditVcpu; =20 # conf/domain_capabilities.h virDomainCapsCPUModelsAdd; -virDomainCapsCPUModelsAddSteal; virDomainCapsCPUModelsCopy; virDomainCapsCPUModelsGet; virDomainCapsCPUModelsNew; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list