On 01/19/2018 06:09 PM, Daniel P. Berrange wrote:
Add a virtlogd-admin-sock can serves the admin protocol for the
virtlogd
daemon and define a virtlogd:///{system,session} URI scheme for
connecting to it.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/Makefile.am | 1 +
src/libvirt-admin.c | 20 ++++--
src/logging/log_daemon.c | 135 ++++++++++++++++++++++++++---------
src/logging/log_daemon_config.c | 3 +
src/logging/log_daemon_config.h | 1 +
src/logging/test_virtlogd.aug.in | 4 ++
src/logging/virtlogd-admin.socket.in | 10 +++
src/logging/virtlogd.aug | 1 +
src/logging/virtlogd.service.in | 1 +
9 files changed, 136 insertions(+), 40 deletions(-)
create mode 100644 src/logging/virtlogd-admin.socket.in
diff --git a/src/logging/log_daemon_config.c
b/src/logging/log_daemon_config.c
index cf58e6230e..3226b2c484 100644
--- a/src/logging/log_daemon_config.c
+++ b/src/logging/log_daemon_config.c
@@ -73,6 +73,7 @@ virLogDaemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
return NULL;
data->max_clients = 1024;
+ data->admin_max_clients = 5000;
data->max_size = 1024 * 1024 * 2;
data->max_backups = 3;
5000 seems like huge default. Perhaps 5 is enough? Or 10 so that we
match the value from the aug test. Which brigns up interesting question
- how come we don't need src/logging/virtlogd.conf change too? And also,
how can it be that the aug test doesn't test virtlogd.conf but some
crafted input? We should have something similar to qemu.conf test.
@@ -103,6 +104,8 @@ virLogDaemonConfigLoadOptions(virLogDaemonConfigPtr data,
return -1;
if (virConfGetValueUInt(conf, "max_clients", &data->max_clients)
< 0)
return -1;
+ if (virConfGetValueUInt(conf, "admin_max_clients",
&data->admin_max_clients) < 0)
+ return -1;
if (virConfGetValueSizeT(conf, "max_size", &data->max_size) <
0)
return -1;
if (virConfGetValueSizeT(conf, "max_backups", &data->max_backups)
< 0)
diff --git a/src/logging/log_daemon_config.h b/src/logging/log_daemon_config.h
index 72d77d5e6f..53101b0610 100644
--- a/src/logging/log_daemon_config.h
+++ b/src/logging/log_daemon_config.h
@@ -34,6 +34,7 @@ struct _virLogDaemonConfig {
char *log_filters;
char *log_outputs;
unsigned int max_clients;
+ unsigned int admin_max_clients;
size_t max_backups;
size_t max_size;
diff --git a/src/logging/test_virtlogd.aug.in b/src/logging/test_virtlogd.aug.in
index 3e6888fd48..ee3fae5cde 100644
--- a/src/logging/test_virtlogd.aug.in
+++ b/src/logging/test_virtlogd.aug.in
@@ -2,6 +2,8 @@ module Test_virtlogd =
let conf = "log_level = 3
log_filters=\"3:remote 4:event\"
log_outputs=\"3:syslog:virtlogd\"
+max_clients = 10
+admin_max_clients = 10
max_size = 131072
max_backups = 3
"
@@ -10,5 +12,7 @@ max_backups = 3
{ "log_level" = "3" }
{ "log_filters" = "3:remote 4:event" }
{ "log_outputs" = "3:syslog:virtlogd" }
+ { "max_clients" = "10" }
+ { "admin_max_clients" = "10" }
Expand the TABs please.
Michal