From nobody Mon Feb 9 23:57:47 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1577977266; cv=none; d=zohomail.com; s=zohoarc; b=ihIgJHt0dnQ4/0/rLOJ5v+bspoqo7A9XL2MrI4EHEmgx9f0SNFtpJTQZ4yB/wbE3OqTzQlDiGRZbaxmvsfx6p0I28c/ZlQAIfGi2mxaqKO7n25qjT/fSKqEI74YAefzfkhsFSfuQrW8fgxvdaNvHwKDpn8selLTqMtRfk4xO/Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1577977266; 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=XzeWGw3ztd7XPpjem1vHsguE2IN2in3UlOhd025zb9I=; b=jzsCckB06bYUEJzPEW8uPPHS9Azvv+QyKcAiRkL0mpYI/DzBVXwOM0E2VvK9/wDc9W/7y+Ogj07Cdfr29TfF2pemg37bsLZMHX/BNyhhGr9MHlLr48QGSQ90SaTQ0jJ6aTLerCIohnPL1obTpPgbKGiLXnqBnyasus2vM9w/fSQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1577977266290932.4158335354941; Thu, 2 Jan 2020 07:01:06 -0800 (PST) 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-357-rkCaNz4PMKS982NkmedBug-1; Thu, 02 Jan 2020 10:01:03 -0500 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 74667109A91D; Thu, 2 Jan 2020 15:00:57 +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 33F417E48D; Thu, 2 Jan 2020 15:00:57 +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 C8AF381E32; Thu, 2 Jan 2020 15:00:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 002F0kG1005816 for ; Thu, 2 Jan 2020 10:00:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2944D19C5B; Thu, 2 Jan 2020 15:00:46 +0000 (UTC) Received: from laerte.redhat.com (unknown [10.43.2.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B11019C4F; Thu, 2 Jan 2020 15:00:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577977265; 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=XzeWGw3ztd7XPpjem1vHsguE2IN2in3UlOhd025zb9I=; b=ACSofDUP5hCxk3WeuD+TXxYVnYvQzVZ/vpNJiGlOwNeYSO8pXCHNKfRZ64lGsitic7yh0Y 8AbPBRPLYR9RM0Lj4JtVwV0Fnf+gJm7bCJU4WZIUUielD/t3199SWkOExLyT17zzVOf9Pb fJ+cZ851FZgfD2LwcEYYFwfvVKmXJ1A= From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Date: Thu, 2 Jan 2020 16:00:34 +0100 Message-Id: <20200102150035.1085486-5-fidencio@redhat.com> In-Reply-To: <20200102150035.1085486-1-fidencio@redhat.com> References: <20200102150035.1085486-1-fidencio@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Subject: [libvirt] [PATCH v2 4/5] util: Adapt ADD_ARG() macro 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 X-MC-Unique: rkCaNz4PMKS982NkmedBug-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) As VIR_RESIZE_N() macro already aborts in case of OOM, there's no reason to check for its output in the ADD_ARG() macro. By doing this, we can simply get rid of a all no_memory labels spread in the virfirewall.c file. Signed-off-by: Fabiano Fid=C3=AAncio --- src/util/virfirewall.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 564e2fe0be..7c8040880c 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -320,11 +320,9 @@ void virFirewallFree(virFirewallPtr firewall) =20 #define ADD_ARG(rule, str) \ do { \ - if (VIR_RESIZE_N(rule->args, \ - rule->argsAlloc, \ - rule->argsLen, 1) < 0) \ - goto no_memory; \ - \ + ignore_value(VIR_RESIZE_N(rule->args, \ + rule->argsAlloc, \ + rule->argsLen, 1)); \ rule->args[rule->argsLen++] =3D g_strdup(str); \ } while (0) =20 @@ -391,9 +389,6 @@ virFirewallAddRuleFullV(virFirewallPtr firewall, =20 =20 return g_steal_pointer(&rule); - - no_memory: - return NULL; } =20 =20 @@ -491,9 +486,6 @@ void virFirewallRuleAddArg(virFirewallPtr firewall, VIR_FIREWALL_RULE_RETURN_IF_ERROR(firewall, rule); =20 ADD_ARG(rule, arg); - - no_memory: - return; } =20 =20 @@ -511,9 +503,6 @@ void virFirewallRuleAddArgFormat(virFirewallPtr firewal= l, va_end(list); =20 ADD_ARG(rule, arg); - - no_memory: - return; } =20 =20 @@ -527,9 +516,6 @@ void virFirewallRuleAddArgSet(virFirewallPtr firewall, ADD_ARG(rule, *args); args++; } - - no_memory: - return; } =20 =20 @@ -547,7 +533,6 @@ void virFirewallRuleAddArgList(virFirewallPtr firewall, while ((str =3D va_arg(list, char *)) !=3D NULL) ADD_ARG(rule, str); =20 - no_memory: va_end(list); } =20 --=20 2.24.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list