From nobody Mon Feb 9 00:46:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 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=1572960507; cv=none; d=zoho.com; s=zohoarc; b=U47uv3MOlXdsNfjG+1OkT+dRa7ediaI0hq7OF9SiM1QIarlNCm87OQ3CWnxHUL0QQPFFUngK0ha/cuXVmUtvs3GeCMPeamvZ8rZvP/2YT8F9lhfoavK1aPkjJm7PBhm2JYiPqA9DpS8WZYSp4DwC4rID0k/x05sYJ0nRhbSCNCA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1572960507; 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; bh=vwtctX1DQCII2m6gQMZJX4TAowv2MJd+DyMHsSM3Pbg=; b=nQJRNaEmYWSoyScv5hjWlcCDW/FQUK4Bw9z9Qd5NH2m1QtoA3i8QCpYKGDv//lErh+Okwws1V/tyRsd+xq4Jry2faLq7njs5Ihu01BzXgPoTbLT1NKjBYnDm3NPTWbgJJNdwqFypW+m9D9VcAErDN4VD0fZcFBaOK05ymeUwVj4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1572960507410426.76645766470756; Tue, 5 Nov 2019 05:28:27 -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-55-ZF9WW1ZwOASs-Nlv9SlrBA-1; Tue, 05 Nov 2019 08:28:24 -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 77FBF8017DD; Tue, 5 Nov 2019 13:28:19 +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 48D791001902; Tue, 5 Nov 2019 13:28:19 +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 F21114BB5B; Tue, 5 Nov 2019 13:28:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xA5DRueK003852 for ; Tue, 5 Nov 2019 08:27:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 58D02600CC; Tue, 5 Nov 2019 13:27:56 +0000 (UTC) Received: from virval.usersys.redhat.com (unknown [10.43.2.188]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2E61A600C4 for ; Tue, 5 Nov 2019 13:27:53 +0000 (UTC) Received: by virval.usersys.redhat.com (Postfix, from userid 500) id 6E51A105B21; Tue, 5 Nov 2019 14:27:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572960506; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=vwtctX1DQCII2m6gQMZJX4TAowv2MJd+DyMHsSM3Pbg=; b=fBeAGGcSMKWjde93IH/L8n4/vSg+QAwwjiH+pcuPaMHev0K32N1wSUW60BlHWguaRacU5y MKmq7UFEZOVOBrU4HLmCPa9iBAqLZQsRreVCAlwPvR0w589eOXBxRX/IK04igPiHGuFVSz NMb4ERMb+DKpFqTSgMziHeI8l538l04= From: Jiri Denemark To: libvir-list@redhat.com Date: Tue, 5 Nov 2019 14:27:02 +0100 Message-Id: <8b724dd1692ac85c2795b1c70452570394cc13fe.1572958254.git.jdenemar@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 04/52] conf: Drop nameLen parameter from virDomainCapsCPUModelsAdd 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 X-MC-Unique: ZF9WW1ZwOASs-Nlv9SlrBA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" All callers use nameLen =3D=3D -1 anyway. Signed-off-by: Jiri Denemark Reviewed-by: J=C3=A1n Tomko --- Notes: Version 2: - no change =20 Version 3: - no change src/conf/domain_capabilities.c | 7 +++---- src/conf/domain_capabilities.h | 1 - src/qemu/qemu_capabilities.c | 2 +- tests/cputest.c | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index e92df9e9da..0a89ccd071 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -167,7 +167,7 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr ol= d) =20 for (i =3D 0; i < old->nmodels; i++) { if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, -1, + old->models[i].name, old->models[i].usable, old->models[i].blockers) < 0) goto error; @@ -200,7 +200,7 @@ virDomainCapsCPUModelsFilter(virDomainCapsCPUModelsPtr = old, continue; =20 if (virDomainCapsCPUModelsAdd(cpuModels, - old->models[i].name, -1, + old->models[i].name, old->models[i].usable, old->models[i].blockers) < 0) goto error; @@ -238,14 +238,13 @@ virDomainCapsCPUModelsAddSteal(virDomainCapsCPUModels= Ptr cpuModels, int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, - ssize_t nameLen, virDomainCapsCPUUsable usable, char **blockers) { g_autofree char * nameCopy =3D NULL; VIR_AUTOSTRINGLIST blockersCopy =3D NULL; =20 - if (VIR_STRNDUP(nameCopy, name, nameLen) < 0) + if (VIR_STRDUP(nameCopy, name) < 0) return -1; =20 if (virStringListCopy(&blockersCopy, (const char **)blockers) < 0) diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index a31458c653..264c7fc429 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -203,7 +203,6 @@ int virDomainCapsCPUModelsAddSteal(virDomainCapsCPUMode= lsPtr cpuModels, char ***blockers); int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, const char *name, - ssize_t nameLen, virDomainCapsCPUUsable usable, char **blockers); virDomainCapsCPUModelPtr diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 9bb3c96448..8fd503a49c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1873,7 +1873,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } =20 for (i =3D 0; i < count; i++) { - if (virDomainCapsCPUModelsAdd(cpus, name[i], -1, usable, NULL) < 0) + if (virDomainCapsCPUModelsAdd(cpus, name[i], usable, NULL) < 0) return -1; } =20 diff --git a/tests/cputest.c b/tests/cputest.c index a277224918..6ead9e0982 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -861,7 +861,7 @@ cpuTestUpdateLive(const void *arg) usable =3D hvModel->usable; } =20 - if (virDomainCapsCPUModelsAdd(models, expected->model, -1, + if (virDomainCapsCPUModelsAdd(models, expected->model, usable, blockers) < 0) goto cleanup; =20 @@ -971,7 +971,7 @@ cpuTestInitModels(const char **list) return NULL; =20 for (model =3D list; *model; model++) { - if (virDomainCapsCPUModelsAdd(cpus, *model, -1, + if (virDomainCapsCPUModelsAdd(cpus, *model, VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL= ) < 0) goto error; } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list