The virtlogd RPC messages all have a flags parameter. For
sake of future error reporting we should be verifying
these are all 0 for now.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/logging/log_daemon_dispatch.c | 5 ++++-
src/logging/log_handler.c | 11 ++++++++++-
src/logging/log_handler.h | 5 ++++-
3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/src/logging/log_daemon_dispatch.c b/src/logging/log_daemon_dispatch.c
index da7c414..a5fa7f0 100644
--- a/src/logging/log_daemon_dispatch.c
+++ b/src/logging/log_daemon_dispatch.c
@@ -56,6 +56,7 @@ virLogManagerProtocolDispatchDomainOpenLogFile(virNetServerPtr server
ATTRIBUTE_
(unsigned char *)args->dom.uuid,
args->dom.name,
args->path,
+ args->flags,
&inode, &offset)) < 0)
goto cleanup;
@@ -89,6 +90,7 @@ virLogManagerProtocolDispatchDomainGetLogFilePosition(virNetServerPtr
server ATT
if (virLogHandlerDomainGetLogFilePosition(virLogDaemonGetHandler(logDaemon),
args->path,
+ args->flags,
&inode, &offset) < 0)
goto cleanup;
@@ -127,7 +129,8 @@ virLogManagerProtocolDispatchDomainReadLogFile(virNetServerPtr server
ATTRIBUTE_
args->path,
args->pos.inode,
args->pos.offset,
- args->maxlen)) == NULL)
+ args->maxlen,
+ args->flags)) == NULL)
goto cleanup;
ret->data = data;
diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index b24826c..77b7f0d 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -357,6 +357,7 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
const unsigned char *domuuid ATTRIBUTE_UNUSED,
const char *domname,
const char *path,
+ unsigned int flags,
ino_t *inode,
off_t *offset)
{
@@ -364,6 +365,8 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
virLogHandlerLogFilePtr file = NULL;
int pipefd[2] = { -1, -1 };
+ virCheckFlags(0, -1);
+
virObjectLock(handler);
handler->inhibitor(true, handler->opaque);
@@ -432,6 +435,7 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
int
virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler,
const char *path,
+ unsigned int flags,
ino_t *inode,
off_t *offset)
{
@@ -439,6 +443,8 @@ virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler,
int ret = -1;
size_t i;
+ virCheckFlags(0, -1);
+
virObjectLock(handler);
for (i = 0; i < handler->nfiles; i++) {
@@ -472,12 +478,15 @@ virLogHandlerDomainReadLogFile(virLogHandlerPtr handler,
const char *path,
ino_t inode,
off_t offset,
- size_t maxlen)
+ size_t maxlen,
+ unsigned int flags)
{
virRotatingFileReaderPtr file = NULL;
char *data = NULL;
ssize_t got;
+ virCheckFlags(0, NULL);
+
virObjectLock(handler);
if (!(file = virRotatingFileReaderNew(path, DEFAULT_MAX_BACKUP)))
diff --git a/src/logging/log_handler.h b/src/logging/log_handler.h
index 6a13072..e61f32d 100644
--- a/src/logging/log_handler.h
+++ b/src/logging/log_handler.h
@@ -48,11 +48,13 @@ int virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
const unsigned char *domuuid,
const char *domname,
const char *path,
+ unsigned int flags,
ino_t *inode,
off_t *offset);
int virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler,
const char *path,
+ unsigned int flags,
ino_t *inode,
off_t *offset);
@@ -60,7 +62,8 @@ char *virLogHandlerDomainReadLogFile(virLogHandlerPtr handler,
const char *path,
ino_t inode,
off_t offset,
- size_t maxlen);
+ size_t maxlen,
+ unsigned int flags);
virJSONValuePtr virLogHandlerPreExecRestart(virLogHandlerPtr handler);
--
2.5.0