From nobody Wed May 8 09:28:55 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=1626255928; cv=none; d=zohomail.com; s=zohoarc; b=nVGIuGCSBG9S6nNmTNhW2hc+FoafvA0XXKOFkti2Vn7yFyyQ41MSxiEd5KZLLGuG9+jCE20ZxS8DbmWxEdRnw2lShtE05w6uPcxH2Zh9uJ0uA5E68o17OSSyjRctQjr5VCf8EI1XcAhpJbGIjkURah74rSO+B5yapZ4R48V/au8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255928; 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=uSLcYzXeDEsagmoHfxbCtFf/VqHBZcF+jHJU3wknqLc=; b=kAuUGwAQu3B13jjxC8Y5YBqIUFWb3bbz5o67pjbEStcKWpB4gEeDSNP+O1B31XjajXr/DNHuCofBxTK+OlbEyTduHer8j1/a2kB4ts3Vt7eyqCish+d5Wipwt2Zfosch10I9QY8iht1OVHsesAlglbRWXc78x4we0Agau0dkCRI= 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 1626255928691825.186736505636; Wed, 14 Jul 2021 02:45:28 -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-342-9uOh7BohNtC1oMC0dR_Xhg-1; Wed, 14 Jul 2021 05:45:25 -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 14FDC9F92C; Wed, 14 Jul 2021 09:45:20 +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 BB9291AC78; Wed, 14 Jul 2021 09:45:19 +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 F22804A712; Wed, 14 Jul 2021 09:45:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9jGKe001706 for ; Wed, 14 Jul 2021 05:45:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 67E485D719; Wed, 14 Jul 2021 09:45:16 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id B288A6268D; Wed, 14 Jul 2021 09:45:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255926; 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=uSLcYzXeDEsagmoHfxbCtFf/VqHBZcF+jHJU3wknqLc=; b=AXzv6ybLkXvHkHc4uPQjkSxNEEyD0hu9nrC55hLnXrAGlUOrjevwpfEfbN3qRDDKwLcfW8 eHqdFqbcvJ/fmjIJZHNZx1CsSUz6J3JOO/icOB5F4efoQwFQ7NEI2OC/UfqV4WRU3cIpPw ULe8r/NOy/osqO6HLeA2D1eGLHncAmo= X-MC-Unique: 9uOh7BohNtC1oMC0dR_Xhg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 01/10] conf: Add AUTOPTR_CLEANUP_FUNC for virNWFilterVarValue Date: Wed, 14 Jul 2021 11:44:48 +0200 Message-Id: <20210714094457.61612-2-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626255930046100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_params.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/conf/nwfilter_params.h b/src/conf/nwfilter_params.h index d11b533958..f9f7f68ff3 100644 --- a/src/conf/nwfilter_params.h +++ b/src/conf/nwfilter_params.h @@ -51,6 +51,8 @@ virNWFilterVarValue *virNWFilterVarValueCreateSimple(char= *); virNWFilterVarValue *virNWFilterVarValueCreateSimpleCopyValue(const char *= ); virNWFilterVarValue *virNWFilterVarValueCopy(const virNWFilterVarValue *); void virNWFilterVarValueFree(virNWFilterVarValue *val); +G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNWFilterVarValue, virNWFilterVarValueFree= ); + void virNWFilterVarValueHashFree(void *payload); const char *virNWFilterVarValueGetSimple(const virNWFilterVarValue *val); const char *virNWFilterVarValueGetNthValue(const virNWFilterVarValue *val, --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255928; cv=none; d=zohomail.com; s=zohoarc; b=QD42S+FQcWL13hgPv6jFe/HYuEqdUNacgJcNAEaCAPrTLO9oRGozLipKMp0lC2O9VXATIAq5BDlDTZxRSTB8U+EOVk9BBKucCVU82MEfl7BjDmbiN9K1qix1kjGFPEo3dLOfk+WvCAv/8fr4A8VJS3J8QzDVOWIak01Y5Wgb5us= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255928; 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=uJkkxn5X9WaJh8CDVYH2ABJvY8pzw0sh+wMBrE2zpIo=; b=P7EuolUbyQIDwY7WHjJJNxDuNZFeWXc1RFLzflDj5avGCK6cr3Eu4TbttfdMb4roqFw/xFv542vAJG5/VWAlS3OjTK8hoW9B89EtfiGdDFVCKQXHdNIXWDqq2zSSeoHdoq2D9RSabE24+dK+7a/staeiv6CGcqw+TNpDLF14zLE= 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 1626255928602132.81817719413425; Wed, 14 Jul 2021 02:45:28 -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-529-fbzYZ9JnOru3-LIB_xhU5g-1; Wed, 14 Jul 2021 05:45:25 -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 127CF804300; Wed, 14 Jul 2021 09:45:20 +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 DB3F15C232; Wed, 14 Jul 2021 09:45:19 +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 D0C554E9F5; Wed, 14 Jul 2021 09:45:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9jHul001711 for ; Wed, 14 Jul 2021 05:45:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6F4465D719; Wed, 14 Jul 2021 09:45:17 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA0A45D741; Wed, 14 Jul 2021 09:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255927; 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=uJkkxn5X9WaJh8CDVYH2ABJvY8pzw0sh+wMBrE2zpIo=; b=PQuKNOLWTkwW6m2xToynXb9kP5IxzISp+joHgKRzWtdfSLFeaIreG404qsyv5I+9zcKWiu WPjRwdtmno2NrsWKieRcDoUYthodnuyv9mdL+AXBIuCLIfEsm8rqZADIIfHEXIEVavXHb8 0SzQFi5Tx+ytl3By11l9Rrbke7Dqey8= X-MC-Unique: fbzYZ9JnOru3-LIB_xhU5g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 02/10] virNWFilterParseParamAttributes: `virHashNew` cannot return NULL Date: Wed, 14 Jul 2021 11:44:49 +0200 Message-Id: <20210714094457.61612-3-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.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: 1626255930164100004 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_params.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index aeed0cff1f..c94e9679f8 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -702,8 +702,6 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) virNWFilterVarValue *value; =20 GHashTable *table =3D virHashNew(virNWFilterVarValueHashFree); - if (!table) - return NULL; =20 cur =3D cur->children; =20 --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255944; cv=none; d=zohomail.com; s=zohoarc; b=iEE/iS/qKQZDfjl7Ydyz85cJxkcQFVTWKbqLoJYL5ZAUGVJ8fEdfuA2zxSYmt7Yg3fHUIHyKSEXgXCUwi6RX9VLy4o8M6zrLfLAHYQNVvyH8/3dV7b/VhZ96Pt5nuFmkXAhb2CjK6CPnvn2F+uAiP2JVhNzttKnej8koI0KTSsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255944; 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=QH7qlvpM/d5Fsb2uCulKXwQkKE3sQvsx3A7iWZGcqe0=; b=DUVoyLSiT863+17OKI7X1sZ373MQZKbOr2B9vPFCzby1g8AWFMHKz6HMFW8b7MW6bBSYz1+DMWasKnoF6ha+2+Pj5INeEWhcfUXiXMABhlrYhC3Y7ToW+7zwcNebseBL2INQRvNwRYNsA2y25KtbE6TOEgBXhjTFLTzv+/OXAPE= 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 1626255944655545.734995644144; Wed, 14 Jul 2021 02:45:44 -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-171-GfZd8sXiMCC1DP4ErHMl6w-1; Wed, 14 Jul 2021 05:45:42 -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 AF7AB19057A4; Wed, 14 Jul 2021 09:45:36 +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 8A4AF1001281; Wed, 14 Jul 2021 09:45: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 3E67B4EA39; Wed, 14 Jul 2021 09:45:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9jIl7001721 for ; Wed, 14 Jul 2021 05:45:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 78E8D5D741; Wed, 14 Jul 2021 09:45:18 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1A985D719; Wed, 14 Jul 2021 09:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255943; 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=QH7qlvpM/d5Fsb2uCulKXwQkKE3sQvsx3A7iWZGcqe0=; b=Lo+Fq4NtEQINz4Qk00eED6CytUbypWvAyZSDs5xpgdmxNgNhNz23x8R4hCmDPwWvmT/KQR UswJp0TpVYppv+mca1dXheA80ordq3JJqr3b/3fSXsxKE9/MkcpNYQGsu1CGI/YIv4c9Md EObTCPt+Lh9Uj7oUeirmhN+9Z/0JMFU= X-MC-Unique: GfZd8sXiMCC1DP4ErHMl6w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 03/10] virNWFilterParseParamAttributes: Iterate over "element" children Date: Wed, 14 Jul 2021 11:44:50 +0200 Message-Id: <20210714094457.61612-4-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626255945689100001 Content-Type: text/plain; charset="utf-8" "xmlNextElementSibling()" skips attribute nodes, making the explicit check for the type of `cur` redundant. This prepares for the removal of this check in the next commit. Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index c94e9679f8..3754cec55f 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -703,7 +703,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) =20 GHashTable *table =3D virHashNew(virNWFilterVarValueHashFree); =20 - cur =3D cur->children; + cur =3D xmlFirstElementChild(cur); =20 while (cur !=3D NULL) { if (cur->type =3D=3D XML_ELEMENT_NODE) { @@ -739,7 +739,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) VIR_FREE(val); } } - cur =3D cur->next; + cur =3D xmlNextElementSibling(cur); } return table; =20 --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255947; cv=none; d=zohomail.com; s=zohoarc; b=O310t/3DulgnrS4CbgrqQv0dUX8RGiamOvGXMFz7oYME8msXVr+ALbK3n4fSX5Fmj3CA+rYYJvaqfCvKFz95QS0SicAlPp+SVE1yyh2Abs0u8WSxe5UF7srw37w/NFvvxVaLvKIiU8mY9cdn3wujJ1wv80VLUtsLeFQtjtjzbio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255947; 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=daBZkybaQjGD9uhql+rI1rGaJysaNT2bFcLdFDqOj6c=; b=ZXibOO60eWf5lt7xpnQDvjo8UdaXBBppuN7ILwZyo7UIEpxS3tAFvUFGSFgfc8+THXfYt1B6jjBzRqcWPfW+U+VN37A3LFV6DrHyL7rx9/Mt2wMW7efkn57wm5lgllM6pqW4nspAklE9I/FuH7eEa+vK8B06R3ReeDxmzjKa0Zo= 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 1626255947526942.1733093230995; Wed, 14 Jul 2021 02:45: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-68-Q-i1vz49N7GIItKQNI81hw-1; Wed, 14 Jul 2021 05:45:45 -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 9DB49100C631; Wed, 14 Jul 2021 09:45: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 7638C1001281; Wed, 14 Jul 2021 09:45: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 0DEA14EA3E; Wed, 14 Jul 2021 09:45:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9jNuu001746 for ; Wed, 14 Jul 2021 05:45:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id A01976267C; Wed, 14 Jul 2021 09:45:23 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id CB2435D719; Wed, 14 Jul 2021 09:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255946; 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=daBZkybaQjGD9uhql+rI1rGaJysaNT2bFcLdFDqOj6c=; b=QmYl6ltP/UX0y2YHmJoPD7RciUE1+QmediCn15sOluVDfHExO+J/QfXXNZkz3NrG5TlBZw 22DIXaNMYT1uEdbg+QQywg2FUIxvBWA2OWMRk7panWE4E2+ssijl4R5FRQO+AE0O+/amT8 SAeS50rw0iB2SMfFxUDIAtbayXz988M= X-MC-Unique: Q-i1vz49N7GIItKQNI81hw-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/10] virNWFilterParseParamAttributes: Remove tautological `if` Date: Wed, 14 Jul 2021 11:44:51 +0200 Message-Id: <20210714094457.61612-5-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626255947918100001 Content-Type: text/plain; charset="utf-8" `cur` is guaranteed to be of type `XML_ELEMENT_NODE` by using `xmlFirstElementChild()` and `xmlNextElementSibling()`. Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_params.c | 57 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 3754cec55f..0b967e1194 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -706,39 +706,38 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) cur =3D xmlFirstElementChild(cur); =20 while (cur !=3D NULL) { - if (cur->type =3D=3D XML_ELEMENT_NODE) { - if (virXMLNodeNameEqual(cur, "parameter")) { - nam =3D virXMLPropString(cur, "name"); - val =3D virXMLPropString(cur, "value"); - value =3D NULL; - if (nam !=3D NULL && val !=3D NULL) { - if (!isValidVarName(nam)) - goto skip_entry; - if (!isValidVarValue(val)) - goto skip_entry; - value =3D virHashLookup(table, nam); - if (value) { - /* add value to existing value -> list */ - if (virNWFilterVarValueAddValue(value, val) < 0) { - value =3D NULL; - goto err_exit; - } - val =3D NULL; - } else { - value =3D virNWFilterParseVarValue(val); - if (!value) - goto skip_entry; - if (virHashUpdateEntry(table, nam, value) < 0) - goto err_exit; + if (virXMLNodeNameEqual(cur, "parameter")) { + nam =3D virXMLPropString(cur, "name"); + val =3D virXMLPropString(cur, "value"); + value =3D NULL; + if (nam !=3D NULL && val !=3D NULL) { + if (!isValidVarName(nam)) + goto skip_entry; + if (!isValidVarValue(val)) + goto skip_entry; + value =3D virHashLookup(table, nam); + if (value) { + /* add value to existing value -> list */ + if (virNWFilterVarValueAddValue(value, val) < 0) { + value =3D NULL; + goto err_exit; } - value =3D NULL; + val =3D NULL; + } else { + value =3D virNWFilterParseVarValue(val); + if (!value) + goto skip_entry; + if (virHashUpdateEntry(table, nam, value) < 0) + goto err_exit; } - skip_entry: - virNWFilterVarValueFree(value); - VIR_FREE(nam); - VIR_FREE(val); + value =3D NULL; } + skip_entry: + virNWFilterVarValueFree(value); + VIR_FREE(nam); + VIR_FREE(val); } + cur =3D xmlNextElementSibling(cur); } return table; --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255966; cv=none; d=zohomail.com; s=zohoarc; b=Pxe41zcmNslTPXZJzvBnfZHVBhF8hsVt9jU9Krvc32eB+TmLtLZ1pX8t537JhG01CLr45ol3GOSQ7zsPgpkxPIQrs/NKkWFIag+7awOiJnPXNJSneGU0V3UWdpFjs7os9GOFWRDSszO1zcq9UCbc4TxAU7RIuTDWbru1ZU9LcjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255966; 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=nlbFeoc5uu55yCvlYVS8fm/LRph3jKYTyYNayFuhws0=; b=A0JxzH3Tnsyypm+PyadN34AB11RRAJnzPRO7CwtRBYMtJOxjS68PESzb2ULsNdDKDluZe/RFygKkd33xg4mGDGXH9SQKnJqVjNAcm+L52ABPApWY7JhbxIl18W6WwjoLERJ/tr2GaPy5kGwSOa/eYtnPo8RbiCr9atHQWXI1w6w= 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 1626255966102616.810052458742; Wed, 14 Jul 2021 02:46:06 -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-440-cR0lQKLJOwu61g11t6184Q-1; Wed, 14 Jul 2021 05:45:50 -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 5B35D100CEC9; Wed, 14 Jul 2021 09:45:45 +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 2CCB55D6D1; Wed, 14 Jul 2021 09:45:45 +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 DE7341809CAC; Wed, 14 Jul 2021 09:45:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9jhSD001855 for ; Wed, 14 Jul 2021 05:45:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 749B85D719; Wed, 14 Jul 2021 09:45:43 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B3231ABDF; Wed, 14 Jul 2021 09:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255965; 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=nlbFeoc5uu55yCvlYVS8fm/LRph3jKYTyYNayFuhws0=; b=L26B/gX4Ln/Wa9FBQ8ka4fUaZOVkaTplQSZJfRNrmsQN6yfbbDx7g/4JiJWp0/IISLRKUX jG987bX/RwnNALwwPDrenu8f/Fo4ub6UJpza1Voy7UTpBkRNVklD7dUQ+AaVTOcL+vKsjn N7hYVWrPpbSJL1X2ebjrChXB+YS3lzY= X-MC-Unique: cR0lQKLJOwu61g11t6184Q-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/10] virNWFilterParseParamAttributes: Use automatic memory management Date: Wed, 14 Jul 2021 11:44:52 +0200 Message-Id: <20210714094457.61612-6-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626255967593100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_params.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 0b967e1194..0b1676e25f 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -698,18 +698,15 @@ virNWFilterParseVarValue(const char *val) GHashTable * virNWFilterParseParamAttributes(xmlNodePtr cur) { - char *nam, *val; - virNWFilterVarValue *value; - - GHashTable *table =3D virHashNew(virNWFilterVarValueHashFree); + g_autoptr(GHashTable) table =3D virHashNew(virNWFilterVarValueHashFree= ); =20 cur =3D xmlFirstElementChild(cur); =20 while (cur !=3D NULL) { if (virXMLNodeNameEqual(cur, "parameter")) { - nam =3D virXMLPropString(cur, "name"); - val =3D virXMLPropString(cur, "value"); - value =3D NULL; + g_autofree char *nam =3D virXMLPropString(cur, "name"); + g_autofree char *val =3D virXMLPropString(cur, "value"); + g_autoptr(virNWFilterVarValue) value =3D NULL; if (nam !=3D NULL && val !=3D NULL) { if (!isValidVarName(nam)) goto skip_entry; @@ -733,20 +730,13 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) value =3D NULL; } skip_entry: - virNWFilterVarValueFree(value); - VIR_FREE(nam); - VIR_FREE(val); } - cur =3D xmlNextElementSibling(cur); } - return table; + + return g_steal_pointer(&table); =20 err_exit: - VIR_FREE(nam); - VIR_FREE(val); - virNWFilterVarValueFree(value); - virHashFree(table); return NULL; } =20 --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255960; cv=none; d=zohomail.com; s=zohoarc; b=GnOyRHe3zuttOXBWFHefk75nVSo7NtCTKogpRPcxJ79hRgn1I1FJud//oZs08PU3ozhEzfjv2URlaMtbIp0eQ16ow8Wf07cX3wdvGvUrtrzFlClfM0NqX5SDA55/ofBK6XW+4KEcqqgXFJujWBNDg0Ur3vGeoSvXKPm+tf5mMf0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255960; 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=sDsvizHyquOftNgjPHx3sEkHKz7UgyenMEpWepW8Bao=; b=P9bAnRWjL5sN2c8IucngGCvLQQ4iUtm78m/8eF2NP9KmUgGLrEJ2q8lUzKaDTkVs2Ft+kYgJnmfpMOtbVULGN36EI5WeaLvWMN9HmYx0hfpgRZbe8xdLn3JhuFHPRAYEviMDe4eVuwgnn6skWBpYpYDu8fugyjUSOTOfk85iPdo= 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 1626255960798427.0584950334645; Wed, 14 Jul 2021 02:46:00 -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-247-GLj363gzM_iyjbi3qk_7ew-1; Wed, 14 Jul 2021 05:45:58 -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 DBDB119067E0; Wed, 14 Jul 2021 09:45: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 BBB1660C05; Wed, 14 Jul 2021 09:45: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 88F6C4EA3F; Wed, 14 Jul 2021 09:45:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9joXU001877 for ; Wed, 14 Jul 2021 05:45:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id D0FBF18432; Wed, 14 Jul 2021 09:45:50 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9D5225D6D1; Wed, 14 Jul 2021 09:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255959; 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=sDsvizHyquOftNgjPHx3sEkHKz7UgyenMEpWepW8Bao=; b=Pu0jJ9K8Bv/RFXm1MWV4Bo7y9nXzdC2y43IzdAwVv6+JrRuCoHAICniV+tZJ/zYBziXgcj 98T3WwxaYKCXeCGOnjlPfHhySkvRLo2CCOFahzQC7Snba+PpPTLrcgrOGTWr6t5gudVSAj e7FruSvRQf4Jqc9MgrmSNO8ZTlJ5raw= X-MC-Unique: GLj363gzM_iyjbi3qk_7ew-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 06/10] virNWFilterParseParamAttributes: Simplify loop body Date: Wed, 14 Jul 2021 11:44:53 +0200 Message-Id: <20210714094457.61612-7-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626255963037100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_params.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 0b1676e25f..63ab7e7150 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -707,28 +707,22 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) g_autofree char *nam =3D virXMLPropString(cur, "name"); g_autofree char *val =3D virXMLPropString(cur, "value"); g_autoptr(virNWFilterVarValue) value =3D NULL; - if (nam !=3D NULL && val !=3D NULL) { - if (!isValidVarName(nam)) - goto skip_entry; - if (!isValidVarValue(val)) - goto skip_entry; - value =3D virHashLookup(table, nam); - if (value) { - /* add value to existing value -> list */ - if (virNWFilterVarValueAddValue(value, val) < 0) { - value =3D NULL; - goto err_exit; - } - val =3D NULL; - } else { - value =3D virNWFilterParseVarValue(val); - if (!value) - goto skip_entry; - if (virHashUpdateEntry(table, nam, value) < 0) - goto err_exit; - } - value =3D NULL; + + if (nam =3D=3D NULL || !isValidVarName(nam) || + val =3D=3D NULL || !isValidVarValue(val)) { + goto skip_entry; + } + + if ((value =3D virHashLookup(table, nam))) { + /* add value to existing value -> list */ + if (virNWFilterVarValueAddValue(g_steal_pointer(&value), v= al) < 0) + goto err_exit; + val =3D NULL; + } else if ((value =3D virNWFilterParseVarValue(val))) { + if (virHashUpdateEntry(table, nam, value) < 0) + goto err_exit; } + value =3D NULL; skip_entry: } cur =3D xmlNextElementSibling(cur); --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255971; cv=none; d=zohomail.com; s=zohoarc; b=fwkvXqsfLXqfhKoLfmMzKAuakPJcp5fdd31ogAXQtIYQ5+BOoS6cdAgPodxEwtMurC+0p0WhPRYNmqGIOal6UEnXlEqoLuGdgamMm+BCDGoC3SMmXNdQ34NPSBrSKTd8mxQoKhiiPfRp8pZ3xJuRkY25K+GEQWGZeJxNE67eGj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255971; 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=CqGW7DjGUA3pzyX7PaKEn4VA+qntPTnHNc8/rjlOT8M=; b=WsJQH6dx/rasewsPM9fyNl0VE9LHfKwlHyTHBVZfwodtFLLgAeVE9CVVrG6oOHHjV30ttrt8lyXDG3z5MqH2MToEKty0Bpzsxivfc4BCfZhJPYeeUUaNohW4uHC0i7cSuIyGU44n4C2+sasRTVR8kYilyvoCuWLoQw7wQrCQrs0= 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 1626255971546418.69536752713987; Wed, 14 Jul 2021 02:46: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-417-mK6lIrRDOtu3ouassBeujA-1; Wed, 14 Jul 2021 05:46:08 -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 576E68030D7; Wed, 14 Jul 2021 09:46:03 +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 2EBFA26FA2; Wed, 14 Jul 2021 09:46:03 +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 EF8A31809CB3; Wed, 14 Jul 2021 09:46:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9k1ZT001926 for ; Wed, 14 Jul 2021 05:46:02 -0400 Received: by smtp.corp.redhat.com (Postfix) id F0F1718432; Wed, 14 Jul 2021 09:46:01 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EFCE5D6D1; Wed, 14 Jul 2021 09:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255970; 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=CqGW7DjGUA3pzyX7PaKEn4VA+qntPTnHNc8/rjlOT8M=; b=i9RtE7ed1DDI4HlLiEW4L01CxCnLN87pAugYQ7HQzdubCkvRi0jXu6SV3buGN2c1UGarPe S57PH+kHZJDcVceFKEGVeb20ZeUjOCvg+EqRho6qQlooCdMCGe7OYCrPfnj7lJyhD0kgTq Eo2pSieatls6EiwIaGhlXEoIqDmnkGQ= X-MC-Unique: mK6lIrRDOtu3ouassBeujA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 07/10] virNWFilterParseParamAttributes: Remove superfluous `goto`s Date: Wed, 14 Jul 2021 11:44:54 +0200 Message-Id: <20210714094457.61612-8-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.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: 1626255972070100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_params.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 63ab7e7150..35ea0256c3 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -710,28 +710,25 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) =20 if (nam =3D=3D NULL || !isValidVarName(nam) || val =3D=3D NULL || !isValidVarValue(val)) { - goto skip_entry; + cur =3D xmlNextElementSibling(cur); + continue; } =20 if ((value =3D virHashLookup(table, nam))) { /* add value to existing value -> list */ if (virNWFilterVarValueAddValue(g_steal_pointer(&value), v= al) < 0) - goto err_exit; + return NULL; val =3D NULL; } else if ((value =3D virNWFilterParseVarValue(val))) { if (virHashUpdateEntry(table, nam, value) < 0) - goto err_exit; + return NULL; } value =3D NULL; - skip_entry: } cur =3D xmlNextElementSibling(cur); } =20 return g_steal_pointer(&table); - - err_exit: - return NULL; } =20 =20 --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255974; cv=none; d=zohomail.com; s=zohoarc; b=JCK08mSmrTPnWIZtZYwLJ5GfG7+r7CJU5Tiefef7OXxGm7j2e8x18err2oRqo6X7DTyOXaJCnvlE/Be2ooRajDCjZ52i/BRh9nDhBinkMuOe+QIefxFO9/KxYVdzdiaDO/AzACWC3SBCRP+TccH3I0FQC4SNS9SOAxfT9NS2+pY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255974; 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=eudBPY+/cMtCBGjJkF605EUFEzAYuHsV9KnWW7lc0x4=; b=D1rcV2pcom05qoWQgNu5iy3IlWRr12ZZeJUsKNhzCE7weegOW6rt73asthuTyPZgzakOryvuXthiM5ShFkV5Urm4qXEcgz1Syh0EzuoI0KUhjfs/u3on+6rRRBY7cs4szBKKF5M2s+/D5Kzx52JFtZ3G4gTKNBRtc9Fkb2U6G5E= 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 1626255974495611.2818088663896; Wed, 14 Jul 2021 02:46:14 -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-438-ZH7PRMvLMJy8LNyDYJPS-w-1; Wed, 14 Jul 2021 05:46:12 -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 39AA3A40D6; Wed, 14 Jul 2021 09:46:07 +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 1E18660871; Wed, 14 Jul 2021 09:46:07 +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 DFB214EA42; Wed, 14 Jul 2021 09:46:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9k6sk001943 for ; Wed, 14 Jul 2021 05:46:06 -0400 Received: by smtp.corp.redhat.com (Postfix) id 01BD25D705; Wed, 14 Jul 2021 09:46:06 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4946C5D6D1; Wed, 14 Jul 2021 09:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255973; 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=eudBPY+/cMtCBGjJkF605EUFEzAYuHsV9KnWW7lc0x4=; b=MMpDfoIIuhiG1lx/mYwg4vrVg76CHFwsKwsfSsTYnALy6I40ELg2pLrGf1WJzpEhdo12Fx PoyyuoublhYbT4ptZTL8eSNu11Ft+G2sAGpCQoG0YbZMEQG4G/VD9B9ab+dxFVroS8a+2h boJGh63gUPjt5nfYBdwrSIKwYyb9GUA= X-MC-Unique: ZH7PRMvLMJy8LNyDYJPS-w-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 08/10] virNWFilterDoInstantiate: `virHashNew` cannot return NULL Date: Wed, 14 Jul 2021 11:44:55 +0200 Message-Id: <20210714094457.61612-9-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626255976395100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/nwfilter/nwfilter_gentech_driver.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter= _gentech_driver.c index 8aa1db23d3..114c1cef4f 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -519,11 +519,6 @@ virNWFilterDoInstantiate(virNWFilterTechDriver *techdr= iver, =20 memset(&inst, 0, sizeof(inst)); =20 - if (!missing_vars) { - rc =3D -1; - goto error; - } - rc =3D virNWFilterDetermineMissingVarsRec(filter, binding->filterparams, missing_vars, --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626255976; cv=none; d=zohomail.com; s=zohoarc; b=WFQFlGgdPu7ix3UZoCIJs3x3/4WnZYAUpqKoKOE9ARckz6nL7CdPWgae1ST2Ya5+U52rl1waZwKHoan7dlxtS+qq3GGChZNdGyxAQvPeEIQGnDEvGcPS4hdhulSOHSw/7CHybBMe86x2iZmF2qFX6CKXsftMH9ajMhqlcBnGFJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626255976; 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=M6youd/v5E321hQXt0SV2fN9R2ROHgJYF/CTD5ihTBE=; b=l/H1Xf2oDkH+R/Hr7DUmUi55lf3+YtU28pw9RaiZuHot38lveSbAla3bVj8TuxgFLHUXjVkS8Dbe4ZV/e733tpIL1eL8zxukXAJMxjmjY+Js8PYbMUC6LkCbEtP8tmKV9okO5VSr701qlHsb9p4AV7XpnE3cDv/o3yIFJZIgDuE= 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 162625597666316.85193348869916; Wed, 14 Jul 2021 02:46:16 -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-450-t81SRpF0NYaBwR66N12fXg-1; Wed, 14 Jul 2021 05:46:14 -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 F06EDA40C1; Wed, 14 Jul 2021 09:46:08 +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 C8BC15D6D1; Wed, 14 Jul 2021 09:46:08 +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 8BE661809CAC; Wed, 14 Jul 2021 09:46:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9k7Xu001957 for ; Wed, 14 Jul 2021 05:46:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0E64B5D741; Wed, 14 Jul 2021 09:46:07 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 536E35D6D1; Wed, 14 Jul 2021 09:46:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626255975; 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=M6youd/v5E321hQXt0SV2fN9R2ROHgJYF/CTD5ihTBE=; b=KkquopDR0NrhT6MofmZxugi9pyXL96KtsUkTSrLdQ32TlfBWNangsSHSm8gta5j6AqU7fQ JcgaBAN4pf44JSm7qnrRmD4Bo1w2c6JQNDa3DZpr+jXSHvI47Detdvn58rex8x2LyjrBZ7 6EJMtfp8f9bJkG7R/lf2xahNo69p9Yw= X-MC-Unique: t81SRpF0NYaBwR66N12fXg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 09/10] virNWFilterIPAddrMapInit: `virHashNew` cannot return NULL Date: Wed, 14 Jul 2021 11:44:56 +0200 Message-Id: <20210714094457.61612-10-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626255978619100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/conf/nwfilter_ipaddrmap.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/conf/nwfilter_ipaddrmap.c b/src/conf/nwfilter_ipaddrmap.c index d6facd749e..bc21c80536 100644 --- a/src/conf/nwfilter_ipaddrmap.c +++ b/src/conf/nwfilter_ipaddrmap.c @@ -150,9 +150,6 @@ int virNWFilterIPAddrMapInit(void) { ipAddressMap =3D virHashNew(virNWFilterVarValueHashFree); - if (!ipAddressMap) - return -1; - return 0; } =20 --=20 2.31.1 From nobody Wed May 8 09:28:55 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=1626256026; cv=none; d=zohomail.com; s=zohoarc; b=NrN1fJk5guXjLmSCVH93FbZf18bhGwTqwH1TAnvPYN0676Dyob15kW7dOekMMeA7LumdCd6ewoFhPRGTWjujQHYkR3gRJSjnw9XGiQHuWKQ3vhwJBC3CdZ7KHs5dB4UDTEju4+9sZwp9pjU7pdLudf0GFQjN1Cr4SY1kKyqNd6Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626256026; 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=uFFFj03fVgRZz3Y043sjwLrd5jYfgl9luoeLy5S5RkI=; b=JOSgmbSl7G0WXKmxBlBD2AIkXEMzQRZ+TGdoIsOj1NBz86/FJ+CrxsBhTtpqvwS+ft0pagusPgyHKDlYUNHm0rj+xeV9QPA4awpMMhoi8sjlP7rlaweoBbbf3smoAmr/KQyDPJazJg93t0f0GjJDMCkNOQc+2nifciiR37+g29E= 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 1626256026261859.4020217316471; Wed, 14 Jul 2021 02:47:06 -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-465-cze2Mh56MkSQWd_s8nRSZg-1; Wed, 14 Jul 2021 05:46:16 -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 CB1D4100CECE; Wed, 14 Jul 2021 09:46:10 +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 AE8C860BD9; Wed, 14 Jul 2021 09:46:10 +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 79D611809CB5; Wed, 14 Jul 2021 09:46:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16E9k8Rb002026 for ; Wed, 14 Jul 2021 05:46:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A01F5D6D1; Wed, 14 Jul 2021 09:46:08 +0000 (UTC) Received: from work.redhat.com (ovpn-113-156.ams2.redhat.com [10.36.113.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FA245D705; Wed, 14 Jul 2021 09:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626256025; 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=uFFFj03fVgRZz3Y043sjwLrd5jYfgl9luoeLy5S5RkI=; b=E6z/oCGyTS5zopmVZ2LuJ8e/qGxqyM+qTNkgGLLarykEhYZOcWd2eeR/DsGWjGp07mO1jD IP6Hp/YjFr5yB/jiA5iJvBlWcfQcwa2YRJON0RfbQlE4zeWi1ONXuZgAB/AydciOZcdSRh /T1WwB+io+33nucgoM8X5kBt+jLmlE8= X-MC-Unique: cze2Mh56MkSQWd_s8nRSZg-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 10/10] virNWFilterLearnInit: `virHashNew` cannot return NULL Date: Wed, 14 Jul 2021 11:44:57 +0200 Message-Id: <20210714094457.61612-11-twiederh@redhat.com> In-Reply-To: <20210714094457.61612-1-twiederh@redhat.com> References: <20210714094457.61612-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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: 1626256027192100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/nwfilter/nwfilter_learnipaddr.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index 907e4b2513..2177c5540b 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -774,16 +774,8 @@ virNWFilterLearnInit(void) =20 VIR_DEBUG("Initializing IP address learning"); threadsTerminate =3D false; - pendingLearnReq =3D virHashNew(freeLearnReqEntry); - if (!pendingLearnReq) - return -1; - ifaceLockMap =3D virHashNew(g_free); - if (!ifaceLockMap) { - virNWFilterLearnShutdown(); - return -1; - } =20 return 0; } --=20 2.31.1