From nobody Sun Feb 8 20:17:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1571753107; cv=none; d=zoho.com; s=zohoarc; b=i3noszdM0+nOuTc5K7LeJo5zj+M356E1D0nExfLMDYeFtokthyskQCEtWoDnoUCvH6A5BU5rNjclSoIQpa9rf1id4+mhxYcAfjukZH5ILVaMDw55K1WrWm95oC2QjRv44YrhORGe/Etc/CPAlbhDhoMJ4vlr7mk2vlWylhiY9IQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571753107; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YVFvNXRnsQWog03qRJroykFFom8t55Q9jQp4nYitgkQ=; b=LU5/Fk1l2Vm5cjJctgBVjKc81SgsAz1nfVoIkpl/0Ko49J0R0Sc1bIBZlam/R1Wa73vctST3pHnT1KG40u5ebFdRzBAlNgPyfBXhKl1rWWSFI1e/MkpoDTKiU3PvDM0EhEEaB6GlCDjQ1QJcmuJrwSC3WFia6TELtl9AzJo+aKI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1571753107266751.899363679478; Tue, 22 Oct 2019 07:05:07 -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-42-MYymQce8NH6vANCAOsrFww-1; Tue, 22 Oct 2019 09:58:53 -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 B2FFA603; Tue, 22 Oct 2019 13:58:48 +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 46CB452C6; Tue, 22 Oct 2019 13:58:48 +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 01F62180BA9F; Tue, 22 Oct 2019 13:58:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x9MDwgSc001668 for ; Tue, 22 Oct 2019 09:58:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id C3B1960161; Tue, 22 Oct 2019 13:58:42 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D7FB6012C for ; Tue, 22 Oct 2019 13:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571753106; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YVFvNXRnsQWog03qRJroykFFom8t55Q9jQp4nYitgkQ=; b=EtMZqeTOejraQmC5H83H5a/nOCrw7E/bGsXzZBb79YC/tXYqLrIyOYFNCMv5lMlFceprTt PGQVOCR19hqv4nNuk8Q1mYEKELA6aEZx3mqr53V/i7fY6S+llisC8WLs16ju6c6Qaib+2p zGNrIjRetLqiAoqe6cDPXqlz9SxjgGk= From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 22 Oct 2019 15:57:20 +0200 Message-Id: <3961e88c53ce1cf38135ca7b5769e3beef320276.1571752582.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 16/75] nwfilter: Drop virAsprintf() and virAsprintfQuiet() retval checking 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 X-MC-Unique: MYymQce8NH6vANCAOsrFww-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" These functions can't fail really. Drop checking of their retval then. Signed-off-by: Michal Privoznik --- src/nwfilter/nwfilter_dhcpsnoop.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 665e7bff9c..b4ce8a0613 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -315,8 +315,7 @@ virNWFilterSnoopActivate(virNWFilterSnoopReqPtr req) { char *key; =20 - if (virAsprintf(&key, "%p-%d", req, req->ifindex) < 0) - return NULL; + virAsprintf(&key, "%p-%d", req, req->ifindex); =20 virNWFilterSnoopActiveLock(); =20 @@ -1081,9 +1080,7 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAd= dr *mac, * extend the filter with the macaddr of the VM; filter the * more unlikely parameters first, then go for the MAC */ - if (virAsprintf(&ext_filter, - "%s and ether src %s", filter, macaddr) < 0) - return NULL; + virAsprintf(&ext_filter, "%s and ether src %s", filter, macaddr); } else { /* * Some DHCP servers respond via MAC broadcast; we rely on later @@ -1766,11 +1763,7 @@ virNWFilterSnoopLeaseFileWrite(int lfd, const char *= ifkey, } =20 /* time intf ip dhcpserver */ - if (virAsprintf(&lbuf, "%u %s %s %s\n", ipl->timeout, - ifkey, ipstr, dhcpstr) < 0) { - ret =3D -1; - goto cleanup; - } + virAsprintf(&lbuf, "%u %s %s %s\n", ipl->timeout, ifkey, ipstr, dhcpst= r); len =3D strlen(lbuf); =20 if (safewrite(lfd, lbuf, len) !=3D len) { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list