From nobody Mon Feb 9 19:04:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=quarantine dis=quarantine) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1675091030; cv=none; d=zohomail.com; s=zohoarc; b=Ul3pSdwb17K0ml28WU2x2UW4llPh+mny/41LeYBNMDJ9daLUH0cP9Qo9opE2TmV+fjJLI1rW907UDWCAMEXWvop/rxG7yNIXEL8akYGR7Y+v6ok8z4f/Si5s6uQI4GajuYeJiMRvigrlMDZpV5o0F6axsGzwAisNHZ7RZ6bKwW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675091030; 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=hlh4gjfTQHZHX+KbCIGg2bzFKIP+nKUUb+iIj/veDC0=; b=RUMRNAPhIQxTuSv9nB2r2fyVEumg8hdnCrmI1dV1P00LKQ1MzSp9rla6Bn368zOcQDu/iIbSzndQ5jVDGt8s6E514TXoRkOhtNjOrYIz0SOGmPi8Uiw3tAo0HxjQAtXlAS71DD8h73DOITcv2SvnsbeEkpNOQyHpCuT2JHPDqgE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=quarantine dis=quarantine) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1675091030399514.947077087862; Mon, 30 Jan 2023 07:03:50 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-651-uwtFfLLGObeoVg2jqWawPA-1; Mon, 30 Jan 2023 10:01:01 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 552272801E5F; Mon, 30 Jan 2023 15:00:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DB9440C2064; Mon, 30 Jan 2023 15:00:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B41101946A46; Mon, 30 Jan 2023 15:00:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F39701946587 for ; Mon, 30 Jan 2023 15:00:30 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D70342166B29; Mon, 30 Jan 2023 15:00:30 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFCD12166B26 for ; Mon, 30 Jan 2023 15:00:30 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B518F85CBEA for ; Mon, 30 Jan 2023 15:00:30 +0000 (UTC) Received: from relay.virtuozzo.com (relay.virtuozzo.com [130.117.225.111]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-622-vNLZobwZNsKyhSXTpTxwNA-1; Mon, 30 Jan 2023 10:00:27 -0500 Received: from [192.168.16.74] (helo=dv.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.95) (envelope-from ) id 1pMVdt-00AYfM-Tt; Mon, 30 Jan 2023 16:00:22 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675090869; 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=hlh4gjfTQHZHX+KbCIGg2bzFKIP+nKUUb+iIj/veDC0=; b=I0Ny5nL23vtSw9YPi8e9TLhbFRCi4a70igYCCv9YCp9OLcAqo+uaYA7sus+mMUgVv7NtVr tXIHANnla2fFnfmpZILz+jJ3CBarE5hoIHsH5VA6BgWes6NVIky14HhXdl76xzdDbWhLT8 Tpa5Z2P6idr2Tl2pSurBWw1N7JlydGQ= X-MC-Unique: uwtFfLLGObeoVg2jqWawPA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: vNLZobwZNsKyhSXTpTxwNA-1 From: Oleg Vasilev To: libvir-list@redhat.com Subject: [PATCH v3 5/5] logging: use the log cleaner Date: Mon, 30 Jan 2023 21:00:02 +0600 Message-Id: <20230130150002.322315-6-oleg.vasilev@virtuozzo.com> In-Reply-To: <20230130150002.322315-1-oleg.vasilev@virtuozzo.com> References: <20230130150002.322315-1-oleg.vasilev@virtuozzo.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Kletzander , Den Lunev , Oleg Vasilev Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1675091031706100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Actually use the log cleaner introduced by previous commit. Signed-off-by: Oleg Vasilev --- src/logging/log_handler.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 8fc7e9b2a8..a739211c7c 100644 --- a/src/logging/log_handler.c +++ b/src/logging/log_handler.c @@ -21,6 +21,7 @@ #include =20 #include "log_handler.h" +#include "log_cleaner.h" #include "virerror.h" #include "virfile.h" #include "viralloc.h" @@ -175,7 +176,15 @@ virLogHandlerNew(bool privileged, handler->inhibitor =3D inhibitor; handler->opaque =3D opaque; =20 + if (virLogCleanerInit(handler) < 0) { + goto error; + } + return handler; + + error: + virObjectUnref(handler); + return NULL; } =20 =20 @@ -313,6 +322,8 @@ virLogHandlerDispose(void *obj) virLogHandler *handler =3D obj; size_t i; =20 + virLogCleanerShutdown(handler); + for (i =3D 0; i < handler->nfiles; i++) { handler->inhibitor(false, handler->opaque); virLogHandlerLogFileFree(handler->files[i]); --=20 2.39.1