From nobody Sun Feb 8 15:01:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.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=1571576225; cv=none; d=zoho.com; s=zohoarc; b=SQK2/0rgPkw3KObCaXO/7puqh20A4/1JB3z1YaEIORtVC28sQFCG57WrfSmdNRehcMt6QLCIGS3EaN4W+UqoZNzzDQLzdyAa+IMplEjySda7VpWhkWTlNc+2ysfPv9nJVktmqUF66RaM+q2bbaULJyZn6OvYJhKkcMD5agqwkhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571576225; 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=g/F/xrErg372GAm/EEvDjExo9niylZutFk3bXbImNeA=; b=D3wimyuTvD439a1M1cCcOTJELavEBM44KQJSCS7fGUwRQo0Atr5DI/8o2LMy2KEzh12ruMx6MUyptaIY6Jt7csm6PyEzHeq1GYJTnL407UR8pnepKQN6pwY6Vt8Amhar3c9xlCCNq6Xrrmq7Y4FH595r60W+0/q/Tmf3QPt51Io= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1571576225812923.3517383480444; Sun, 20 Oct 2019 05:57:05 -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-64-ryVBR440Mtid5YrsnaqqSA-1; Sun, 20 Oct 2019 08:56:30 -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 DA3B060D; Sun, 20 Oct 2019 12:56:18 +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 B3BCD60C4E; Sun, 20 Oct 2019 12:56:18 +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 796FF4EE7E; Sun, 20 Oct 2019 12:56:18 +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 x9KCtwCE023514 for ; Sun, 20 Oct 2019 08:55:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id C0CEE3CC8; Sun, 20 Oct 2019 12:55:58 +0000 (UTC) Received: from lpt.redhat.com (ovpn-200-23.brq.redhat.com [10.40.200.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 187339446 for ; Sun, 20 Oct 2019 12:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571576224; 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=g/F/xrErg372GAm/EEvDjExo9niylZutFk3bXbImNeA=; b=WdQuwnsQbYvO+5db4luRvfoO0/bC0KH+bniVf5mnVpHAl0eYV3//XkVcB+o3UURqkorHr6 qdk3T15MI3J3BI5LeF6IcAvngdyb95Kpwd3IWEP2RX2h8/aZqhrMSEXbpmLWB+t2qizpjg zgHtg5jgFZgNEsRKsTsSIXGDi3sJocs= From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Sun, 20 Oct 2019 14:55:39 +0200 Message-Id: <76fdda81850a86f1a0c05a1551101c964bdb42d5.1571575889.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 21/34] nwfilter: use g_strdup instead of VIR_STRDUP 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 X-MC-Unique: ryVBR440Mtid5YrsnaqqSA-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" Replace all occurrences of if (VIR_STRDUP(a, b) < 0) /* effectively dead code */ with: a =3D g_strdup(b); Signed-off-by: J=C3=A1n Tomko --- src/nwfilter/nwfilter_dhcpsnoop.c | 3 +-- src/nwfilter/nwfilter_driver.c | 9 +++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 2c7a1a1522..bf25345e2c 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -1093,8 +1093,7 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAd= dr *mac, * generate much more traffic than if we filtered by VM and * braodcast MAC as well */ - if (VIR_STRDUP(ext_filter, filter) < 0) - return NULL; + ext_filter =3D g_strdup(filter); } =20 handle =3D pcap_create(ifname, pcap_errbuf); diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index fbdf250934..41e0a1d5d9 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -205,8 +205,7 @@ nwfilterStateInitialize(bool privileged, =20 nwfilterDriverLock(); =20 - if (VIR_STRDUP(driver->stateDir, RUNSTATEDIR "/libvirt/nwfilter") < 0) - goto error; + driver->stateDir =3D g_strdup(RUNSTATEDIR "/libvirt/nwfilter"); =20 if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) { virReportSystemError(errno, _("cannot create state directory '%s'"= ), @@ -252,8 +251,7 @@ nwfilterStateInitialize(bool privileged, goto error; } =20 - if (VIR_STRDUP(driver->configDir, SYSCONFDIR "/libvirt/nwfilter") < 0) - goto error; + driver->configDir =3D g_strdup(SYSCONFDIR "/libvirt/nwfilter"); =20 if (virFileMakePathWithMode(driver->configDir, S_IRWXU) < 0) { virReportSystemError(errno, _("cannot create config directory '%s'= "), @@ -261,8 +259,7 @@ nwfilterStateInitialize(bool privileged, goto error; } =20 - if (VIR_STRDUP(driver->bindingDir, RUNSTATEDIR "/libvirt/nwfilter-bind= ing") < 0) - goto error; + driver->bindingDir =3D g_strdup(RUNSTATEDIR "/libvirt/nwfilter-binding= "); =20 if (virFileMakePathWithMode(driver->bindingDir, S_IRWXU) < 0) { virReportSystemError(errno, _("cannot create config directory '%s'= "), --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list