From nobody Mon Feb 9 19:30:28 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=1680183548; cv=none; d=zohomail.com; s=zohoarc; b=Z+gO5ceiR9DepacN1tEzPlrzwO1ct7k46SU1ssHGQjAQGzBCtxfNKC6mCWIDWz53BbGOFfxnMVNjRtyeEth5hT+wiTvoC0tBTapXG8lFQBegWBU4RQd0Fp+X0ukXyJFUpJ7KDRRTFWgv47m8mgVbOSk8P6vBq9QBenPX33Vu3lY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183548; 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=xCaw8hImLSlCUTUrmrgQiZvHM3bWeH+Vx4Dy+R8F0i4=; b=d6BK3Xi/sTLGJ97kAN5PVam/mk7pgzryBZh2KSORSTwSHTiyZ/VyalcSI9pIvDJUwyKY0Io6eoSQneYMmtLK3FoJ8+xEu7eVouH33jUbpYeJ4fUPxJtoQvuz3J4bvm9H4TwsJ3AjHFjFwABeSeCXTC4MBTD5wMv3H0sWuqnz0zg= 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 168018354882622.068974890434788; Thu, 30 Mar 2023 06:39:08 -0700 (PDT) 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-468-uE1tz9_7P_GjCPlRWdJPqA-1; Thu, 30 Mar 2023 09:39:03 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34F9D3814943; Thu, 30 Mar 2023 13:39:00 +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 21EA240BC798; Thu, 30 Mar 2023 13:39:00 +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 9880C1946A7F; Thu, 30 Mar 2023 13:38:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 57B391946A63 for ; Thu, 30 Mar 2023 13:38:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 468C22166B33; Thu, 30 Mar 2023 13:38:32 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id AD2002166B35 for ; Thu, 30 Mar 2023 13:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183547; 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=xCaw8hImLSlCUTUrmrgQiZvHM3bWeH+Vx4Dy+R8F0i4=; b=IFQJsmpikjNjLAweqbBUj9gwrCUeLUlERGWzBYPkVfk48OExdPQqcj+BKl1XhNbm09p9GL xmi0c1p+imThl9ZaD4qVmDKhYhs2bw5vHKt4zcaknvUDkYkj3gXl6JdxhIxBPBhY/yQlU5 CaXoCz5O0cyJjcDguaNtD+I++k83sIU= X-MC-Unique: uE1tz9_7P_GjCPlRWdJPqA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/31] virQEMUCapsInitGuestFromBinary: Refactor cleanup Date: Thu, 30 Mar 2023 15:37:59 +0200 Message-Id: <6540069a26cbc553bdc93cc218947a37cc05d584.1680182808.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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.2 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: 1680183549852100004 Content-Type: text/plain; charset="utf-8" Remove useless call to virCapabilitiesFreeMachines as the pointers were cleared and the unneeded 'ret' variable. Since we don't need to clear the 'machines' pointer now, remove that as well. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0201f288b3..135455df63 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1105,7 +1105,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, virCapsGuest *guest; virCapsGuestMachine **machines =3D NULL; size_t nmachines =3D 0; - int ret =3D -1; if (!binary) return 0; @@ -1118,9 +1117,6 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, guestarch, binary, NULL, nmachines, machines); - machines =3D NULL; - nmachines =3D 0; - /* CPU selection is always available, because all QEMU versions * we support can use at least '-cpu host' */ virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_CPUS= ELECTION); @@ -1155,11 +1151,7 @@ virQEMUCapsInitGuestFromBinary(virCaps *caps, virCapabilitiesAddGuestFeature(guest, VIR_CAPS_GUEST_FEATURE_TYPE_= NONPAE); } - ret =3D 0; - - virCapabilitiesFreeMachines(machines, nmachines); - - return ret; + return 0; } --=20 2.39.2