From nobody Sun Feb 8 15:08:05 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 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=1668173584; cv=none; d=zohomail.com; s=zohoarc; b=TOoNhLHHPdSerTeIS8YW67z2qYGk3h5kAcZNI6b3/F26gMvpmC46kubgOg2UwpsqDZvfS4qQdGFuIrvGjItKN01D3bAAqd3L1L18AZNkurBHXjlxSa1hm8cZf8O9cLE2KX6wVNYI2zdpDBBCKHTl7dd8wrG3XnX5izmPzbDFUJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668173584; 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=Daau3nd/hqxQxKHPpjzHywwWhJ9Wx8ZdiV1WKhwpxMQ=; b=IeKV26w9RrrksswI+3Rukj3wJnIWfZxgQ/f3Za8BqKNJFZkKd7NFhJ4B+OY+Vp0EC11XobpzrXZ4+b7RanpbdCBzX3gvdSycWLYNishCCBSAJK0W1yhuSzuF1RnO/NcNLi9xbBvr3yXEnGQyXO99PhOGBFYSk41gHfC2u71c3cU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 166817358471753.967452931763205; Fri, 11 Nov 2022 05:33:04 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-_slwGp_IPVu5gLgVLqk4-g-1; Fri, 11 Nov 2022 08:32:40 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34D38811728; Fri, 11 Nov 2022 13:32:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1C21840C845B; Fri, 11 Nov 2022 13:32:38 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C450219465BA; Fri, 11 Nov 2022 13:32:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 454F91946586 for ; Fri, 11 Nov 2022 13:32:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1A3C84A9265; Fri, 11 Nov 2022 13:32:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 10EFC4A9256 for ; Fri, 11 Nov 2022 13:32:29 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E948B3C01E07 for ; Fri, 11 Nov 2022 13:32:28 +0000 (UTC) Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-15-W_HwtT5pOtCHGMiTyrIW4A-1; Fri, 11 Nov 2022 08:32:27 -0500 Received: by mail-ej1-f72.google.com with SMTP id sd31-20020a1709076e1f00b007ae63b8d66aso3045004ejc.3 for ; Fri, 11 Nov 2022 05:32:27 -0800 (PST) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id tj11-20020a170907c24b00b0079fe11e97cesm888292ejc.48.2022.11.11.05.32.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 05:32:25 -0800 (PST) Received: from wheatley.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 418E5B0E0C63 for ; Fri, 11 Nov 2022 14:32:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668173582; 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=Daau3nd/hqxQxKHPpjzHywwWhJ9Wx8ZdiV1WKhwpxMQ=; b=P6KUUwF0XN50GL0frDIyyiHEtMDyfeS+2ZVhG232v8Tmf67nRpTORVvdk2zoiZ62z//YES gtD1DIlH7M15nQpxKagECCuXE+fp5tH9tsaijh9nbigTobBGLxOAupppLT6z62bD/vWovx kcT7NXwc29KCG3q6mKQNfmkBZ3jt8mQ= X-MC-Unique: _slwGp_IPVu5gLgVLqk4-g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: W_HwtT5pOtCHGMiTyrIW4A-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Daau3nd/hqxQxKHPpjzHywwWhJ9Wx8ZdiV1WKhwpxMQ=; b=MkwhxkOycwyQwhU0fhdboTSIj2EmBKB1+mwH3ibIzguqv+0fLEtAne9ElEMvU6tnKl Sgzqn0XphET477CAbl0hQ2F+tncizRd/mLxOd/DujwKnBW1t4egVfXpydg2M6+08aPKk wzoake820eXvaVrL5ccwi1lx5Y09XLNUXHdgltK+FB2tZ5OGw1StC94xWVqJ+RVcf/aq 84Jyo+IhiwGW86nn5PSv2zkjx8+Qu0eM6WTsTiWWxKmBvHt3sVXlTUoaD6VsduXq1BRP zAImpLgE4nrCgCF0yVvX8g6/+JbuEXDHI+DmIgQ2ey47S0Z/0eiHX1TdkOncCP/jGX5F 78kQ== X-Gm-Message-State: ANoB5pmYHXbrzSSuz1w3UvGABBeFRCYPNNT4mTc2A9YbWcn13cAvh4NA F1ofZXO8A6w6mq7hVZrdrM5ZxNVL5K/o0faBJogUHnQkOmbfr1fY1E/4Q4PVpLKbU9RTidDzcED 0b2BkmeKODoIuehbTp+0zkWPjzRav5ZOK5REyq25NdXmjes8afYKwC0FGfwG25ntQL1M4Je0= X-Received: by 2002:aa7:c654:0:b0:461:60b1:5c6d with SMTP id z20-20020aa7c654000000b0046160b15c6dmr1511014edr.182.1668173546508; Fri, 11 Nov 2022 05:32:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf6HKE3ye7YW60udXwMjgZJHjOTQY+hHdSu7sY5Tm0CjH8TG60HH2ynSXDoYrru52vvnQ5gPag== X-Received: by 2002:aa7:c654:0:b0:461:60b1:5c6d with SMTP id z20-20020aa7c654000000b0046160b15c6dmr1511001edr.182.1668173546224; Fri, 11 Nov 2022 05:32:26 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 1/2] util: Remove return value from virTypedParamsCopy Date: Fri, 11 Nov 2022 14:32:22 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1668173586035100001 Content-Type: text/plain; charset="utf-8"; x-default="true" It is already nonfallible, so just change the return type to void. Signed-off-by: Martin Kletzander --- src/libvirt-domain.c | 3 +-- src/util/viridentity.c | 10 ++++------ src/util/virtypedparam.c | 6 ++---- src/util/virtypedparam.h | 6 +++--- src/vz/vz_driver.c | 3 +-- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 1c2f1ce71c16..56c2abf3fae7 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -3258,8 +3258,7 @@ virDomainMigrateVersion3Full(virDomainPtr domain, return NULL; } =20 - if (virTypedParamsCopy(&tmp, params, nparams) < 0) - return NULL; + virTypedParamsCopy(&tmp, params, nparams); params =3D tmp; =20 ret =3D VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn, diff --git a/src/util/viridentity.c b/src/util/viridentity.c index 46dcf3a04e4f..4e9a783cee2c 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -420,8 +420,7 @@ virIdentity *virIdentityNewCopy(virIdentity *src) { g_autoptr(virIdentity) ident =3D virIdentityNew(); =20 - if (virTypedParamsCopy(&ident->params, src->params, src->nparams) < 0) - return NULL; + virTypedParamsCopy(&ident->params, src->params, src->nparams); ident->nparams =3D src->nparams; ident->maxparams =3D src->nparams; =20 @@ -826,8 +825,8 @@ int virIdentitySetParameters(virIdentity *ident, ident->params =3D NULL; ident->nparams =3D 0; ident->maxparams =3D 0; - if (virTypedParamsCopy(&ident->params, params, nparams) < 0) - return -1; + + virTypedParamsCopy(&ident->params, params, nparams); ident->nparams =3D nparams; ident->maxparams =3D nparams; =20 @@ -839,8 +838,7 @@ virTypedParamList *virIdentityGetParameters(virIdentity= *ident) { virTypedParameter *tmp =3D NULL; =20 - if (virTypedParamsCopy(&tmp, ident->params, ident->nparams) < 0) - return NULL; + virTypedParamsCopy(&tmp, ident->params, ident->nparams); =20 return virTypedParamListFromParams(&tmp, ident->nparams); } diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index 2d7e4ab35470..ae676d02fe93 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -347,7 +347,7 @@ virTypedParamsReplaceString(virTypedParameterPtr *param= s, } =20 =20 -int +void virTypedParamsCopy(virTypedParameterPtr *dst, virTypedParameterPtr src, int nparams) @@ -356,7 +356,7 @@ virTypedParamsCopy(virTypedParameterPtr *dst, =20 *dst =3D NULL; if (!src || nparams <=3D 0) - return 0; + return; =20 *dst =3D g_new0(virTypedParameter, nparams); =20 @@ -369,8 +369,6 @@ virTypedParamsCopy(virTypedParameterPtr *dst, (*dst)[i].value =3D src[i].value; } } - - return 0; } =20 =20 diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index c4bc58ee8f6a..936dac24eabc 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -86,9 +86,9 @@ int virTypedParamsReplaceString(virTypedParameterPtr *par= ams, const char *name, const char *value); =20 -int virTypedParamsCopy(virTypedParameterPtr *dst, - virTypedParameterPtr src, - int nparams); +void virTypedParamsCopy(virTypedParameterPtr *dst, + virTypedParameterPtr src, + int nparams); =20 char *virTypedParameterToString(virTypedParameterPtr param); =20 diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index 4f5e340d536c..d5147a6c0d9c 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -3144,8 +3144,7 @@ vzDomainMigratePerformP2P(virDomainObj *dom, int ret =3D -1; int maxparams =3D nparams; =20 - if (virTypedParamsCopy(¶ms, orig_params, nparams) < 0) - return -1; + virTypedParamsCopy(¶ms, orig_params, nparams); =20 if (!(dconn =3D virConnectOpen(dconnuri))) goto done; --=20 2.38.1