From nobody Sat Apr 27 22:52:23 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=1625819327; cv=none; d=zohomail.com; s=zohoarc; b=OJQAqaROPfcLeseyqYqM1Ttvm4jjtQWXpVBBX6o86Rbttec6kNJDKHAroq4tog2dyt0PMfrjnnF35u6FVluqHqnCWdfu5hAmXEKyRJgANP7fjl4IF88GCkX+84f5oEN3QiZOzM62+iQka/uQtngqxYTXTXL+4AvI26pavhxYIzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819327; 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=hH6hvxUI03G1SEWbt4pv3sISi01lMQErB3BBsflA5yE=; b=LS8xv5Ocd5Q5PheKO7GSJoDsgWKwr1NapuwdczKfCwyMq6IWQmLlQLjVgYO6eehE7SyCxfRR1ml2kYcpta1EfOKuoX8dOqQ8mwdwCps4GuxXWSO5e0g8KtLe8xvHMGVaGr8gBrYYyMbXJ/pxsu6KrASZyqePrZq+jZR1mweNlW0= 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 1625819327331582.2059510389853; Fri, 9 Jul 2021 01:28:47 -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-466-iFkiNOwUPZiRhT5-6n74BQ-1; Fri, 09 Jul 2021 04:28:44 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E4054804300; Fri, 9 Jul 2021 08:28: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 389AD5D6D5; Fri, 9 Jul 2021 08:28: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 BB3624E9F5; Fri, 9 Jul 2021 08:28:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698Rqj0005764 for ; Fri, 9 Jul 2021 04:27:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9D10C60854; Fri, 9 Jul 2021 08:27:52 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9D6D60843; Fri, 9 Jul 2021 08:27:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819326; 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=hH6hvxUI03G1SEWbt4pv3sISi01lMQErB3BBsflA5yE=; b=Ehmag3PGlCz5hLBUcC7CUt+3R3fQZjH1jrdOu8F8M1ezR0MpaQ0AqXLammGDchi3yKiUFC hcDSozt8kaoFJghDmZe9g4Ad1b84jXxRzzsjihpFE1f6FaJl6uuIXIU3USZEQruAOsNbbh Eu86vk89Ofj/aNTxlujokTpi10zsztI= X-MC-Unique: iFkiNOwUPZiRhT5-6n74BQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/10] virNWFilterCreateVarsFrom: `virHashNew` cannot return NULL Date: Fri, 9 Jul 2021 10:27:30 +0200 Message-Id: <20210709082739.29043-2-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.15 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: 1625819328211100001 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 Sat Apr 27 22:52:23 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=1625819334; cv=none; d=zohomail.com; s=zohoarc; b=RFWvH8wwoVBsKRUl9rxaa1+yBwakRG4UjzjeHxDSg4EiICYMtUcfNZt2sGfXyiP8JrfImW+sHbUO2xA9HIuHwhtlNQjUNY3BI9OZodTu92PVmaliOJwkYDKTrgMsi+1n0wuflJ8QEeBdC2nX8xAW4NCloxPcAHm92qJ9YrwbyDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819334; 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=AW9O5kdWc9WXxlfZmP4qKijgwQ7eXNK7scog0XXXglk=; b=KwzhJnIKjioZ5e+ghmASVUdf23WB+Cc2vlsX8PfMxIdUr4pMXY31nR9vPjvzrUioBPnOmCADzCaXqF2m4paoPEK5y2kXgbzg8kpbT2V0NpIBc16kNccrJ4EV/yxRAdLrBrrDNnyTaObuQqbbgIiYwUXPq7p0M7h0Mxez0K+hCnA= 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 1625819334743869.2295688384992; Fri, 9 Jul 2021 01:28:54 -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-403-xnsT21HnOA6wb01OyZCV4g-1; Fri, 09 Jul 2021 04:28:52 -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 06021101F006; Fri, 9 Jul 2021 08:28:47 +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 DA4E460C04; Fri, 9 Jul 2021 08:28:46 +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 A23441809CB2; Fri, 9 Jul 2021 08:28:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698RuuE005770 for ; Fri, 9 Jul 2021 04:27:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id E581E60861; Fri, 9 Jul 2021 08:27:56 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E4A760843; Fri, 9 Jul 2021 08:27:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819333; 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=AW9O5kdWc9WXxlfZmP4qKijgwQ7eXNK7scog0XXXglk=; b=MT8uWoBr+sLCM4otrupCn3woM44VwmezwiZ9toeZ416CdWVaUOq32IjRZ2pBgg9Iixp1OT BhKs2AidxResd3mbUnGiT0y4xM9i0bWK2+HR8Q5gqSStloX174owzMehD8hVPYGaK8fnVM t8LIwZb7fVILQAQJn6GKMsmIX4Yo4mw= X-MC-Unique: xnsT21HnOA6wb01OyZCV4g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/10] virNWFilterCreateVarsFrom: Use automatic memory management Date: Fri, 9 Jul 2021 10:27:31 +0200 Message-Id: <20210709082739.29043-3-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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: 1625819336425100002 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 Sat Apr 27 22:52:23 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=1625819328; cv=none; d=zohomail.com; s=zohoarc; b=j6FUFiDugcSXCqBF8xPwdJdjGD9EyRUS4S9lnBB7h2qt997sVOxTnXxff1x7bWX+xPx4AeI8L0vUMfA3+pyHcnj/6nX18ViJAsxcRpLyPd5xEXqgfKHXmRcc4S2HGKEXmd0XC7MNuNrPlFLHGdhVekFvGXxuNgAOxlNXygAIFi0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819328; 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=lGnyakfoVTOy+hcNvGYLZlapcvfLDhZvvB+jnGrehPw=; b=iPzvd8blmVna8RkcNOgz8nX5M83LnHKwfevXenKhfir26TK27l9eZ6oVsQk1NmNhyuZMFZsj8E8n2pryK1XcvVBs7wvZuOFZih6PDT//QQmfmkWcItMkZ1K/ILRI0CzFkT/Qxyy1OKXlKfeAjUasDBcchceD+i8fv1JjNcn+7k8= 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 1625819328921427.46966243131715; Fri, 9 Jul 2021 01:28:48 -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-508-b4k4sybxM9S2KYRDIwz3bw-1; Fri, 09 Jul 2021 04:28:44 -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 8F85D5074F; Fri, 9 Jul 2021 08:28: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 40077100EBAD; Fri, 9 Jul 2021 08:28: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 456204EA2F; Fri, 9 Jul 2021 08:28:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698Rxxi005775 for ; Fri, 9 Jul 2021 04:27:59 -0400 Received: by smtp.corp.redhat.com (Postfix) id E1E9860861; Fri, 9 Jul 2021 08:27:59 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BA9A60843; Fri, 9 Jul 2021 08:27:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819327; 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=lGnyakfoVTOy+hcNvGYLZlapcvfLDhZvvB+jnGrehPw=; b=baZEIaajvhvlVXR5NmxOev3+qVKc3IpBeGqnXTvwy8xSD3O5HQ6fLeVPwMRK5ATQsEMGZY hsCXVMziba2puxTw0tnTdsews/oiAAeMca35ftilb2rkVW+77GXwr6sq2degUwbjE0beQZ DTuVjVvOZW86e2KOHR8wq5M7/YWvpSU= X-MC-Unique: b4k4sybxM9S2KYRDIwz3bw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/10] virNWFilterCreateVarsFrom: Remove superfluous `goto`s Date: Fri, 9 Jul 2021 10:27:32 +0200 Message-Id: <20210709082739.29043-4-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: 1625819330320100004 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 Sat Apr 27 22:52:23 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=1625819334; cv=none; d=zohomail.com; s=zohoarc; b=GFX/J0PV9O++CCyOQJmISZ/s5xQCf2RSiH2P7esg3HWE3Yji9YDYiJrYjq+d+sWkX9JIDKGP/dcAZWYFlnGu0fc5V5o9UsVKeGBilRJ1h8pRg/WMZQeztLl+IYv59Jc+kRXslsYs6Wxgp/uyBTFNm9LZPlMlFIxfMk45FhunjZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819334; 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=L79vE08Ct+/jhsjN9bB0gK5/cfHkkrWhryJJVwdNHvA=; b=lc3x7Uu6YcD1uSQAnuGEvwLIaqjPWDigIguOm5np2/hIlQ5Nw+AOQWuoC9SZQ3XSXX5tA9mhYqDYWwojmkTgKlNBcZrN8n/iB9U4RhgluwTsJk3XbXdrS9IF7IYsD8yE1QpRjZbaZbeuPzeZYtgNBSq7JRcGkUew2hQMJN8T8FM= 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 1625819334574212.47498681089792; Fri, 9 Jul 2021 01:28:54 -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-551-i8Ie5E-WP3Wa-jZJVQ-h1A-1; Fri, 09 Jul 2021 04:28:52 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F280519200CA; Fri, 9 Jul 2021 08:28:46 +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 D41895D9C6; Fri, 9 Jul 2021 08:28:46 +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 9EC551809CAC; Fri, 9 Jul 2021 08:28:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698S2HP005781 for ; Fri, 9 Jul 2021 04:28:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC3DA60861; Fri, 9 Jul 2021 08:28:02 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DFDF60843; Fri, 9 Jul 2021 08:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819333; 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=L79vE08Ct+/jhsjN9bB0gK5/cfHkkrWhryJJVwdNHvA=; b=Ud5Ou5AkJjF7iWTQZEpVaFtCCcSN3Z0dc9F7Q+LMehp/pok3K8L8mp8J9J90+FTJ1HT6U7 BLwvwonh0ebdVfPUhSlom5KyCJVwGrA76hxpzyg5y24holc58fN8m06kXmDExbEgnOhbpd Kgfs0TzvTWKVm0MXz2V8CAONGQuT6BU= X-MC-Unique: i8Ie5E-WP3Wa-jZJVQ-h1A-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/10] virNWFilterRuleDefToRuleInst: `virHashNew` cannot return NULL Date: Fri, 9 Jul 2021 10:27:33 +0200 Message-Id: <20210709082739.29043-5-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.14 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: 1625819336681100005 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 Sat Apr 27 22:52:23 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=1625819334; cv=none; d=zohomail.com; s=zohoarc; b=W+bboIl8/APox6xDqkN9MpcS8w6e150S2ceUZpLn4FLITFw1fjy6ofL6LTp6gJuXaC/2ABSJdAiIzTBWQ1wscKRDXjjqryIEtI49sjRhuMemF8+F/C84UWoittCgrlGQfF1KGiAJPHSi/26hB8W8dmLmbMEgA+CeZmdNcvwa33M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819334; 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=EGrT5PBlsifxCteUM4ks3i1iKfQkPZXmL1r8jYVvI4k=; b=AItxiXoIRe9XehTm3ZkH1Tie0jKrZFIVv6j143pqLHdfEb4RvBGoLrE6uhO/3KtXVNGi6UqppG+qhdw6NcFxbrGr+QMmonwBEDC9+EVASfFSQ6QxbSH5KZUw9fkH5lIJI7454mmnl9I/Aez5MIIJg769SmNQTsW68bbVkgh/w4M= 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 1625819334499118.82320912519378; Fri, 9 Jul 2021 01:28:54 -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-566-5Nrz96jnM8SwtkYbuGOEZQ-1; Fri, 09 Jul 2021 04:28:51 -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 04410804307; Fri, 9 Jul 2021 08:28:47 +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 DC8DF421F; Fri, 9 Jul 2021 08:28:46 +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 A72BA1809CB3; Fri, 9 Jul 2021 08:28:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698S4Nj005786 for ; Fri, 9 Jul 2021 04:28:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id AEF1A60861; Fri, 9 Jul 2021 08:28:04 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0947E60843; Fri, 9 Jul 2021 08:28:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819333; 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=EGrT5PBlsifxCteUM4ks3i1iKfQkPZXmL1r8jYVvI4k=; b=K9lDCR/XLXcSyMR5xaRI1lHJeUHDhnMlTaUEdo1P/O/aSGF6YZkXjf8MmNhL9c32Ultgod x0wZEAfE1dFeWNaw2mUOp/WrRe2EEK3PV+7LjMRh7NcT0Wpz1kussJK2Zf2c0ZKegEUSk2 qrkApzASbbzoJEyKtxVfET/vHF6Ff9g= X-MC-Unique: 5Nrz96jnM8SwtkYbuGOEZQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/10] iptablesPrivateChainCreate: `virHashNew` cannot return NULL Date: Fri, 9 Jul 2021 10:27:34 +0200 Message-Id: <20210709082739.29043-6-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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: 1625819336425100001 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 Sat Apr 27 22:52:23 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=1625819338; cv=none; d=zohomail.com; s=zohoarc; b=VFylqquBCx6JLJX+lHZzXlEBNvX0XTYCbVCzbblW9n3oU9iqjTpNle7afOCQU+V2Dn1bUD2NLxrbOWxnAyrCxO3uAGPhsnKi0eCSPl/J23tYHwzUspFVMl3qq1j6RcY+VJTCoZIycqGKC5A1XktodnQKTYcawwAQKkAaZmYT6es= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819338; 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=jQN66fu93OG80v6muCisTjGNcYPcB5n2qkz0Gmht85w=; b=dz/hjo4oBMht0KnqZssD69UyuPUlLDyb19tAW8dTdZqt0yJ1uMLHcgd/XcDdEUdl6Og4iIF2vMeF2xBQN+0iHH9XZPVZoR/YBX85tEYaqvJ+UInWjPrdncYKqevoOXQqIWWUMX5Nc7P4ww8LScK4bnKIOccUvnHhrAqnu0c4rr4= 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 1625819338747384.5228502201784; Fri, 9 Jul 2021 01:28:58 -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-27-GL6KkHe4M9iBpHye2eFkug-1; Fri, 09 Jul 2021 04:28:56 -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 03EB0801B0F; Fri, 9 Jul 2021 08:28:50 +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 DBA5F19CB4; Fri, 9 Jul 2021 08:28:49 +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 A73004EA3B; Fri, 9 Jul 2021 08:28:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698SALs005799 for ; Fri, 9 Jul 2021 04:28:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 12F1560861; Fri, 9 Jul 2021 08:28:10 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6200860843; Fri, 9 Jul 2021 08:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819337; 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=jQN66fu93OG80v6muCisTjGNcYPcB5n2qkz0Gmht85w=; b=IT5BCSo/ALbSFN7P/khCrtd9rcGa0DTpn55X2o3vpxPAVO8gXBKU6IxNxv5gjsu5p/XzHo En9Nz9s9BngOdai4DKbgGqp890dFiv6QvAlqb0/GY6WYAIPA1XwdBRGvCmZ9VDbkqT+nV3 maap1Kz9IP3AqkFvjBx4TJjjofjSxZs= X-MC-Unique: GL6KkHe4M9iBpHye2eFkug-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/10] iptablesPrivateChainCreate: Use automatic memory management Date: Fri, 9 Jul 2021 10:27:35 +0200 Message-Id: <20210709082739.29043-7-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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: 1625819340618100009 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 Sat Apr 27 22:52:23 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=1625819471; cv=none; d=zohomail.com; s=zohoarc; b=U6GhH7WAhCF9ZhO57TSahdq3Hr4x2k9leHaDV0EBqoLgmi3o9OWOs7A4Im92ypP+SWv/+gFAnVIv/O9QBOxFV9UUV43xQllMWtiRT6jPV6QN39UsALND65mzJkX9GrTOKwKGDNpB+Ye0z4YrwSH7TCzmkBiS8vw7zUSyqzy16c4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819471; 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=9BHVbR7RYKru1rZD9wcXbHd4wIy5lR3gGAUKDZVGKPk=; b=QyMBevoLB+J6qY+0hVrkIXb91vfDUcekxmE1ADlaiOw6bQ2mn2jbFBdgxdTIW1T7sP1nKqJ8Kv2EePEeLfofg8bhr/VnmIBP0st8V1s2U4tE65/qidACdAnd0/pRPVOKRxrZdc7PSlw67TYsoZm5+SDXowFoonNLnYbfFr2cG/M= 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 162581947128998.90810432190824; Fri, 9 Jul 2021 01:31:11 -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-134-vL5PyczMMzex6XCTYP78YQ-1; Fri, 09 Jul 2021 04:28:57 -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 9931619200D2; Fri, 9 Jul 2021 08:28:52 +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 81995369A; Fri, 9 Jul 2021 08:28:52 +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 4ED854EA41; Fri, 9 Jul 2021 08:28:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698SBur005804 for ; Fri, 9 Jul 2021 04:28:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4D45560861; Fri, 9 Jul 2021 08:28:11 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6429760843; Fri, 9 Jul 2021 08:28:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819470; 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=9BHVbR7RYKru1rZD9wcXbHd4wIy5lR3gGAUKDZVGKPk=; b=Nk8o2ZjUefeagxYUVm5/btJOoJMxFb19FlcSyXTzxnAfvjRl2IKo5qIUsneyXpDhn8gY3b 5g3QzgpGCAzAd1XwN+LAcv/Jng0oimah09xjBL+Nr1+cLyRslm7GCBOIM8s4tdqVHI0BhE GX/eK1VaX0jkFz0wXsA21uGWxDXfBGs= X-MC-Unique: vL5PyczMMzex6XCTYP78YQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/10] iptablesPrivateChainCreate: Remove superfluous `goto`s Date: Fri, 9 Jul 2021 10:27:36 +0200 Message-Id: <20210709082739.29043-8-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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: 1625819473253100001 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 Sat Apr 27 22:52:23 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=1625819337; cv=none; d=zohomail.com; s=zohoarc; b=J3l9Zr6FNL6afdxDaY4BybHxTCXLDUUXQ6Z8jSuaZRMSs/3B/iM5aPoMxfh2gOLW5WsAOrHZFM6OVOmQqSgG2CQ1bxLsl+Pv1/0Qa+3oooVekfk0e3pJx+9Dcm1uZMAK22P24FNUr0kmZasLbIzORVNjC6sXjNKc6OLrJxrOQhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819337; 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=4KcH+vMx/tU7hdapDDIQSG6QGbFzW3fN2cdjO53dGYY=; b=NQaGU1Pf0qsS0ggVBM3Q0tY4CMQEl2FTB5N3j8uqC7sMUN7ElXaRZDo2fKd6XX7QMbLlg8uorKBoDmQDRtsvV9ko1rywGVMrzQsQXadQOibQa5QevQF9ixNU9kgiYZgsrvZp/dmtTRL6SD60ZCycIzI529XGLmAG2YVaIKRbtZY= 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 1625819337816241.79610951531754; Fri, 9 Jul 2021 01:28:57 -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-3-qdXB2gjyMZedb0TPB_qwUw-1; Fri, 09 Jul 2021 04:28:55 -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 14B3119200D0; Fri, 9 Jul 2021 08:28:50 +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 E712960CCC; Fri, 9 Jul 2021 08:28:49 +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 A641E18005A2; Fri, 9 Jul 2021 08:28:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698SDVY005810 for ; Fri, 9 Jul 2021 04:28:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id DC82860854; Fri, 9 Jul 2021 08:28:13 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D60660843; Fri, 9 Jul 2021 08:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819336; 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=4KcH+vMx/tU7hdapDDIQSG6QGbFzW3fN2cdjO53dGYY=; b=U+CHURF+iogSpAYL3RRvXILvCyWq+Lw5tCLDA7z38K7gRP91lmx7p222eCPxIWo8qCHh6Y brhp3IY11hKTI6LHMITIUyyaY9CpYNvCZDQBhP02AYUZflXAFp3D/bxVq393vhPEyud557 9BFAxY01IaeUaIhlQYyjP4BA/qnNV/U= X-MC-Unique: qdXB2gjyMZedb0TPB_qwUw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/10] qemuMonitorGetMemoryDeviceInfo: Assign hash table only on success Date: Fri, 9 Jul 2021 10:27:37 +0200 Message-Id: <20210709082739.29043-9-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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: 1625819338532100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8f35b4240f..8646efe9c4 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4238,6 +4238,7 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { + GHashTable *hash; int ret; =20 VIR_DEBUG("info=3D%p", info); @@ -4246,14 +4247,14 @@ 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)) < 0) { + virHashFree(hash); } =20 + *info =3D hash; return ret; } =20 --=20 2.31.1 From nobody Sat Apr 27 22:52:23 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=1625819468; cv=none; d=zohomail.com; s=zohoarc; b=M7Xxs938+NDch5R9P7MsOJSQl1WuRrb6s09asmlKUF1MYBpuUG+qL0/Tk1IF1cmoGBSgNZEnOJtsCIGIR3hWWtEDE3AFf2t4685k46MK2teQ56qfeY/vsgPM+QGn2UXDniHde41twgjmt2Ab32sBJOZbwTpEpCpEkbdHGSa5z2I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819468; 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=N5B9uWVNMHQ1VI8kUrg4UV1Dz0o7up4iTebjQHrPYvM=; b=chdBfV7HTu7az4E2hyaJmEEj46PliGf6HYznfTblce+bVle2uF3CYegQXrJ9Q5OEaazg4G6Pb2YqaepgZB+dK0A2tSaZQoESXAKDIjjh7L91BpNwedVr2aUjd0rfi6ro/Zsjq7ttJXMjfJQiTdoroOOxDrpGnQ7J3EWX46BBodo= 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 1625819468346466.31331655026406; Fri, 9 Jul 2021 01:31:08 -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-582-7EPKyi74NUyCy4AQlBPAFA-1; Fri, 09 Jul 2021 04:28:57 -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 ADE75100CA94; Fri, 9 Jul 2021 08:28:52 +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 8F7EF60C13; Fri, 9 Jul 2021 08:28:52 +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 5C8654EA40; Fri, 9 Jul 2021 08:28:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698SE2p005815 for ; Fri, 9 Jul 2021 04:28:14 -0400 Received: by smtp.corp.redhat.com (Postfix) id DF51A60854; Fri, 9 Jul 2021 08:28:14 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 39A5660843; Fri, 9 Jul 2021 08:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819467; 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=N5B9uWVNMHQ1VI8kUrg4UV1Dz0o7up4iTebjQHrPYvM=; b=NTVNrc4zndwHrnFcvkzYDYM5tiYPCKQI+s7HlFFEhcwTdw1JY9McDMDXpiTIsUrvC4KdnE OiAbHbp73oLaZu7RXAW77GG/ZSutuRnDbtKVKI+1UgKbUZk9/Ksg9Y/jHo+LcmOmcqDIM4 7NA90xNnBrZZaaX7y4jXuK6cV3UCJHw= X-MC-Unique: 7EPKyi74NUyCy4AQlBPAFA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/10] qemuMonitorGetMemoryDeviceInfo: Use automatic memory management Date: Fri, 9 Jul 2021 10:27:38 +0200 Message-Id: <20210709082739.29043-10-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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: 1625819469019100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/qemu/qemu_monitor.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8646efe9c4..3a56ed8ef9 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4238,7 +4238,7 @@ int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { - GHashTable *hash; + g_autoptr(GHashTable) hash =3D NULL; int ret; =20 VIR_DEBUG("info=3D%p", info); @@ -4250,11 +4250,10 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, if (!(hash =3D virHashNew(g_free))) return -1; =20 - if ((ret =3D qemuMonitorJSONGetMemoryDeviceInfo(mon, hash)) < 0) { - virHashFree(hash); + if ((ret =3D qemuMonitorJSONGetMemoryDeviceInfo(mon, hash)) >=3D 0) { + *info =3D g_steal_pointer(&hash); } =20 - *info =3D hash; return ret; } =20 --=20 2.31.1 From nobody Sat Apr 27 22:52:23 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=1625819343; cv=none; d=zohomail.com; s=zohoarc; b=f7UBFnr2qahMT1JWKkYhSY3293VBR33QKkgZqQqNN9/1nm2zrGj8bnp6Zq/WEpTnmk5areM78IJZaXhcfTB0PqTv2QZwYL5TH9y+UbQZ6nv6tYrVtYCQjAcA0FePjqEnSAhfHTAIMqsNXB+jdLH5/cDKR1peQMgqXFgH5dxWVQQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625819343; 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=aRdgXMtqTYDJXcKLQIVQ4Ezl/LLG8jScaxXTsD0Ex6Q=; b=j3T9mMm2mZ3tJYMIIUfT0APlZOx0el6Ej0hw+CuOTcO6YAa9Z6miKxsHV167kLdF1CXYhGY+9tD3H8tQR4Bw4RgdeQqXlxIElHZPdp0hpEeqsSsnadHtj1F6FnO3Y9kvLhC98+NUvX00PEbTwgdcxc9IT9UUB1fbUX8eZnFByNU= 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 162581934349892.74056006673868; Fri, 9 Jul 2021 01:29:03 -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-323-CVstp-42PuiXKCxN0KaADw-1; Fri, 09 Jul 2021 04:29:00 -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 5405C5075B; Fri, 9 Jul 2021 08:28:55 +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 3902E369A; Fri, 9 Jul 2021 08:28:55 +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 0701C1801257; Fri, 9 Jul 2021 08:28:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1698SGVs005821 for ; Fri, 9 Jul 2021 04:28:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C6A760861; Fri, 9 Jul 2021 08:28:16 +0000 (UTC) Received: from work.redhat.com (ovpn-113-189.ams2.redhat.com [10.36.113.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BA4160843; Fri, 9 Jul 2021 08:28:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625819342; 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=aRdgXMtqTYDJXcKLQIVQ4Ezl/LLG8jScaxXTsD0Ex6Q=; b=O56/1p33AqLi6H1N0tkexk61OWxK6D3kLGRCvStOsf1cY0h/ZNZn3eyQ01fNAU1ti4CFWl 6lx/7gf5ExdT+CWyM1qADQuKugNspSG+rkl4+YYHDoATJL7QSEEz1eAexMKaXL4wb2VGTn Fazt0MAho9XKxQhCl49dj3DSHEuOFm8= X-MC-Unique: CVstp-42PuiXKCxN0KaADw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/10] qemuMonitorGetMemoryDeviceInfo: `virHashNew` cannot return NULL Date: Fri, 9 Jul 2021 10:27:39 +0200 Message-Id: <20210709082739.29043-11-twiederh@redhat.com> In-Reply-To: <20210709082739.29043-1-twiederh@redhat.com> References: <20210709082739.29043-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.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: 1625819345030100001 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 3a56ed8ef9..4506f962d1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4238,7 +4238,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); @@ -4247,9 +4247,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 2.31.1