libvirt/src/logging/log_manager.h
Pavel Hrdina 76e79e0e77 src/logging: no need to include log_protocol.h in log_manager.h
The header log_manager.h doesn't use anything from log_protocol.h and
the only other place than logging using log_protocol.h is qemu_command.c
where we can include log_protocol.h directly to have enum value
VIR_LOG_MANAGER_PROTOCOL_DOMAIN_OPEN_LOG_FILE_TRUNCATE available.

Fixes race-condition compilation error with meson:

In file included from ../tests/qemuhotplugmock.c:21:
In file included from ../src/qemu/qemu_hotplug.h:25:
In file included from ../src/qemu/qemu_domain.h:42:
../src/logging/log_manager.h:25:10: fatal error: 'logging/log_protocol.h' file not found

         ^~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

Reported-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2020-08-04 13:28:22 +02:00

61 lines
2.4 KiB
C

/*
* log_manager.h: log management client
*
* 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/>.
*/
#pragma once
#include "internal.h"
typedef struct _virLogManager virLogManager;
typedef virLogManager *virLogManagerPtr;
virLogManagerPtr virLogManagerNew(bool privileged);
void virLogManagerFree(virLogManagerPtr mgr);
int virLogManagerDomainOpenLogFile(virLogManagerPtr mgr,
const char *driver,
const unsigned char *domuuid,
const char *domname,
const char *path,
unsigned int flags,
ino_t *inode,
off_t *offset);
int virLogManagerDomainGetLogFilePosition(virLogManagerPtr mgr,
const char *path,
unsigned int flags,
ino_t *inode,
off_t *offset);
char *virLogManagerDomainReadLogFile(virLogManagerPtr mgr,
const char *path,
ino_t inode,
off_t offset,
size_t maxlen,
unsigned int flags);
int virLogManagerDomainAppendMessage(virLogManagerPtr mgr,
const char *driver,
const unsigned char *domuuid,
const char *domname,
const char *path,
const char *message,
unsigned int flags);