From nobody Fri May 3 21:59:01 2024 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=1626189216; cv=none; d=zohomail.com; s=zohoarc; b=CDKm5MHOQiHx9BH+X2KaCejjvOF4qJqu53EskIUO1hY2jbXMjVVlJ3RgfvqVX5tWVlCpoL7eQbI8Uf8BhDjorG0g8pJEixvGZJk/N0GJfJ5ePdMziORp/vSHfMLGNscVJFGZMCLTV9vylqlz1Q4ojAUlZeoAckwExD5d/wPt07s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189216; h=Content-Type:Content-Transfer-Encoding:Cc: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=wDmOVz9jPeYXF2Y2gS8nM7VQjibxu9H6Gs0YfuvzarI=; b=UwuRqf/DVwg5PFUHt5TEiFbyQ40+Und+L2v/SVO5bFw6S5cb81i/zm3545cHqH59gkZxk1lNU/BZbJDlj0o1mpNUwk1V5++cUkOwEeNNu17ZPLGQ6FM11xVx43sE5r8eTIlsdNHyba8H/NgPT8Ud1cCfhpEAPSpjdAsNzV6KHVE= 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 1626189216181913.2215515351461; Tue, 13 Jul 2021 08:13:36 -0700 (PDT) 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-283-vy_xU0WMPMej7rAnWgD7wQ-1; Tue, 13 Jul 2021 11:13:26 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3C9618D6A33; Tue, 13 Jul 2021 15:13:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 916895F714; Tue, 13 Jul 2021 15:13:20 +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 53B001832DC0; Tue, 13 Jul 2021 15:13:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCJZ3003607 for ; Tue, 13 Jul 2021 11:12:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 116955C22A; Tue, 13 Jul 2021 15:12:19 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 338F65C1C5; Tue, 13 Jul 2021 15:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189215; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=wDmOVz9jPeYXF2Y2gS8nM7VQjibxu9H6Gs0YfuvzarI=; b=LPMZgw8/sCCiBT4ZCYYPOlOtzZXHQyrtUu2/2lWXAIkcJs8SlmCA5FIiojxZeJ/HdnppAB 69SGMB6CBcSGOmgmFNF56tSTdRV4hMcJso+CGo5Ui2GFjINB7vQBRdDgMfz6kjTDF8KYgg 0aafd2DpopHBz5o8Ym8FOQ7t4HPK4kk= X-MC-Unique: vy_xU0WMPMej7rAnWgD7wQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 01/10] virNWFilterCreateVarsFrom: `virHashNew` cannot return NULL Date: Tue, 13 Jul 2021 17:12:03 +0200 Message-Id: <20210713151212.62582-2-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189218495100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewallt= est.c index 6709cc15fd..3b7190b5cd 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -149,8 +149,6 @@ virNWFilterCreateVarsFrom(GHashTable *vars1, GHashTable *vars2) { GHashTable *res =3D virHashNew(virNWFilterVarValueHashFree); - if (!res) - return NULL; =20 if (virNWFilterHashTablePutAll(vars1, res) < 0) goto err_exit; --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 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=1626189159; cv=none; d=zohomail.com; s=zohoarc; b=cePMln+xf5S9N4Rg3UXJsUhJrCw47oJmT51EqdefNMfPmO/Twk4FYt3pZT597mnwVeaJmQF6QmzYVQGjYcbwQTT9+jLwkOVEUpmZMZk7D8b/dB9Pdw1+AFKQtDLtIKfQinzQtc385KdZmhdykyxZW3+OXKX76q9wDcTq4M0rdV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189159; h=Content-Type:Content-Transfer-Encoding:Cc: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=TGgFlWCTNQvBwFw+GvP2cajUe4pYGxV6xhUXHqlTBHE=; b=E/4gkzG2cg8NZMF1zBHb8jefBJ44AYRmnX6q5o5wHlEupu9yt9gnXmhIsUABJp/jm5/kH0SmFlgevIz61coLObS+qdMfd5vUWCbe2busp5qfAQaVOBSkSJh10MTFRnX+gjzIXf4WpcdbdkSuOPa/Dd+0wT3/HWUr7E+QgZMrkTk= 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 1626189159175815.4780238144997; Tue, 13 Jul 2021 08:12:39 -0700 (PDT) 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-480-MS2VEB7CPHueqEzCDomt8Q-1; Tue, 13 Jul 2021 11:12:36 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9DAA100C609; Tue, 13 Jul 2021 15:12:30 +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 C6FC160C05; Tue, 13 Jul 2021 15:12:30 +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 7CCF24A712; Tue, 13 Jul 2021 15:12:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCKwi003615 for ; Tue, 13 Jul 2021 11:12:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 421F25C22A; Tue, 13 Jul 2021 15:12:20 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6328F5C1C5; Tue, 13 Jul 2021 15:12:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189158; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=TGgFlWCTNQvBwFw+GvP2cajUe4pYGxV6xhUXHqlTBHE=; b=BwLbFiAG0k4QPtL2+bxF3x9y5bP3OuKBOGaqpa01Eg6HYVh6lz5yfk2Rz8TKDnajUR9K8k ETokfv1Wp/afQCC/2jIG7d5yqQxXGgES6tkEtceS9Zkv3EY65a/aT/buFPh1uNM2BB1Gne /rd9a27rT/7FOmJWoXA7jNqKscTqlqc= X-MC-Unique: MS2VEB7CPHueqEzCDomt8Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 02/10] virNWFilterCreateVarsFrom: Use automatic memory management Date: Tue, 13 Jul 2021 17:12:04 +0200 Message-Id: <20210713151212.62582-3-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189160425100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewallt= est.c index 3b7190b5cd..26d4a936ad 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -148,7 +148,7 @@ static GHashTable * virNWFilterCreateVarsFrom(GHashTable *vars1, GHashTable *vars2) { - GHashTable *res =3D virHashNew(virNWFilterVarValueHashFree); + g_autoptr(GHashTable) res =3D virHashNew(virNWFilterVarValueHashFree); =20 if (virNWFilterHashTablePutAll(vars1, res) < 0) goto err_exit; @@ -156,10 +156,9 @@ virNWFilterCreateVarsFrom(GHashTable *vars1, if (virNWFilterHashTablePutAll(vars2, res) < 0) goto err_exit; =20 - return res; + return g_steal_pointer(&res); =20 err_exit: - virHashFree(res); return NULL; } =20 --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 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=1626189161; cv=none; d=zohomail.com; s=zohoarc; b=KNCS5NkDqKxqHFCfREm6zNgtK11AlnFjZZ7LllYO5VztFG9ncbjAOtnShutz9W/9Pwhhqidt8ypjOCI0L+WP4n2KGsz0641FaMSXHojF0qg52ruXFJfT77De+ISaAyE5IZ/erWWrXdub2TYPEdzCdVYncZ0lo1uC+x5Odo8s2Os= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189161; h=Content-Type:Content-Transfer-Encoding:Cc: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=iSumXNzw4ksXb0QWOyU0UnYtVLDLJRq7bLPLpk6LrBU=; b=Ve8R6Yz+zWMmeskCP0jMVDKvpX7p01Cv61ByHpHakjSl0GTSViarylTqw+ILEYxI+N4fV/9RvtH44qyRjgNj6tjWJdxL62PaNm0NeAUOYH1kk55xKqi2NIIwpjc7RBNXgJ+3wq5x1odD7V8P3P3Fm/oYQMx2T891cA4arKtA88I= 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 1626189161651283.2306143856572; Tue, 13 Jul 2021 08:12:41 -0700 (PDT) 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-336--_FDatY2Nqqu2_34LBNIQg-1; Tue, 13 Jul 2021 11:12:39 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF600100C61F; Tue, 13 Jul 2021 15:12:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF15660C05; Tue, 13 Jul 2021 15:12:33 +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 8CA0D1832ADB; Tue, 13 Jul 2021 15:12:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCLHd003625 for ; Tue, 13 Jul 2021 11:12:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 731825C22A; Tue, 13 Jul 2021 15:12:21 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9497B5C1C5; Tue, 13 Jul 2021 15:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189160; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=iSumXNzw4ksXb0QWOyU0UnYtVLDLJRq7bLPLpk6LrBU=; b=gVS0n+CYvjj2fAQ8jTBMC9+1JHxBi05JImMnl69KqbOWhXyTOVnRPzTMHAuE2qTcmivHEZ 3tf25iWE4Kd/retHDJHcq7/bZcbAa5tpccRSC8c2pDWYwz3oZ/6Gu2XRQqDfGZAioOd/FC DrH7+UIuJgOp/afzJT37qdxuVdyEGlQ= X-MC-Unique: -_FDatY2Nqqu2_34LBNIQg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 03/10] virNWFilterCreateVarsFrom: Remove superfluous `goto`s Date: Tue, 13 Jul 2021 17:12:05 +0200 Message-Id: <20210713151212.62582-4-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189162730100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewallt= est.c index 26d4a936ad..bdfe858185 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -151,15 +151,12 @@ virNWFilterCreateVarsFrom(GHashTable *vars1, g_autoptr(GHashTable) res =3D virHashNew(virNWFilterVarValueHashFree); =20 if (virNWFilterHashTablePutAll(vars1, res) < 0) - goto err_exit; + return NULL; =20 if (virNWFilterHashTablePutAll(vars2, res) < 0) - goto err_exit; + return NULL; =20 return g_steal_pointer(&res); - - err_exit: - return NULL; } =20 =20 --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 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=1626189153; cv=none; d=zohomail.com; s=zohoarc; b=dBrrjQmEOHAqT2lIIGXlCFklR1JZPDhehy4ajTPVpThzQvh/WJ5WCuXgkeBMKGKEl2+495E9lm7oHRXNfEji45j1VEDqQmpqZVB5laRBxWWTjLj8kjBXslPKnt3/eMNaQ2gzO96SFkhG834fGOEqQQJeCPW25UjuM02UXgUxkjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189153; h=Content-Type:Content-Transfer-Encoding:Cc: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=nw0CizcJkzj/cGee3g1DFBxTtGqmp1WnKf9D5I4Ex+o=; b=jRYVJpmtMVpclOsN/3i1sk1vEjQ94S79HXFVMbTTGQwKIcc04sxigdc2JvjXQRACf60U5CSKtYp8EdQitf1r2o72gxsT19T6A/4hqW0M7NInduxLSI/lgL4rE0XslkpX5YFsrI84Df7uyHNZD6UXnFPaeqyDhrmwTn/fcPzW4tc= 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 162618915313582.52545447451416; Tue, 13 Jul 2021 08:12:33 -0700 (PDT) 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-452-YuoVDSKCOa6AnSjhYeM7Ug-1; Tue, 13 Jul 2021 11:12:29 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B81BE800050; Tue, 13 Jul 2021 15:12:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46FE860BD8; Tue, 13 Jul 2021 15:12:24 +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 C1ABC1826D29; Tue, 13 Jul 2021 15:12:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCMVt003637 for ; Tue, 13 Jul 2021 11:12:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id A35755C22A; Tue, 13 Jul 2021 15:12:22 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id C51AB5C1C5; Tue, 13 Jul 2021 15:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189151; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=nw0CizcJkzj/cGee3g1DFBxTtGqmp1WnKf9D5I4Ex+o=; b=PMGWWJ+GQOHec32/Sw9S9+xjbdSkhBtZCIeKlQ6Als4myvMLOyeDWeEoCclvr5IWJmZiZs p6D08Rx78XmAxQHPBRQZGs3C7/0JHh5O8A6O0Id3puhxVfMCKPjrk/8713uOlnMgCcULOl KHIhjSCIxf7mKlhQB/sOmPJyifYovm8= X-MC-Unique: YuoVDSKCOa6AnSjhYeM7Ug-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 04/10] virNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL Date: Tue, 13 Jul 2021 17:12:06 +0200 Message-Id: <20210713151212.62582-5-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189154976100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- tests/nwfilterxml2firewalltest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewallt= est.c index bdfe858185..75a70e9972 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -208,8 +208,8 @@ virNWFilterRuleDefToRuleInst(virNWFilterDef *def, ruleinst->chainPriority =3D def->chainPriority; ruleinst->def =3D rule; ruleinst->priority =3D rule->priority; - if (!(ruleinst->vars =3D virHashNew(virNWFilterVarValueHashFree))) - goto cleanup; + ruleinst->vars =3D virHashNew(virNWFilterVarValueHashFree); + if (virNWFilterHashTablePutAll(vars, ruleinst->vars) < 0) goto cleanup; =20 --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 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=1626189158; cv=none; d=zohomail.com; s=zohoarc; b=FoSjVSwr7y6+HtmowMA7fHFe4I0iEjybCNI3nDxUHK1Igu/wGV1ercyFdD3h3ez2WJ37DB0Z0SlnO5xSrVmDTVTrnDX5DdOENIpTA43+Ay/0SCEA8SjuvNdOLbW9XaDAaV+HnWMtxcRljWzTq8RzCk5l98QmTNRMOJb0BWVaTqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189158; h=Content-Type:Content-Transfer-Encoding:Cc: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=jqFXOrVrdtiSFnthx5rhIOTDtculHhWkmYVZuUaGLJE=; b=YkHYAJQbkBDPS0LcFISnRZKrG1yQJQoWcyl++Ca8xxCNO3GgwX9lqr4SewFlyZFIhAa8vE8gT0yvGuFpbnCoHrSZIB/bj0zEnNwNGU+ugnNcWlaOJhKNP+5jAX0BlfAOFRpZQQYIQCUNnJ14ToXb24LfWNZJTmpQeY+xQZafKGE= 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 1626189158548989.2059312285488; Tue, 13 Jul 2021 08:12:38 -0700 (PDT) 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-542-t_KWqVfKPh2d978kkMMzqQ-1; Tue, 13 Jul 2021 11:12:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E232100C61B; Tue, 13 Jul 2021 15:12:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 037D719C44; Tue, 13 Jul 2021 15:12:30 +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 B84A21832648; Tue, 13 Jul 2021 15:12:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCNPe003650 for ; Tue, 13 Jul 2021 11:12:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id D37D85C1D1; Tue, 13 Jul 2021 15:12:23 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 018BF5C1C5; Tue, 13 Jul 2021 15:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189157; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=jqFXOrVrdtiSFnthx5rhIOTDtculHhWkmYVZuUaGLJE=; b=fLJV/N2Y2bmAItF/UrTAO/H/Xu/3tZs7Qbt7FHsURl3UvRDsYJFjMuLK08hYbQDF5wuWwe HwYJZX5qGYXULqdIIH8UnDxCTGCGFXSoHvjMi6HijxUBoWTb11bESudDN6mHt07vynopLF saTl1uyBt/bJDJYzY64XljZVmXClllI= X-MC-Unique: t_KWqVfKPh2d978kkMMzqQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 05/10] iptablesPrivateChainCreate: `virHashNew` cannot return NULL Date: Tue, 13 Jul 2021 17:12:07 +0200 Message-Id: <20210713151212.62582-6-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189160208100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/viriptables.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 4189578245..198ece3d71 100644 --- a/src/util/viriptables.c +++ b/src/util/viriptables.c @@ -70,17 +70,12 @@ iptablesPrivateChainCreate(virFirewall *fw, void *opaque) { iptablesGlobalChainData *data =3D opaque; - GHashTable *chains =3D NULL; - GHashTable *links =3D NULL; + GHashTable *chains =3D virHashNew(NULL); + GHashTable *links =3D virHashNew(NULL); const char *const *tmp; int ret =3D -1; size_t i; =20 - if (!(chains =3D virHashNew(NULL))) - goto cleanup; - if (!(links =3D virHashNew(NULL))) - goto cleanup; - tmp =3D lines; while (tmp && *tmp) { if (STRPREFIX(*tmp, "-N ")) { /* eg "-N LIBVIRT_INP" */ --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1626189162; cv=none; d=zohomail.com; s=zohoarc; b=BqONE+tK0xUtjgbHBE0LDLMp6HXmhffRpRzpVrIUv1OBYesf2m7W349Nk3jI8O+YSpDwXjTfXn+8hD57C7ULLaO+dXdKzrGoSzeH228QbVbWhTlE9asfvJBiTTJgXCk9uSLtfToIqqTT7s+ZB43k4Wy1iTRv7j0sKZbLRYvlobs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189162; h=Content-Type:Content-Transfer-Encoding:Cc: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=coZLb57f67Yzts/fgvkc7LjdSqjP9yzMiP39J0+NvuU=; b=Kj0Es8A+0v3Q+Dfonx2CTfk1IoKZgzNkCl2f6XSiY7XQo+IvrK9UO8Qb57ohmyIid9gA5Ha+jFEqlu9srn3cGrM9Im5p2neAYbIO8Q3gbtKXXGbZotDNwm9I0Ml7ExKVlKYYMBjH02fV1IMs8gyUyGpBMQ4SQXSpzQCFhbXTWko= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1626189162011878.6434689113087; Tue, 13 Jul 2021 08:12:42 -0700 (PDT) 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-225-QGZljj6GMAquGKhp9beltA-1; Tue, 13 Jul 2021 11:12:39 -0400 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 671C18015C6; Tue, 13 Jul 2021 15:12:33 +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 3BA101009962; Tue, 13 Jul 2021 15:12:33 +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 DE4A64EA29; Tue, 13 Jul 2021 15:12:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCPkd003658 for ; Tue, 13 Jul 2021 11:12:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0FBBB5C232; Tue, 13 Jul 2021 15:12:25 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 313C65C22A; Tue, 13 Jul 2021 15:12:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189161; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=coZLb57f67Yzts/fgvkc7LjdSqjP9yzMiP39J0+NvuU=; b=G9At0JMRXg32nDuB7xElMz6AS1a15lUm47EKNqbp7SW1V9UMj9E6BecOmuQBetYyyvMOCZ 8M2WpaUyuXq8zO2giMdbT0UAw8UsjPnANFakeZAFSupmaolCTCIWkbnOLN+7tSOLMhFzD9 Xo3tPmJOQGir+Ee65FTgsUCbfMC4KyA= X-MC-Unique: QGZljj6GMAquGKhp9beltA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 06/10] iptablesPrivateChainCreate: Use automatic memory management Date: Tue, 13 Jul 2021 17:12:08 +0200 Message-Id: <20210713151212.62582-7-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189162815100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/viriptables.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 198ece3d71..847af9b9d7 100644 --- a/src/util/viriptables.c +++ b/src/util/viriptables.c @@ -70,8 +70,8 @@ iptablesPrivateChainCreate(virFirewall *fw, void *opaque) { iptablesGlobalChainData *data =3D opaque; - GHashTable *chains =3D virHashNew(NULL); - GHashTable *links =3D virHashNew(NULL); + g_autoptr(GHashTable) chains =3D virHashNew(NULL); + g_autoptr(GHashTable) links =3D virHashNew(NULL); const char *const *tmp; int ret =3D -1; size_t i; @@ -114,8 +114,6 @@ iptablesPrivateChainCreate(virFirewall *fw, =20 ret =3D 0; cleanup: - virHashFree(chains); - virHashFree(links); return ret; } =20 --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1626189166; cv=none; d=zohomail.com; s=zohoarc; b=hKJ879xVnAB1HdA+++Mha1XaUJ06dwBhIp+fdcB6dUgFnkD/yU9Mr/uQBHbiyPxwHZUSFSpgx7RmEBDSAdzapFZvG6Wvr8PM9R0gps0CEa4NNQYTT54m61OlFYvklc2vNZJEy5WHW6INCrV/dISs6QN/ODkxZMlqbRkEP7r2ecc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189166; h=Content-Type:Content-Transfer-Encoding:Cc: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=HfjulMWMRCMdogHtCFsC/NuageQfnEIeupdPYmG/Io8=; b=Gfgv2dMDO8m+xu0L+shHfc0UoZp5Ikr3d+6tKtJMLa0Af3dyxH90ZKUhKrPUyo+cneYrEORM9TQPV/7G3++5ciRTLzmn39Tu0JM8l3dx1/TT3pZe6REDonPwkafS7YcVQUEfpaWecYHzRoi0OaAH24J1uQ6n7OsdppgTiJlHSmk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1626189166736705.6116808464832; Tue, 13 Jul 2021 08:12:46 -0700 (PDT) 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-261-gRvebMmRP7W3GzC6FksAyA-1; Tue, 13 Jul 2021 11:12:43 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 27C9B80430A; Tue, 13 Jul 2021 15:12:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F162C19C44; Tue, 13 Jul 2021 15:12:36 +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 B74CB1832DBC; Tue, 13 Jul 2021 15:12:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCQ4A003668 for ; Tue, 13 Jul 2021 11:12:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3EE785C22B; Tue, 13 Jul 2021 15:12:26 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61F405C22A; Tue, 13 Jul 2021 15:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189165; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=HfjulMWMRCMdogHtCFsC/NuageQfnEIeupdPYmG/Io8=; b=DRdY4fXFqA8s20HQuGffws9pz3GxvKc246KdKhMHHBVAutfmQqmIE1BCtzRU1Iy8QG9Zlu /WRui7184HLsvdzmUqVkx3kQDEVXlEbf3LdMswZCm7q3Z0tvw8io1t0XMktr81tdoU2qO7 tlBJZGNJFq59YI4kJibHhr6GgUfXu0Q= X-MC-Unique: gRvebMmRP7W3GzC6FksAyA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 07/10] iptablesPrivateChainCreate: Remove superfluous `goto`s Date: Tue, 13 Jul 2021 17:12:09 +0200 Message-Id: <20210713151212.62582-8-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189167721100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/util/viriptables.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 847af9b9d7..721e1eeae7 100644 --- a/src/util/viriptables.c +++ b/src/util/viriptables.c @@ -73,14 +73,13 @@ iptablesPrivateChainCreate(virFirewall *fw, g_autoptr(GHashTable) chains =3D virHashNew(NULL); g_autoptr(GHashTable) links =3D virHashNew(NULL); const char *const *tmp; - int ret =3D -1; size_t i; =20 tmp =3D lines; while (tmp && *tmp) { if (STRPREFIX(*tmp, "-N ")) { /* eg "-N LIBVIRT_INP" */ if (virHashUpdateEntry(chains, *tmp + 3, (void *)0x1) < 0) - goto cleanup; + return -1; } else if (STRPREFIX(*tmp, "-A ")) { /* eg "-A INPUT -j LIBVIRT_IN= P" */ char *sep =3D strchr(*tmp + 3, ' '); if (sep) { @@ -88,7 +87,7 @@ iptablesPrivateChainCreate(virFirewall *fw, if (STRPREFIX(sep + 1, "-j ")) { if (virHashUpdateEntry(links, sep + 4, (char *)*tmp + 3) < 0) - goto cleanup; + return -1; } } } @@ -112,9 +111,7 @@ iptablesPrivateChainCreate(virFirewall *fw, "--jump", data->chains[i].child, NULL); } =20 - ret =3D 0; - cleanup: - return ret; + return 0; } =20 =20 --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1626189166; cv=none; d=zohomail.com; s=zohoarc; b=HwpP1RhNvsDCs4mq2leGddbHqaPB+hhkjjR/koB7bt8HERI67GWCBPA55rjoQBigocaLhe0SyFEF2EI7k9a5pTlmVcK15bT95IOpnBhkdOSsEsEoONHkq2I4ExvnOQOQPXJ5LmNNfFBXWFbZvXcELuOVDNl89kdFbLJrvfCQ+IM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189166; h=Content-Type:Content-Transfer-Encoding:Cc: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=CqeeHXB+8ItRmBBy2De3P4DPWZuVPPs4qPW3JZEj1aQ=; b=YGsH1JdYzUw0ng2XnXvPZm2WxRsmTmTAakogphMEHdrGHOPKOZiLBC5ng7jxIimudfBZDGe7LtyiUcCpQfAH+6SDIqrr2wX5rZn/689pFkzE/MguduwMfAAmxwWvVIpq0OYbz3Gi23nRvhCWwcLmkRVzzVQ+Gu0Bg5ranRd3HUU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1626189166662464.754315759663; Tue, 13 Jul 2021 08:12:46 -0700 (PDT) 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-507-HRmdLK4mO-6N_LhDrxw7tQ-1; Tue, 13 Jul 2021 11:12:43 -0400 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 5EA948030D7; Tue, 13 Jul 2021 15:12:36 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 375C41009962; Tue, 13 Jul 2021 15:12:36 +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 C579B1832ADE; Tue, 13 Jul 2021 15:12:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCRuc003679 for ; Tue, 13 Jul 2021 11:12:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 46D165C22B; Tue, 13 Jul 2021 15:12:27 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9154B5C22A; Tue, 13 Jul 2021 15:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189165; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=CqeeHXB+8ItRmBBy2De3P4DPWZuVPPs4qPW3JZEj1aQ=; b=jKwG4cwqTqW89/gExV8k0Z0cHxDEAmWOUa7kJmv2d/qy8mHfaGNnQdwASu8S5zQf8EgCC7 xokqipHY6rfpwlBLsu9btecYZGwMMUE96kEYjDzh0e7eDnxlPPF4YlTobfsxS213iRn20G hsbwl605Jb4K4gr9DjyQgIuXAdbsV4M= X-MC-Unique: HRmdLK4mO-6N_LhDrxw7tQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 08/10] qemuMonitorGetMemoryDeviceInfo: Assign hash table only on success Date: Tue, 13 Jul 2021 17:12:10 +0200 Message-Id: <20210713151212.62582-9-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189167541100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index a2df1a6ec3..9b1a3ec3eb 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4214,6 +4214,7 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { + GHashTable *hash; int ret; =20 VIR_DEBUG("info=3D%p", info); @@ -4222,14 +4223,13 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, =20 QEMU_CHECK_MONITOR(mon); =20 - if (!(*info =3D virHashNew(g_free))) + if (!(hash =3D virHashNew(g_free))) return -1; =20 - if ((ret =3D qemuMonitorJSONGetMemoryDeviceInfo(mon, *info)) < 0) { - virHashFree(*info); - *info =3D NULL; - } + if ((ret =3D qemuMonitorJSONGetMemoryDeviceInfo(mon, hash)) >=3D 0) + *info =3D g_steal_pointer(&hash); =20 + virHashFree(hash); return ret; } =20 --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1626189212; cv=none; d=zohomail.com; s=zohoarc; b=BWbANF2HaNT7Q/xGsSi8/4LpsKpSu612Cmo33hU0fiNtoNGJHcqf2R5ctR/JBi1qtIaDmq1asINCD3hflgnAibNtc57eB5+yyaTQv/nBSjpWBgcixT8h3s/LRRzrDUhy1rAF13YugkGtVNOCcqbROabX/M9tPmIZTwgQ2Zpi4VQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189212; h=Content-Type:Content-Transfer-Encoding:Cc: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=AS2marPRLJk+WHIZSAew2vxML2T3X6O6c1aAz7suGtE=; b=daWBGjqRQJ5Mjax2NIgRtNKFnkLtsCULm6kfzBc7e49rLbN2DM/XWxnlEmPy+n9GItniMtQLy/y2YFmGcO2DIhhRBpAUIz/j8RqGV+3ql5ELJh0gmxF8sIGsw9WnUc64DyQYoDCY6OEgcAD57kfQ6UWMSkugyL8vu2rzxHOhHOY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1626189212367416.5733163964218; Tue, 13 Jul 2021 08:13:32 -0700 (PDT) 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-207-8kg_tzTtOqmAN9LnqhtuIg-1; Tue, 13 Jul 2021 11:13:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AFABD100C611; Tue, 13 Jul 2021 15:13:23 +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 9066060C5A; Tue, 13 Jul 2021 15:13:23 +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 5952A4EA29; Tue, 13 Jul 2021 15:13:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCSpj003689 for ; Tue, 13 Jul 2021 11:12:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4DB645C22B; Tue, 13 Jul 2021 15:12:28 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 992EC5C22A; Tue, 13 Jul 2021 15:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189211; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=AS2marPRLJk+WHIZSAew2vxML2T3X6O6c1aAz7suGtE=; b=W7lPe4Xhie2skXD960G91vjCj80yXdzDblkeT8Iisa5cYbEchIDzsaE42c6iTzKMx4KTgn 1fxzs3VYxSML2bGGnq2M3bAfSAh3hx2PGlC/zjZcW/b6yVmImIIbbYeJUapI4b/p0w7JW3 p/cEJBeOC/ZBiUGnOa2oRDq+QoXroXo= X-MC-Unique: 8kg_tzTtOqmAN9LnqhtuIg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 09/10] qemuMonitorGetMemoryDeviceInfo: Use automatic memory management Date: Tue, 13 Jul 2021 17:12:11 +0200 Message-Id: <20210713151212.62582-10-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake 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.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189213065100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 9b1a3ec3eb..0b5da8b71f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4214,7 +4214,7 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { - GHashTable *hash; + g_autoptr(GHashTable) hash =3D NULL; int ret; =20 VIR_DEBUG("info=3D%p", info); @@ -4229,7 +4229,6 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, if ((ret =3D qemuMonitorJSONGetMemoryDeviceInfo(mon, hash)) >=3D 0) *info =3D g_steal_pointer(&hash); =20 - virHashFree(hash); return ret; } =20 --=20 2.31.1 From nobody Fri May 3 21:59:01 2024 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=1626189195; cv=none; d=zohomail.com; s=zohoarc; b=UD+1ZkS1gY7kQMQrSHpRcjvQiIjh8WcVwxMdA41Z1HzxINHdlBd9MEfWLPOeAuaYnXQKIsczYeiGYr+UjYvwQDLi4y25fvEfghCtChGT+RiWrpSYHrH4saOOktm0BvsJyVd/EROLrBODeywwsDqYtDxnlmzMy/Eh+0vEVbYfXnk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626189195; h=Content-Type:Content-Transfer-Encoding:Cc: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=eWE38zRxJWT78V7C63LyHVeEgGUMHmEoae5Zep8Lork=; b=fwh+LYDFaP1FR4NgHf+PafidYQdD3GcHojVT/ryRPw/i0bwK4KCp25yJefasf7H0iWBZn3c7/JXeeDSg7KErVbomQOWt7y2I/gS9VU74olhFopvnCipBPeyW6/jpfbzqOdzHsMqOmAXYXuEBavf+eEdfH9dL2w820eYeNW2p29o= 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 162618919537999.92743030072745; Tue, 13 Jul 2021 08:13:15 -0700 (PDT) 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-502-qr6y11FgPG2kDh2KZVz6eA-1; Tue, 13 Jul 2021 11:12:44 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 80B2080430F; Tue, 13 Jul 2021 15:12:39 +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 378075C22A; Tue, 13 Jul 2021 15:12:39 +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 03C624EA29; Tue, 13 Jul 2021 15:12:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16DFCTWp003698 for ; Tue, 13 Jul 2021 11:12:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7E8195C22A; Tue, 13 Jul 2021 15:12:29 +0000 (UTC) Received: from work.redhat.com (ovpn-113-139.ams2.redhat.com [10.36.113.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id A03CE5C22B; Tue, 13 Jul 2021 15:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626189194; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=eWE38zRxJWT78V7C63LyHVeEgGUMHmEoae5Zep8Lork=; b=K8GqbHLsjVb1YTjZDAGfBmQeey1duDjXpb0GjMb8d6SqXmJgWAjy6ejsXe2dL3t+HujOkE EdpCLxmHbNRkkkLjluYn1JikJK0D1osOgpSJbT/F8DeLe76MVd9/YNbFZOFP9xti7T9C19 yemuEaXhv3O4MPZvCiFZT3OOG5zLqAw= X-MC-Unique: qr6y11FgPG2kDh2KZVz6eA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v2 10/10] qemuMonitorGetMemoryDeviceInfo: `virHashNew` cannot return NULL Date: Tue, 13 Jul 2021 17:12:12 +0200 Message-Id: <20210713151212.62582-11-twiederh@redhat.com> In-Reply-To: <20210713151212.62582-1-twiederh@redhat.com> References: <20210713151212.62582-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Peter Krempa , Tim Wiederhake 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.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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: 1626189196169100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0b5da8b71f..f66a3457c1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4214,7 +4214,7 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { - g_autoptr(GHashTable) hash =3D NULL; + g_autoptr(GHashTable) hash =3D virHashNew(g_free); int ret; =20 VIR_DEBUG("info=3D%p", info); @@ -4223,9 +4223,6 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, =20 QEMU_CHECK_MONITOR(mon); =20 - if (!(hash =3D virHashNew(g_free))) - return -1; - if ((ret =3D qemuMonitorJSONGetMemoryDeviceInfo(mon, hash)) >=3D 0) *info =3D g_steal_pointer(&hash); =20 --=20 2.31.1