From nobody Thu Apr 25 15:52:11 2024 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 Reviewed-by: Michal Privoznik --- 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 From nobody Thu Apr 25 15:52:11 2024 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=1668173643; cv=none; d=zohomail.com; s=zohoarc; b=IlAeJrBGEbID43vPX7IwYX3SLPmf5UMSo+SGDFTGXGFcLdYOA6nwAdGkTsVb4FB717ajV+j83kq3N+ffq+2fg0IOXdeC9/EcDL60yrPzdYZLSXXD1CUOobqyA9MWBDZuWwy0b2/s/cgceUnhf0tSG4BzL9EwwpAWP0/Q1XqqD2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668173643; 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=uCI0utD0xRH85E1C0T98iCYonbEcMzJ/vPWY+X5knT4=; b=EnCA+mYRyREhYVrmN4fIaTz/Nlm1uFMDq0Sxk1Jkr+8gYQltVWRbpxTpiKh4xbP5UIo7J6K/YxfNYb5NjGYHz5q4uRwdHEdseMYhU2XB5f28+0+X1T55WZaXP3n6tzo6TCr8ej6YtlMdVedEYawyRrSl0X58k2UyGUXvjlCzrKw= 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 1668173643812821.6858079214128; Fri, 11 Nov 2022 05:34:03 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-367-kaT4YSyUN1O3ih2U_QA4Hw-1; Fri, 11 Nov 2022 08:32:41 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA1453C00235; 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 92780111F3CB; 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 0C1591946A4B; Fri, 11 Nov 2022 13:32:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 898E21946586 for ; Fri, 11 Nov 2022 13:32:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 704A840E42E4; Fri, 11 Nov 2022 13:32:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 691BB40E42E3 for ; Fri, 11 Nov 2022 13:32:29 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (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 4BA6238012E5 for ; Fri, 11 Nov 2022 13:32:29 +0000 (UTC) Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-41-u5YIZu7YMoSDv-91TQvCnQ-1; Fri, 11 Nov 2022 08:32:27 -0500 Received: by mail-ej1-f69.google.com with SMTP id qk31-20020a1709077f9f00b00791a3e02c80so3078762ejc.21 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 fj17-20020a1709069c9100b0072a881b21d8sm884760ejc.119.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 4C19EB0E0C64 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=1668173642; 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=uCI0utD0xRH85E1C0T98iCYonbEcMzJ/vPWY+X5knT4=; b=RcdoDUp/SiCk1ZANw2OCkTwH6Z+Ydc8uXOMYkqJUAHNdo+hCEzbSQhlULx+jp+eoTLrOm1 2djdh69DmquGqJiwy4fpES2ncMjvbY9ZbfmQyu+myofpLHwFjO1w+6d0b9Er9DuEimuqjN ejauyg4VWinZ+jJJwuhjGinq0XnIUKg= X-MC-Unique: kaT4YSyUN1O3ih2U_QA4Hw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: u5YIZu7YMoSDv-91TQvCnQ-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=uCI0utD0xRH85E1C0T98iCYonbEcMzJ/vPWY+X5knT4=; b=U538wQlNT/ZLi9A3HhLeFbDf+BNZw9RcKNy6IHDY7cefzE8qY0Qqy4mFKrK1RMZje8 BV8gUFxxztnJtDb+67THQF4j9MOpWXVoZ0bWFCt2K80kZqN048DnlZAyrImAYqcFuMry fvaID9lJlSmYFT1woQAimRlZJxRpwABmmeYIfXQm14fH0rJ/Kkt3aCXr0nh2Uhs9RBml 9N5wIsLal0N6g8XwYngkuZFXByeCCk+tJ4mz5v8Vaxdbh+dtr/Su9CPSL9ykp92wZt6N ApTgRdXSpZliTRWvB7F24qAKLqy0KpAYCKEphqK5CMBT9jvwkEj4d/jA88r/7gUBj2uC VhZA== X-Gm-Message-State: ANoB5plxZZZ1RcPPdevc9xO+H8y9Bq6GSn8tPnoMYPj4B/DzmS1kBd7q 5Qh0QyrqjqyMaQ8fjRWzZqEF5sqYtWZfkzsaeNpMl4rDfFhM2p3ga8qe3vwKpOW0Pgc32Zjss8t y/yzYilENCQty6LBeQZC/drjSTj3a0hHmDrgIg8WO1py6Z39a9wQSbDZV1WVXESJWyaAbGnk= X-Received: by 2002:a17:907:a0d6:b0:7ad:86f9:1d70 with SMTP id hw22-20020a170907a0d600b007ad86f91d70mr1796772ejc.179.1668173546703; Fri, 11 Nov 2022 05:32:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf45aAF0x7np0EhGY1qIKomnLnN2NejYgQVG5ShlQHnzsvuHVU/8oVSmW/bOro+LzB1l2d2Eaw== X-Received: by 2002:a17:907:a0d6:b0:7ad:86f9:1d70 with SMTP id hw22-20020a170907a0d600b007ad86f91d70mr1796753ejc.179.1668173546387; Fri, 11 Nov 2022 05:32:26 -0800 (PST) From: Martin Kletzander To: libvir-list@redhat.com Subject: [PATCH 2/2] virGetConnectGeneric: Only delegate existing identities Date: Fri, 11 Nov 2022 14:32:23 +0100 Message-Id: <38d22ce5a6429a3790b942791c5ae32b8475f042.1668173501.git.mkletzan@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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.3 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: 1668173644275100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Inside virt-qemu-run, just like in virsh for example, there is no identity set in the current thread, so we should not try to set it, otherwise things like connecting to other drivers might fail and on top of that there is no error set so the user can't even see what's wrong. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D2000075 Signed-off-by: Martin Kletzander Reviewed-by: Michal Privoznik --- src/driver.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/driver.c b/src/driver.c index cea74bdf95c6..04cbbcd3ef83 100644 --- a/src/driver.c +++ b/src/driver.c @@ -160,17 +160,15 @@ virGetConnectGeneric(virThreadLocal *threadPtr, const= char *name) =20 if (conn->driver->connectSetIdentity !=3D NULL) { g_autoptr(virIdentity) ident =3D NULL; - g_autoptr(virTypedParamList) identparams =3D NULL; =20 VIR_DEBUG("Attempting to delegate current identity"); - if (!(ident =3D virIdentityGetCurrent())) - goto error; + ident =3D virIdentityGetCurrent(); + if (ident) { + g_autoptr(virTypedParamList) tmp =3D virIdentityGetParamet= ers(ident); =20 - if (!(identparams =3D virIdentityGetParameters(ident))) - goto error; - - if (virConnectSetIdentity(conn, identparams->par, identparams-= >npar, 0) < 0) - goto error; + if (virConnectSetIdentity(conn, tmp->par, tmp->npar, 0) < = 0) + goto error; + } } } return conn; --=20 2.38.1