From nobody Mon Nov 25 21:45:07 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1594156441; cv=none; d=zohomail.com; s=zohoarc; b=lFBDtjkoxkcerSJqVyjAT2RXfoXlvJuYr0zuYDUN/E/LxeZgpG4OArC6CkTdURGlcVvwiCixdjSXddAOK+POh3Tbmp1NottvXZP6TkL5FqdGCCfgUFHNDanv4sU/y9HusnnMk2Y+4z2sGlhtyehMDvrNvilXHHW2jj6z+/JtjT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594156441; 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=jppcayGG2ARd0LCc2Z/wBUhFK/+AFFCmol+eQQV4M50=; b=kJqS92qpspWmNFb64xpfBc3Uk4cxEiFUm/0tbdy8fw7RyDRqOYf6HqSjHbOisOl0PY6UtKb4IWa3fHQNtkFK9i2AnfOGBqGwzmIy/YtTlgHKJG8FJAX9TL9OCtjoR3nAHQNoSgKrCriJFkAMsAUcGjLhKp6BWF4BC8dyHzbz3WE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 1594156440997288.7150271484827; Tue, 7 Jul 2020 14:14: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-88-oEuRUYq2Pr6A9rMNVmpxAA-1; Tue, 07 Jul 2020 17:13:57 -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 B695780058A; Tue, 7 Jul 2020 21:13:51 +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 98B6C79220; Tue, 7 Jul 2020 21:13:51 +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 6A80472F77; Tue, 7 Jul 2020 21:13:51 +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 067L8RF8008000 for ; Tue, 7 Jul 2020 17:08:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 763E179220; Tue, 7 Jul 2020 21:08:27 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-194.phx2.redhat.com [10.3.112.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F307797E9 for ; Tue, 7 Jul 2020 21:08:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594156439; 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=jppcayGG2ARd0LCc2Z/wBUhFK/+AFFCmol+eQQV4M50=; b=E32YV/LGCpMV7KqCjeT+GGNLJjYK1CJ4Tx5NtdWvvAivgs5UBTJIfYGjgkFX6oViV4DBcf AjEjcusvvrfXjrWS7JtDmzaeWYx/ikxVhCtYdol10QWfZCeUjukj1hDQrjtOU0pBrZ73jf H8AYn42OPnkf6P0fF5nXe+q3q8mYtbA= X-MC-Unique: oEuRUYq2Pr6A9rMNVmpxAA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [libvirt PATCH v2 09/15] nwfilter: clear nrules when resetting virNWFilterInst Date: Tue, 7 Jul 2020 17:08:09 -0400 Message-Id: <20200707210815.1797463-10-laine@redhat.com> In-Reply-To: <20200707210815.1797463-1-laine@redhat.com> References: <20200707210815.1797463-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com 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) Content-Type: text/plain; charset="utf-8" It's possible/probable the callers to virNWFilterInstReset() make it unnecessary to set the object's nrules to 0 after freeing all its rules, but that same function is setting nfilters to 0, so let's do the same for the sake of consistency. Signed-off-by: Laine Stump Reviewed-by: J=C3=A1n Tomko --- src/nwfilter/nwfilter_gentech_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter= _gentech_driver.c index b7633eb10a..aff42cbfb0 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -240,6 +240,7 @@ virNWFilterInstReset(virNWFilterInstPtr inst) for (i =3D 0; i < inst->nrules; i++) virNWFilterRuleInstFree(inst->rules[i]); VIR_FREE(inst->rules); + inst->nrules =3D 0; } =20 =20 --=20 2.25.4