On 01/19/2018 06:09 PM, Daniel P. Berrange wrote:
Add a virtlockd-admin-sock can serves the admin protocol for the
virtlockd
daemon and define a virtlockd:///{system,session} URI scheme for
connecting to it.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
cfg.mk | 1 -
src/Makefile.am | 1 +
src/libvirt-admin.c | 3 +
src/locking/lock_daemon.c | 132 +++++++++++++++++++++++++---------
src/locking/lock_daemon_config.c | 3 +
src/locking/lock_daemon_config.h | 1 +
src/locking/test_virtlockd.aug.in | 4 ++
src/locking/virtlockd-admin.socket.in | 10 +++
src/locking/virtlockd.aug | 1 +
src/locking/virtlockd.conf | 6 ++
src/locking/virtlockd.service.in | 1 +
11 files changed, 129 insertions(+), 34 deletions(-)
create mode 100644 src/locking/virtlockd-admin.socket.in
diff --git a/src/locking/lock_daemon_config.c
b/src/locking/lock_daemon_config.c
index 20824b870c..efa5655a30 100644
--- a/src/locking/lock_daemon_config.c
+++ b/src/locking/lock_daemon_config.c
@@ -72,6 +72,7 @@ virLockDaemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
return NULL;
data->max_clients = 1024;
+ data->admin_max_clients = 5000;
Again, looks like too much. 5 would match value in the config file.
return data;
}
@@ -100,6 +101,8 @@ virLockDaemonConfigLoadOptions(virLockDaemonConfigPtr 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;
return 0;
}
diff --git a/src/locking/lock_daemon_config.h b/src/locking/lock_daemon_config.h
index 6ab84c6a0a..3e642208f5 100644
--- a/src/locking/lock_daemon_config.h
+++ b/src/locking/lock_daemon_config.h
@@ -34,6 +34,7 @@ struct _virLockDaemonConfig {
char *log_filters;
char *log_outputs;
unsigned int max_clients;
+ unsigned int admin_max_clients;
};
diff --git a/src/locking/test_virtlockd.aug.in b/src/locking/test_virtlockd.aug.in
index 799818e5d1..2d69816b5c 100644
--- a/src/locking/test_virtlockd.aug.in
+++ b/src/locking/test_virtlockd.aug.in
@@ -3,6 +3,8 @@ module Test_virtlockd =
log_filters=\"3:remote 4:event\"
log_outputs=\"3:syslog:libvirtd\"
log_buffer_size = 64
+max_clients = 10
+admin_max_clients = 10
"
test Virtlockd.lns get conf =
@@ -10,3 +12,5 @@ log_buffer_size = 64
{ "log_filters" = "3:remote 4:event" }
{ "log_outputs" = "3:syslog:libvirtd" }
{ "log_buffer_size" = "64" }
+ { "max_clients" = "10" }
+ { "admin_max_clients" = "10" }
Please expand the TABs.
Michal