2015-11-03 11:01:21 +00:00
|
|
|
/*
|
|
|
|
* log_handler.h: log management daemon handler
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_LOG_HANDLER_H__
|
|
|
|
# define __VIR_LOG_HANDLER_H__
|
|
|
|
|
|
|
|
# include "internal.h"
|
|
|
|
# include "virjson.h"
|
|
|
|
|
|
|
|
typedef struct _virLogHandler virLogHandler;
|
|
|
|
typedef virLogHandler *virLogHandlerPtr;
|
|
|
|
|
|
|
|
|
2015-11-24 11:47:41 +00:00
|
|
|
typedef void (*virLogHandlerShutdownInhibitor)(bool inhibit,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
virLogHandlerPtr virLogHandlerNew(bool privileged,
|
2016-07-01 16:40:55 +00:00
|
|
|
size_t max_size,
|
|
|
|
size_t max_backups,
|
2015-11-24 11:47:41 +00:00
|
|
|
virLogHandlerShutdownInhibitor inhibitor,
|
|
|
|
void *opaque);
|
2015-11-03 11:01:21 +00:00
|
|
|
virLogHandlerPtr virLogHandlerNewPostExecRestart(virJSONValuePtr child,
|
2015-11-24 11:47:41 +00:00
|
|
|
bool privileged,
|
2016-07-01 16:40:55 +00:00
|
|
|
size_t max_size,
|
|
|
|
size_t max_backups,
|
2015-11-24 11:47:41 +00:00
|
|
|
virLogHandlerShutdownInhibitor inhibitor,
|
|
|
|
void *opaque);
|
2015-11-03 11:01:21 +00:00
|
|
|
|
|
|
|
void virLogHandlerFree(virLogHandlerPtr handler);
|
|
|
|
|
|
|
|
int virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
|
|
|
|
const char *driver,
|
|
|
|
const unsigned char *domuuid,
|
|
|
|
const char *domname,
|
2015-12-03 17:20:35 +00:00
|
|
|
const char *path,
|
2016-02-29 12:26:02 +00:00
|
|
|
bool trunc,
|
2015-11-03 11:01:21 +00:00
|
|
|
ino_t *inode,
|
|
|
|
off_t *offset);
|
|
|
|
|
|
|
|
int virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler,
|
2015-12-03 17:20:35 +00:00
|
|
|
const char *path,
|
2015-12-04 15:37:04 +00:00
|
|
|
unsigned int flags,
|
2015-11-03 11:01:21 +00:00
|
|
|
ino_t *inode,
|
|
|
|
off_t *offset);
|
|
|
|
|
|
|
|
char *virLogHandlerDomainReadLogFile(virLogHandlerPtr handler,
|
2015-12-03 17:20:35 +00:00
|
|
|
const char *path,
|
2015-11-03 11:01:21 +00:00
|
|
|
ino_t inode,
|
|
|
|
off_t offset,
|
2015-12-04 15:37:04 +00:00
|
|
|
size_t maxlen,
|
|
|
|
unsigned int flags);
|
2015-11-03 11:01:21 +00:00
|
|
|
|
2016-06-07 14:09:09 +00:00
|
|
|
int virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler,
|
|
|
|
const char *driver,
|
|
|
|
const unsigned char *domuuid,
|
|
|
|
const char *domname,
|
|
|
|
const char *path,
|
|
|
|
const char *message,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2015-11-03 11:01:21 +00:00
|
|
|
virJSONValuePtr virLogHandlerPreExecRestart(virLogHandlerPtr handler);
|
|
|
|
|
2018-12-13 13:32:06 +00:00
|
|
|
#endif /* __VIR_LOG_HANDLER_H__ */
|