From nobody Tue Feb 10 15:01:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1671045989; cv=none; d=zohomail.com; s=zohoarc; b=hfUgXOBngc/JHc5ie2y6D7yyphzYgs4/TZy2ucenaJvIJev4wi1NB9s5JJ7cvOWKQ2uIiRvApbwPO7cHssBUveOqJgK8zDht3lVCVli/GhhzZaxZM7XfxUDuHKA1agNXCwNxyROnliwvDr2BngDmIJxSINR9q+dnWxGROVlObd0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671045989; 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=sprRTfVyPhOnUuYJA8Jz6h+SHZ90iJ0QA9u+IlcN/oY=; b=Ah3hVIpQEmbDx/aEnt/RklxzKvcSL0fNJvLF/aIrpqa53Vv18fxfgbQaoS52GE+ZcbspKKDfzmbaemffgukMy/5SBR0jAbetwSb4uSyGDN006ApzzvHY0yVGRmfSf7FUmaYtYmQcwVVglZ7qjjEsnJiQn8yvMqlxMuQM8ZdKcRM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 1671045989167286.04456427012155; Wed, 14 Dec 2022 11:26:29 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-656-DMj2YHvMOrWlFLvujBfryQ-1; Wed, 14 Dec 2022 14:26:19 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 182D018A646E; Wed, 14 Dec 2022 19:26:13 +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 0207C4010E36; Wed, 14 Dec 2022 19:26:13 +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 62CB71946A50; Wed, 14 Dec 2022 19:26:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B1CB719465B9 for ; Wed, 14 Dec 2022 19:26:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A20DF40BC781; Wed, 14 Dec 2022 19:26:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9AF9B400D796 for ; Wed, 14 Dec 2022 19:26:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (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 7A673101A521 for ; Wed, 14 Dec 2022 19:26:10 +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-331-k-AvWAolOnWI6L-oO3RDLQ-1; Wed, 14 Dec 2022 14:26:08 -0500 Received: from [192.168.16.26] (helo=dv.sw.ru) by relay.virtuozzo.com with esmtp (Exim 4.95) (envelope-from ) id 1p5XOJ-00EGSm-7N; Wed, 14 Dec 2022 20:26:07 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671045984; 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=sprRTfVyPhOnUuYJA8Jz6h+SHZ90iJ0QA9u+IlcN/oY=; b=ERg7Qg4gl+nB4uSjke7OlJ92YfUtYySTV1I67rGBIgcRWRjm9mrxPAy4hZrHxQTZRON15E k1Ugp7tRB5nFQjuNJ4msAU9+eBJGR5fQcdZ/8MfsCJ/VhsYfZpMQivSNJWeoYkYXx4DBt9 XuoCppFRK/o1NKF2RQY+2Ux09537BG0= X-MC-Unique: DMj2YHvMOrWlFLvujBfryQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: k-AvWAolOnWI6L-oO3RDLQ-1 From: Oleg Vasilev To: libvir-list@redhat.com Subject: [PATCH v2 2/5] logging: move virLogHandler to header Date: Thu, 15 Dec 2022 01:25:47 +0600 Message-Id: <20221214192550.149417-3-oleg.vasilev@virtuozzo.com> In-Reply-To: <20221214192550.149417-1-oleg.vasilev@virtuozzo.com> References: <20221214192550.149417-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.2 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: Oleg Vasilev , Den Lunev Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1671045991383100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Oleg Vasilev --- src/logging/log_handler.c | 26 -------------------------- src/logging/log_handler.h | 31 ++++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 7342404b00..8fc7e9b2a8 100644 --- a/src/logging/log_handler.c +++ b/src/logging/log_handler.c @@ -22,11 +22,9 @@ =20 #include "log_handler.h" #include "virerror.h" -#include "virobject.h" #include "virfile.h" #include "viralloc.h" #include "virlog.h" -#include "virrotatingfile.h" #include "viruuid.h" #include "virutil.h" =20 @@ -42,30 +40,6 @@ VIR_LOG_INIT("logging.log_handler"); =20 #define DEFAULT_MODE 0600 =20 -typedef struct _virLogHandlerLogFile virLogHandlerLogFile; -struct _virLogHandlerLogFile { - virRotatingFileWriter *file; - int watch; - int pipefd; /* Read from QEMU via this */ - bool drained; - - char *driver; - unsigned char domuuid[VIR_UUID_BUFLEN]; - char *domname; -}; - -struct _virLogHandler { - virObjectLockable parent; - - bool privileged; - virLogDaemonConfig *config; - - virLogHandlerLogFile **files; - size_t nfiles; - - virLogHandlerShutdownInhibitor inhibitor; - void *opaque; -}; =20 static virClass *virLogHandlerClass; static void virLogHandlerDispose(void *obj); diff --git a/src/logging/log_handler.h b/src/logging/log_handler.h index c9af033cd3..d473a19fc6 100644 --- a/src/logging/log_handler.h +++ b/src/logging/log_handler.h @@ -23,13 +23,38 @@ #include "internal.h" #include "virjson.h" #include "log_daemon_config.h" - -typedef struct _virLogHandler virLogHandler; - +#include "virobject.h" +#include "virrotatingfile.h" =20 typedef void (*virLogHandlerShutdownInhibitor)(bool inhibit, void *opaque); =20 +typedef struct _virLogHandlerLogFile virLogHandlerLogFile; +struct _virLogHandlerLogFile { + virRotatingFileWriter *file; + int watch; + int pipefd; /* Read from QEMU via this */ + bool drained; + + char *driver; + unsigned char domuuid[VIR_UUID_BUFLEN]; + char *domname; +}; + +typedef struct _virLogHandler virLogHandler; +struct _virLogHandler { + virObjectLockable parent; + + bool privileged; + virLogDaemonConfig *config; + + virLogHandlerLogFile **files; + size_t nfiles; + + virLogHandlerShutdownInhibitor inhibitor; + void *opaque; +}; + virLogHandler *virLogHandlerNew(bool privileged, virLogDaemonConfig *config, virLogHandlerShutdownInhibitor inhibitor, --=20 2.38.1