From nobody Sun Feb 8 23:19:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1677853807; cv=none; d=zohomail.com; s=zohoarc; b=loLhAYM+GgqhljKZWUSvAcXFcExpek5ns23phfwzRDkfB3DamUssAKFgq43P2uLuihE0VPOn7utfIVoFEb6v/YYqH+NKoSBjAA3BKaxt1eZyOOoYPf9KX9Qe2WKvENuC3qW1ljgJPSRlPZ63KjNSuDCrJyfrlLQN6E+t2lpCfSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677853807; 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=mh1QEE0ob8lGmnLJSP/K/XN+YMwAfIhMXvvCUvSbfIo=; b=jYD6pdQQ2Fm69/AMqoTt6z8CZj5w6OU0CtuHFdvjgLc6coZ/xxP0AaRzYVR0h+Ik5KuO4gI3mkVmIodeDSJXGxdrSlobBK4MT5CC8iLQBBYi73u4ysWv4GY0oyoRhTqcy0XiUghPAa7bY9RVs2WkJ34wqJNXVH/VTlsUnka5RBU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1677853807036759.6111652667225; Fri, 3 Mar 2023 06:30:07 -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-410-pq3G6XGtMjSqG_dwRYrLNw-1; Fri, 03 Mar 2023 09:29:07 -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 E6EB7803503; Fri, 3 Mar 2023 14:29:03 +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 D1968404BEC5; Fri, 3 Mar 2023 14:29:03 +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 1970A194973B; Fri, 3 Mar 2023 14:28:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1D4071943425 for ; Fri, 3 Mar 2023 14:28:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0DE8B404BEC6; Fri, 3 Mar 2023 14:28:25 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AB51404BECA for ; Fri, 3 Mar 2023 14:28:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677853805; 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=mh1QEE0ob8lGmnLJSP/K/XN+YMwAfIhMXvvCUvSbfIo=; b=Rz+NyNF4ABt4qd0lZ7DcH+ULZi7IK8YFhS1Mwn4ZcRP0DuszQ3jS2ENmt/airKQ3BEkjL1 yFkHsD4Ra80dVkReWAyfGkcXqn2jrgbj1/Ry/Cwgod/Ao0bkDs5Vp+kWiaFFFL0ly1T5Et EmUcoUezE4mZ5NUnBxp2mox+kt9bJho= X-MC-Unique: pq3G6XGtMjSqG_dwRYrLNw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/31] qemu: Remove return value checks from calls to virQEMUCapsNewCopy Date: Fri, 3 Mar 2023 15:27:53 +0100 Message-Id: <6d3234b9f74f92e5c9ebf387daedbbb524ac8703.1677853487.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1677853809218100001 Content-Type: text/plain; charset="utf-8" The function now can't fail. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 3 --- tests/qemucapabilitiestest.c | 3 +-- tests/testutilsqemu.c | 10 ++-------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index aba52cc10d..e7f7a6af4c 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -6055,9 +6055,6 @@ virQEMUCapsCacheLookupCopy(virFileCache *cache, ret =3D virQEMUCapsNewCopy(qemuCaps); virObjectUnref(qemuCaps); - if (!ret) - return NULL; - virQEMUCapsFilterByMachineType(ret, virtType, machineType); return ret; } diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 58beeb48cb..5be37a8380 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -150,8 +150,7 @@ testQemuCapsCopy(const void *opaque) virArchFromString(data->archName), capsFile))) return -1; - if (!(copy =3D virQEMUCapsNewCopy(orig))) - return -1; + copy =3D virQEMUCapsNewCopy(orig); if (!(actual =3D virQEMUCapsFormatCache(copy))) return -1; diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 672316c848..b78634a436 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -514,9 +514,7 @@ qemuTestCapsCacheInsertImpl(virFileCache *cache, if (qemu_emulators[arch]) { /* if we are dealing with fake caps we need to populate ma= chine types */ if (!virQEMUCapsHasMachines(caps)) { - if (!(copyCaps =3D effCaps =3D virQEMUCapsNewCopy(caps= ))) - return -1; - + copyCaps =3D effCaps =3D virQEMUCapsNewCopy(caps); qemuTestCapsPopulateFakeMachines(copyCaps, arch, hostO= S); } @@ -538,9 +536,6 @@ qemuTestCapsCacheInsertImpl(virFileCache *cache, else tmp =3D virQEMUCapsNew(); - if (!tmp) - return -1; - qemuTestCapsPopulateFakeMachines(tmp, i, hostOS); if (qemuTestCapsCacheInsertData(cache, qemu_emulators[i], tmp)= < 0) @@ -988,8 +983,7 @@ testQemuInfoInitArgs(struct testQemuInfo *info) g_hash_table_insert(info->conf->capscache, g_strdup(capsfile),= cachedcaps); } - if (!(info->qemuCaps =3D virQEMUCapsNewCopy(cachedcaps))) - return -1; + info->qemuCaps =3D virQEMUCapsNewCopy(cachedcaps); if (info->args.fakeCapsUsed) { size_t i; --=20 2.39.2