|
|
7a3408 |
From 62c256e02e63007860ca1fb4ef0d6d1121091e55 Mon Sep 17 00:00:00 2001
|
|
|
7a3408 |
Message-Id: <62c256e02e63007860ca1fb4ef0d6d1121091e55@dist-git>
|
|
|
7a3408 |
From: Martin Kletzander <mkletzan@redhat.com>
|
|
|
7a3408 |
Date: Mon, 10 Aug 2015 13:55:19 +0200
|
|
|
7a3408 |
Subject: [PATCH] rpc: Remove keepalive_required option
|
|
|
7a3408 |
|
|
|
7a3408 |
https://bugzilla.redhat.com/show_bug.cgi?id=1247087
|
|
|
7a3408 |
|
|
|
7a3408 |
Since its introduction in 2011 (particularly in commit f4324e329275),
|
|
|
7a3408 |
the option doesn't work. It just effectively disables all incoming
|
|
|
7a3408 |
connections. That's because the client private data that contain the
|
|
|
7a3408 |
'keepalive_supported' boolean, are initialized to zeroes so the bool is
|
|
|
7a3408 |
false and the only other place where the bool is used is when checking
|
|
|
7a3408 |
whether the client supports keepalive. Thus, according to the server,
|
|
|
7a3408 |
no client supports keepalive.
|
|
|
7a3408 |
|
|
|
7a3408 |
Removing this instead of fixing it is better because a) apparently
|
|
|
7a3408 |
nobody ever tried it since 2011 (4 years without one month) and b) we
|
|
|
7a3408 |
cannot know whether the client supports keepalive until we get a ping or
|
|
|
7a3408 |
pong keepalive packet. And that won't happen until after we dispatched
|
|
|
7a3408 |
the ConnectOpen call.
|
|
|
7a3408 |
|
|
|
7a3408 |
Another two reasons would be c) the keepalive_required was tracked on
|
|
|
7a3408 |
the server level, but keepalive_supported was in private data of the
|
|
|
7a3408 |
client as well as the check that was made in the remote layer, thus
|
|
|
7a3408 |
making all other instances of virNetServer miss this feature unless they
|
|
|
7a3408 |
all implemented it for themselves and d) we can always add it back in
|
|
|
7a3408 |
case there is a request and a use-case for it.
|
|
|
7a3408 |
|
|
|
7a3408 |
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
7a3408 |
(cherry picked from commit a8743c39389b76897811f60dcd8485cd51d76f02)
|
|
|
7a3408 |
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
|
|
7a3408 |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
7a3408 |
---
|
|
|
7a3408 |
daemon/libvirtd-config.c | 4 -
|
|
|
7a3408 |
daemon/libvirtd-config.h | 2 -
|
|
|
7a3408 |
daemon/libvirtd.c | 2 -
|
|
|
7a3408 |
daemon/libvirtd.conf | 9 +-
|
|
|
7a3408 |
daemon/libvirtd.h | 1 -
|
|
|
7a3408 |
daemon/remote.c | 8 +-
|
|
|
7a3408 |
daemon/test_libvirtd.aug.in | 2 +-
|
|
|
7a3408 |
src/libvirt_remote.syms | 1 -
|
|
|
7a3408 |
src/locking/lock_daemon.c | 2 +-
|
|
|
7a3408 |
src/lxc/lxc_controller.c | 2 +-
|
|
|
7a3408 |
src/rpc/virnetserver.c | 25 +----
|
|
|
7a3408 |
src/rpc/virnetserver.h | 3 -
|
|
|
7a3408 |
tests/libvirtdconftest.c | 4 +-
|
|
|
7a3408 |
.../input-data-no-keepalive-required.json | 124 +++++++++++++++++++++
|
|
|
7a3408 |
.../virnetdaemondata/output-data-admin-nomdns.json | 2 -
|
|
|
7a3408 |
.../virnetdaemondata/output-data-anon-clients.json | 1 -
|
|
|
7a3408 |
.../output-data-initial-nomdns.json | 1 -
|
|
|
7a3408 |
tests/virnetdaemondata/output-data-initial.json | 1 -
|
|
|
7a3408 |
.../output-data-no-keepalive-required.json | 124 +++++++++++++++++++++
|
|
|
7a3408 |
tests/virnetdaemontest.c | 2 +-
|
|
|
7a3408 |
20 files changed, 262 insertions(+), 58 deletions(-)
|
|
|
7a3408 |
create mode 100644 tests/virnetdaemondata/input-data-no-keepalive-required.json
|
|
|
7a3408 |
create mode 100644 tests/virnetdaemondata/output-data-no-keepalive-required.json
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/daemon/libvirtd-config.c b/daemon/libvirtd-config.c
|
|
|
7a3408 |
index 10dcc42..c31c8b2 100644
|
|
|
7a3408 |
--- a/daemon/libvirtd-config.c
|
|
|
7a3408 |
+++ b/daemon/libvirtd-config.c
|
|
|
7a3408 |
@@ -292,7 +292,6 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
|
|
|
7a3408 |
|
|
|
7a3408 |
data->keepalive_interval = 5;
|
|
|
7a3408 |
data->keepalive_count = 5;
|
|
|
7a3408 |
- data->keepalive_required = 0;
|
|
|
7a3408 |
|
|
|
7a3408 |
data->admin_min_workers = 5;
|
|
|
7a3408 |
data->admin_max_workers = 20;
|
|
|
7a3408 |
@@ -302,7 +301,6 @@ daemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
|
|
|
7a3408 |
|
|
|
7a3408 |
data->admin_keepalive_interval = 5;
|
|
|
7a3408 |
data->admin_keepalive_count = 5;
|
|
|
7a3408 |
- data->admin_keepalive_required = 0;
|
|
|
7a3408 |
|
|
|
7a3408 |
localhost = virGetHostname();
|
|
|
7a3408 |
if (localhost == NULL) {
|
|
|
7a3408 |
@@ -471,11 +469,9 @@ daemonConfigLoadOptions(struct daemonConfig *data,
|
|
|
7a3408 |
|
|
|
7a3408 |
GET_CONF_INT(conf, filename, keepalive_interval);
|
|
|
7a3408 |
GET_CONF_UINT(conf, filename, keepalive_count);
|
|
|
7a3408 |
- GET_CONF_UINT(conf, filename, keepalive_required);
|
|
|
7a3408 |
|
|
|
7a3408 |
GET_CONF_INT(conf, filename, admin_keepalive_interval);
|
|
|
7a3408 |
GET_CONF_UINT(conf, filename, admin_keepalive_count);
|
|
|
7a3408 |
- GET_CONF_UINT(conf, filename, admin_keepalive_required);
|
|
|
7a3408 |
|
|
|
7a3408 |
return 0;
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/daemon/libvirtd-config.h b/daemon/libvirtd-config.h
|
|
|
7a3408 |
index 9cdae1a..3e1971d 100644
|
|
|
7a3408 |
--- a/daemon/libvirtd-config.h
|
|
|
7a3408 |
+++ b/daemon/libvirtd-config.h
|
|
|
7a3408 |
@@ -81,7 +81,6 @@ struct daemonConfig {
|
|
|
7a3408 |
|
|
|
7a3408 |
int keepalive_interval;
|
|
|
7a3408 |
unsigned int keepalive_count;
|
|
|
7a3408 |
- int keepalive_required;
|
|
|
7a3408 |
|
|
|
7a3408 |
int admin_min_workers;
|
|
|
7a3408 |
int admin_max_workers;
|
|
|
7a3408 |
@@ -91,7 +90,6 @@ struct daemonConfig {
|
|
|
7a3408 |
|
|
|
7a3408 |
int admin_keepalive_interval;
|
|
|
7a3408 |
unsigned int admin_keepalive_count;
|
|
|
7a3408 |
- int admin_keepalive_required;
|
|
|
7a3408 |
};
|
|
|
7a3408 |
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
|
|
|
7a3408 |
index 654e7f4..2c27970 100644
|
|
|
7a3408 |
--- a/daemon/libvirtd.c
|
|
|
7a3408 |
+++ b/daemon/libvirtd.c
|
|
|
7a3408 |
@@ -1389,7 +1389,6 @@ int main(int argc, char **argv) {
|
|
|
7a3408 |
config->max_anonymous_clients,
|
|
|
7a3408 |
config->keepalive_interval,
|
|
|
7a3408 |
config->keepalive_count,
|
|
|
7a3408 |
- !!config->keepalive_required,
|
|
|
7a3408 |
config->mdns_adv ? config->mdns_name : NULL,
|
|
|
7a3408 |
remoteClientInitHook,
|
|
|
7a3408 |
NULL,
|
|
|
7a3408 |
@@ -1464,7 +1463,6 @@ int main(int argc, char **argv) {
|
|
|
7a3408 |
0,
|
|
|
7a3408 |
config->admin_keepalive_interval,
|
|
|
7a3408 |
config->admin_keepalive_count,
|
|
|
7a3408 |
- !!config->admin_keepalive_required,
|
|
|
7a3408 |
NULL,
|
|
|
7a3408 |
remoteAdmClientInitHook,
|
|
|
7a3408 |
NULL,
|
|
|
7a3408 |
diff --git a/daemon/libvirtd.conf b/daemon/libvirtd.conf
|
|
|
7a3408 |
index ac06cdd..514e6e4 100644
|
|
|
7a3408 |
--- a/daemon/libvirtd.conf
|
|
|
7a3408 |
+++ b/daemon/libvirtd.conf
|
|
|
7a3408 |
@@ -440,14 +440,15 @@
|
|
|
7a3408 |
#
|
|
|
7a3408 |
#keepalive_interval = 5
|
|
|
7a3408 |
#keepalive_count = 5
|
|
|
7a3408 |
+
|
|
|
7a3408 |
#
|
|
|
7a3408 |
-# If set to 1, libvirtd will refuse to talk to clients that do not
|
|
|
7a3408 |
-# support keepalive protocol. Defaults to 0.
|
|
|
7a3408 |
+# These configuration options are no longer used. There is no way to
|
|
|
7a3408 |
+# restrict such clients from connecting since they first need to
|
|
|
7a3408 |
+# connect in order to ask for keepalive.
|
|
|
7a3408 |
#
|
|
|
7a3408 |
#keepalive_required = 1
|
|
|
7a3408 |
+#admin_keepalive_required = 1
|
|
|
7a3408 |
|
|
|
7a3408 |
# Keepalive settings for the admin interface
|
|
|
7a3408 |
#admin_keepalive_interval = 5
|
|
|
7a3408 |
#admin_keepalive_count = 5
|
|
|
7a3408 |
-#
|
|
|
7a3408 |
-#admin_keepalive_required = 1
|
|
|
7a3408 |
diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h
|
|
|
7a3408 |
index 8c1a904..efd4823 100644
|
|
|
7a3408 |
--- a/daemon/libvirtd.h
|
|
|
7a3408 |
+++ b/daemon/libvirtd.h
|
|
|
7a3408 |
@@ -72,7 +72,6 @@ struct daemonClientPrivate {
|
|
|
7a3408 |
virConnectPtr conn;
|
|
|
7a3408 |
|
|
|
7a3408 |
daemonClientStreamPtr streams;
|
|
|
7a3408 |
- bool keepalive_supported;
|
|
|
7a3408 |
};
|
|
|
7a3408 |
|
|
|
7a3408 |
/* Separate private data for admin connection */
|
|
|
7a3408 |
diff --git a/daemon/remote.c b/daemon/remote.c
|
|
|
7a3408 |
index e9e2dca..3a3eb09 100644
|
|
|
7a3408 |
--- a/daemon/remote.c
|
|
|
7a3408 |
+++ b/daemon/remote.c
|
|
|
7a3408 |
@@ -1290,7 +1290,7 @@ void *remoteClientInitHook(virNetServerClientPtr client,
|
|
|
7a3408 |
/*----- Functions. -----*/
|
|
|
7a3408 |
|
|
|
7a3408 |
static int
|
|
|
7a3408 |
-remoteDispatchConnectOpen(virNetServerPtr server,
|
|
|
7a3408 |
+remoteDispatchConnectOpen(virNetServerPtr server ATTRIBUTE_UNUSED,
|
|
|
7a3408 |
virNetServerClientPtr client,
|
|
|
7a3408 |
virNetMessagePtr msg ATTRIBUTE_UNUSED,
|
|
|
7a3408 |
virNetMessageErrorPtr rerr,
|
|
|
7a3408 |
@@ -1309,12 +1309,6 @@ remoteDispatchConnectOpen(virNetServerPtr server,
|
|
|
7a3408 |
goto cleanup;
|
|
|
7a3408 |
}
|
|
|
7a3408 |
|
|
|
7a3408 |
- if (virNetServerKeepAliveRequired(server) && !priv->keepalive_supported) {
|
|
|
7a3408 |
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
|
|
7a3408 |
- _("keepalive support is required to connect"));
|
|
|
7a3408 |
- goto cleanup;
|
|
|
7a3408 |
- }
|
|
|
7a3408 |
-
|
|
|
7a3408 |
name = args->name ? *args->name : NULL;
|
|
|
7a3408 |
|
|
|
7a3408 |
/* If this connection arrived on a readonly socket, force
|
|
|
7a3408 |
diff --git a/daemon/test_libvirtd.aug.in b/daemon/test_libvirtd.aug.in
|
|
|
7a3408 |
index 4921cbf..b0cb7eb 100644
|
|
|
7a3408 |
--- a/daemon/test_libvirtd.aug.in
|
|
|
7a3408 |
+++ b/daemon/test_libvirtd.aug.in
|
|
|
7a3408 |
@@ -58,6 +58,6 @@ module Test_libvirtd =
|
|
|
7a3408 |
{ "keepalive_interval" = "5" }
|
|
|
7a3408 |
{ "keepalive_count" = "5" }
|
|
|
7a3408 |
{ "keepalive_required" = "1" }
|
|
|
7a3408 |
+ { "admin_keepalive_required" = "1" }
|
|
|
7a3408 |
{ "admin_keepalive_interval" = "5" }
|
|
|
7a3408 |
{ "admin_keepalive_count" = "5" }
|
|
|
7a3408 |
- { "admin_keepalive_required" = "1" }
|
|
|
7a3408 |
diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
|
|
|
7a3408 |
index 6bfdcfa..90a453c 100644
|
|
|
7a3408 |
--- a/src/libvirt_remote.syms
|
|
|
7a3408 |
+++ b/src/libvirt_remote.syms
|
|
|
7a3408 |
@@ -101,7 +101,6 @@ virNetServerAddProgram;
|
|
|
7a3408 |
virNetServerAddService;
|
|
|
7a3408 |
virNetServerClose;
|
|
|
7a3408 |
virNetServerHasClients;
|
|
|
7a3408 |
-virNetServerKeepAliveRequired;
|
|
|
7a3408 |
virNetServerNew;
|
|
|
7a3408 |
virNetServerNewPostExecRestart;
|
|
|
7a3408 |
virNetServerPreExecRestart;
|
|
|
7a3408 |
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
|
|
|
7a3408 |
index ecbe03a..c035024 100644
|
|
|
7a3408 |
--- a/src/locking/lock_daemon.c
|
|
|
7a3408 |
+++ b/src/locking/lock_daemon.c
|
|
|
7a3408 |
@@ -151,7 +151,7 @@ virLockDaemonNew(virLockDaemonConfigPtr config, bool privileged)
|
|
|
7a3408 |
|
|
|
7a3408 |
if (!(lockd->srv = virNetServerNew(1, 1, 0, config->max_clients,
|
|
|
7a3408 |
config->max_clients, -1, 0,
|
|
|
7a3408 |
- false, NULL,
|
|
|
7a3408 |
+ NULL,
|
|
|
7a3408 |
virLockDaemonClientNew,
|
|
|
7a3408 |
virLockDaemonClientPreExecRestart,
|
|
|
7a3408 |
virLockDaemonClientFree,
|
|
|
7a3408 |
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
|
|
|
7a3408 |
index 27e2e3a..06ffee4 100644
|
|
|
7a3408 |
--- a/src/lxc/lxc_controller.c
|
|
|
7a3408 |
+++ b/src/lxc/lxc_controller.c
|
|
|
7a3408 |
@@ -910,7 +910,7 @@ static int virLXCControllerSetupServer(virLXCControllerPtr ctrl)
|
|
|
7a3408 |
return -1;
|
|
|
7a3408 |
|
|
|
7a3408 |
if (!(srv = virNetServerNew(0, 0, 0, 1,
|
|
|
7a3408 |
- 0, -1, 0, false,
|
|
|
7a3408 |
+ 0, -1, 0,
|
|
|
7a3408 |
NULL,
|
|
|
7a3408 |
virLXCControllerClientPrivateNew,
|
|
|
7a3408 |
NULL,
|
|
|
7a3408 |
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
|
|
|
7a3408 |
index 60a9714..80b5588 100644
|
|
|
7a3408 |
--- a/src/rpc/virnetserver.c
|
|
|
7a3408 |
+++ b/src/rpc/virnetserver.c
|
|
|
7a3408 |
@@ -69,7 +69,6 @@ struct _virNetServer {
|
|
|
7a3408 |
|
|
|
7a3408 |
int keepaliveInterval;
|
|
|
7a3408 |
unsigned int keepaliveCount;
|
|
|
7a3408 |
- bool keepaliveRequired;
|
|
|
7a3408 |
|
|
|
7a3408 |
#ifdef WITH_GNUTLS
|
|
|
7a3408 |
virNetTLSContextPtr tls;
|
|
|
7a3408 |
@@ -312,7 +311,6 @@ virNetServerPtr virNetServerNew(size_t min_workers,
|
|
|
7a3408 |
size_t max_anonymous_clients,
|
|
|
7a3408 |
int keepaliveInterval,
|
|
|
7a3408 |
unsigned int keepaliveCount,
|
|
|
7a3408 |
- bool keepaliveRequired,
|
|
|
7a3408 |
const char *mdnsGroupName,
|
|
|
7a3408 |
virNetServerClientPrivNew clientPrivNew,
|
|
|
7a3408 |
virNetServerClientPrivPreExecRestart clientPrivPreExecRestart,
|
|
|
7a3408 |
@@ -338,7 +336,6 @@ virNetServerPtr virNetServerNew(size_t min_workers,
|
|
|
7a3408 |
srv->nclients_unauth_max = max_anonymous_clients;
|
|
|
7a3408 |
srv->keepaliveInterval = keepaliveInterval;
|
|
|
7a3408 |
srv->keepaliveCount = keepaliveCount;
|
|
|
7a3408 |
- srv->keepaliveRequired = keepaliveRequired;
|
|
|
7a3408 |
srv->clientPrivNew = clientPrivNew;
|
|
|
7a3408 |
srv->clientPrivPreExecRestart = clientPrivPreExecRestart;
|
|
|
7a3408 |
srv->clientPrivFree = clientPrivFree;
|
|
|
7a3408 |
@@ -380,7 +377,6 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
|
|
|
7a3408 |
unsigned int max_anonymous_clients;
|
|
|
7a3408 |
unsigned int keepaliveInterval;
|
|
|
7a3408 |
unsigned int keepaliveCount;
|
|
|
7a3408 |
- bool keepaliveRequired;
|
|
|
7a3408 |
const char *mdnsGroupName = NULL;
|
|
|
7a3408 |
|
|
|
7a3408 |
if (virJSONValueObjectGetNumberUint(object, "min_workers", &min_workers) < 0) {
|
|
|
7a3408 |
@@ -423,11 +419,6 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
|
|
|
7a3408 |
_("Missing keepaliveCount data in JSON document"));
|
|
|
7a3408 |
goto error;
|
|
|
7a3408 |
}
|
|
|
7a3408 |
- if (virJSONValueObjectGetBoolean(object, "keepaliveRequired", &keepaliveRequired) < 0) {
|
|
|
7a3408 |
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
|
7a3408 |
- _("Missing keepaliveRequired data in JSON document"));
|
|
|
7a3408 |
- goto error;
|
|
|
7a3408 |
- }
|
|
|
7a3408 |
|
|
|
7a3408 |
if (virJSONValueObjectHasKey(object, "mdnsGroupName") &&
|
|
|
7a3408 |
(!(mdnsGroupName = virJSONValueObjectGetString(object, "mdnsGroupName")))) {
|
|
|
7a3408 |
@@ -440,7 +431,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object,
|
|
|
7a3408 |
priority_workers, max_clients,
|
|
|
7a3408 |
max_anonymous_clients,
|
|
|
7a3408 |
keepaliveInterval, keepaliveCount,
|
|
|
7a3408 |
- keepaliveRequired, mdnsGroupName,
|
|
|
7a3408 |
+ mdnsGroupName,
|
|
|
7a3408 |
clientPrivNew, clientPrivPreExecRestart,
|
|
|
7a3408 |
clientPrivFree, clientPrivOpaque)))
|
|
|
7a3408 |
goto error;
|
|
|
7a3408 |
@@ -573,11 +564,6 @@ virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv)
|
|
|
7a3408 |
_("Cannot set keepaliveCount data in JSON document"));
|
|
|
7a3408 |
goto error;
|
|
|
7a3408 |
}
|
|
|
7a3408 |
- if (virJSONValueObjectAppendBoolean(object, "keepaliveRequired", srv->keepaliveRequired) < 0) {
|
|
|
7a3408 |
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
|
7a3408 |
- _("Cannot set keepaliveRequired data in JSON document"));
|
|
|
7a3408 |
- goto error;
|
|
|
7a3408 |
- }
|
|
|
7a3408 |
|
|
|
7a3408 |
if (srv->mdnsGroupName &&
|
|
|
7a3408 |
virJSONValueObjectAppendString(object, "mdnsGroupName", srv->mdnsGroupName) < 0) {
|
|
|
7a3408 |
@@ -786,15 +772,6 @@ void virNetServerClose(virNetServerPtr srv)
|
|
|
7a3408 |
virObjectUnlock(srv);
|
|
|
7a3408 |
}
|
|
|
7a3408 |
|
|
|
7a3408 |
-bool virNetServerKeepAliveRequired(virNetServerPtr srv)
|
|
|
7a3408 |
-{
|
|
|
7a3408 |
- bool required;
|
|
|
7a3408 |
- virObjectLock(srv);
|
|
|
7a3408 |
- required = srv->keepaliveRequired;
|
|
|
7a3408 |
- virObjectUnlock(srv);
|
|
|
7a3408 |
- return required;
|
|
|
7a3408 |
-}
|
|
|
7a3408 |
-
|
|
|
7a3408 |
static inline size_t
|
|
|
7a3408 |
virNetServerTrackPendingAuthLocked(virNetServerPtr srv)
|
|
|
7a3408 |
{
|
|
|
7a3408 |
diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h
|
|
|
7a3408 |
index 0e16e8f..89d8db9 100644
|
|
|
7a3408 |
--- a/src/rpc/virnetserver.h
|
|
|
7a3408 |
+++ b/src/rpc/virnetserver.h
|
|
|
7a3408 |
@@ -41,7 +41,6 @@ virNetServerPtr virNetServerNew(size_t min_workers,
|
|
|
7a3408 |
size_t max_anonymous_clients,
|
|
|
7a3408 |
int keepaliveInterval,
|
|
|
7a3408 |
unsigned int keepaliveCount,
|
|
|
7a3408 |
- bool keepaliveRequired,
|
|
|
7a3408 |
const char *mdnsGroupName,
|
|
|
7a3408 |
virNetServerClientPrivNew clientPrivNew,
|
|
|
7a3408 |
virNetServerClientPrivPreExecRestart clientPrivPreExecRestart,
|
|
|
7a3408 |
@@ -74,8 +73,6 @@ int virNetServerSetTLSContext(virNetServerPtr srv,
|
|
|
7a3408 |
virNetTLSContextPtr tls);
|
|
|
7a3408 |
# endif
|
|
|
7a3408 |
|
|
|
7a3408 |
-bool virNetServerKeepAliveRequired(virNetServerPtr srv);
|
|
|
7a3408 |
-
|
|
|
7a3408 |
size_t virNetServerTrackPendingAuth(virNetServerPtr srv);
|
|
|
7a3408 |
size_t virNetServerTrackCompletedAuth(virNetServerPtr srv);
|
|
|
7a3408 |
|
|
|
7a3408 |
diff --git a/tests/libvirtdconftest.c b/tests/libvirtdconftest.c
|
|
|
7a3408 |
index d589d51..61d861d 100644
|
|
|
7a3408 |
--- a/tests/libvirtdconftest.c
|
|
|
7a3408 |
+++ b/tests/libvirtdconftest.c
|
|
|
7a3408 |
@@ -227,7 +227,9 @@ mymain(void)
|
|
|
7a3408 |
for (i = 0; params[i] != 0; i++) {
|
|
|
7a3408 |
const struct testCorruptData data = { params, filedata, filename, i };
|
|
|
7a3408 |
/* Skip now ignored config param */
|
|
|
7a3408 |
- if (STRPREFIX(filedata + params[i], "log_buffer_size"))
|
|
|
7a3408 |
+ if (STRPREFIX(filedata + params[i], "log_buffer_size") ||
|
|
|
7a3408 |
+ STRPREFIX(filedata + params[i], "keepalive_required") ||
|
|
|
7a3408 |
+ STRPREFIX(filedata + params[i], "admin_keepalive_required"))
|
|
|
7a3408 |
continue;
|
|
|
7a3408 |
if (virtTestRun("Test corruption", testCorrupt, &data) < 0)
|
|
|
7a3408 |
ret = -1;
|
|
|
7a3408 |
diff --git a/tests/virnetdaemondata/input-data-no-keepalive-required.json b/tests/virnetdaemondata/input-data-no-keepalive-required.json
|
|
|
7a3408 |
new file mode 100644
|
|
|
7a3408 |
index 0000000..b5e4dc8
|
|
|
7a3408 |
--- /dev/null
|
|
|
7a3408 |
+++ b/tests/virnetdaemondata/input-data-no-keepalive-required.json
|
|
|
7a3408 |
@@ -0,0 +1,124 @@
|
|
|
7a3408 |
+{
|
|
|
7a3408 |
+ "servers": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "min_workers": 10,
|
|
|
7a3408 |
+ "max_workers": 50,
|
|
|
7a3408 |
+ "priority_workers": 5,
|
|
|
7a3408 |
+ "max_clients": 100,
|
|
|
7a3408 |
+ "keepaliveInterval": 120,
|
|
|
7a3408 |
+ "keepaliveCount": 5,
|
|
|
7a3408 |
+ "services": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 0,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_client_max": 2,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 100,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": false,
|
|
|
7a3408 |
+ "nrequests_client_max": 5,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 101,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ],
|
|
|
7a3408 |
+ "clients": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 1,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 15,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 102,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 66,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 103,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "min_workers": 2,
|
|
|
7a3408 |
+ "max_workers": 50,
|
|
|
7a3408 |
+ "priority_workers": 5,
|
|
|
7a3408 |
+ "max_clients": 100,
|
|
|
7a3408 |
+ "keepaliveInterval": 120,
|
|
|
7a3408 |
+ "keepaliveCount": 5,
|
|
|
7a3408 |
+ "services": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 0,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_client_max": 2,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 100,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": false,
|
|
|
7a3408 |
+ "nrequests_client_max": 5,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 101,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ],
|
|
|
7a3408 |
+ "clients": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 1,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 15,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 102,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 66,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 103,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+}
|
|
|
7a3408 |
diff --git a/tests/virnetdaemondata/output-data-admin-nomdns.json b/tests/virnetdaemondata/output-data-admin-nomdns.json
|
|
|
7a3408 |
index 5df71a0..a814aeb 100644
|
|
|
7a3408 |
--- a/tests/virnetdaemondata/output-data-admin-nomdns.json
|
|
|
7a3408 |
+++ b/tests/virnetdaemondata/output-data-admin-nomdns.json
|
|
|
7a3408 |
@@ -8,7 +8,6 @@
|
|
|
7a3408 |
"max_anonymous_clients": 100,
|
|
|
7a3408 |
"keepaliveInterval": 120,
|
|
|
7a3408 |
"keepaliveCount": 5,
|
|
|
7a3408 |
- "keepaliveRequired": true,
|
|
|
7a3408 |
"services": [
|
|
|
7a3408 |
{
|
|
|
7a3408 |
"auth": 0,
|
|
|
7a3408 |
@@ -70,7 +69,6 @@
|
|
|
7a3408 |
"max_anonymous_clients": 100,
|
|
|
7a3408 |
"keepaliveInterval": 120,
|
|
|
7a3408 |
"keepaliveCount": 5,
|
|
|
7a3408 |
- "keepaliveRequired": true,
|
|
|
7a3408 |
"services": [
|
|
|
7a3408 |
{
|
|
|
7a3408 |
"auth": 0,
|
|
|
7a3408 |
diff --git a/tests/virnetdaemondata/output-data-anon-clients.json b/tests/virnetdaemondata/output-data-anon-clients.json
|
|
|
7a3408 |
index 4e43326..05fc0ae 100644
|
|
|
7a3408 |
--- a/tests/virnetdaemondata/output-data-anon-clients.json
|
|
|
7a3408 |
+++ b/tests/virnetdaemondata/output-data-anon-clients.json
|
|
|
7a3408 |
@@ -8,7 +8,6 @@
|
|
|
7a3408 |
"max_anonymous_clients": 10,
|
|
|
7a3408 |
"keepaliveInterval": 120,
|
|
|
7a3408 |
"keepaliveCount": 5,
|
|
|
7a3408 |
- "keepaliveRequired": true,
|
|
|
7a3408 |
"services": [
|
|
|
7a3408 |
{
|
|
|
7a3408 |
"auth": 0,
|
|
|
7a3408 |
diff --git a/tests/virnetdaemondata/output-data-initial-nomdns.json b/tests/virnetdaemondata/output-data-initial-nomdns.json
|
|
|
7a3408 |
index bef54bf..400e47b 100644
|
|
|
7a3408 |
--- a/tests/virnetdaemondata/output-data-initial-nomdns.json
|
|
|
7a3408 |
+++ b/tests/virnetdaemondata/output-data-initial-nomdns.json
|
|
|
7a3408 |
@@ -8,7 +8,6 @@
|
|
|
7a3408 |
"max_anonymous_clients": 100,
|
|
|
7a3408 |
"keepaliveInterval": 120,
|
|
|
7a3408 |
"keepaliveCount": 5,
|
|
|
7a3408 |
- "keepaliveRequired": true,
|
|
|
7a3408 |
"services": [
|
|
|
7a3408 |
{
|
|
|
7a3408 |
"auth": 0,
|
|
|
7a3408 |
diff --git a/tests/virnetdaemondata/output-data-initial.json b/tests/virnetdaemondata/output-data-initial.json
|
|
|
7a3408 |
index 9afa791..e875cff 100644
|
|
|
7a3408 |
--- a/tests/virnetdaemondata/output-data-initial.json
|
|
|
7a3408 |
+++ b/tests/virnetdaemondata/output-data-initial.json
|
|
|
7a3408 |
@@ -8,7 +8,6 @@
|
|
|
7a3408 |
"max_anonymous_clients": 100,
|
|
|
7a3408 |
"keepaliveInterval": 120,
|
|
|
7a3408 |
"keepaliveCount": 5,
|
|
|
7a3408 |
- "keepaliveRequired": true,
|
|
|
7a3408 |
"mdnsGroupName": "libvirtTest",
|
|
|
7a3408 |
"services": [
|
|
|
7a3408 |
{
|
|
|
7a3408 |
diff --git a/tests/virnetdaemondata/output-data-no-keepalive-required.json b/tests/virnetdaemondata/output-data-no-keepalive-required.json
|
|
|
7a3408 |
new file mode 100644
|
|
|
7a3408 |
index 0000000..b5e4dc8
|
|
|
7a3408 |
--- /dev/null
|
|
|
7a3408 |
+++ b/tests/virnetdaemondata/output-data-no-keepalive-required.json
|
|
|
7a3408 |
@@ -0,0 +1,124 @@
|
|
|
7a3408 |
+{
|
|
|
7a3408 |
+ "servers": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "min_workers": 10,
|
|
|
7a3408 |
+ "max_workers": 50,
|
|
|
7a3408 |
+ "priority_workers": 5,
|
|
|
7a3408 |
+ "max_clients": 100,
|
|
|
7a3408 |
+ "keepaliveInterval": 120,
|
|
|
7a3408 |
+ "keepaliveCount": 5,
|
|
|
7a3408 |
+ "services": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 0,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_client_max": 2,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 100,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": false,
|
|
|
7a3408 |
+ "nrequests_client_max": 5,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 101,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ],
|
|
|
7a3408 |
+ "clients": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 1,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 15,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 102,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 66,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 103,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "min_workers": 2,
|
|
|
7a3408 |
+ "max_workers": 50,
|
|
|
7a3408 |
+ "priority_workers": 5,
|
|
|
7a3408 |
+ "max_clients": 100,
|
|
|
7a3408 |
+ "keepaliveInterval": 120,
|
|
|
7a3408 |
+ "keepaliveCount": 5,
|
|
|
7a3408 |
+ "services": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 0,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_client_max": 2,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 100,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": false,
|
|
|
7a3408 |
+ "nrequests_client_max": 5,
|
|
|
7a3408 |
+ "socks": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "fd": 101,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": 0,
|
|
|
7a3408 |
+ "isClient": false
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ],
|
|
|
7a3408 |
+ "clients": [
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 1,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 15,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 102,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ },
|
|
|
7a3408 |
+ {
|
|
|
7a3408 |
+ "auth": 2,
|
|
|
7a3408 |
+ "readonly": true,
|
|
|
7a3408 |
+ "nrequests_max": 66,
|
|
|
7a3408 |
+ "sock": {
|
|
|
7a3408 |
+ "fd": 103,
|
|
|
7a3408 |
+ "errfd": -1,
|
|
|
7a3408 |
+ "pid": -1,
|
|
|
7a3408 |
+ "isClient": true
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+ }
|
|
|
7a3408 |
+ ]
|
|
|
7a3408 |
+}
|
|
|
7a3408 |
diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
|
|
|
7a3408 |
index ef45018..fb8a6c0 100644
|
|
|
7a3408 |
--- a/tests/virnetdaemontest.c
|
|
|
7a3408 |
+++ b/tests/virnetdaemontest.c
|
|
|
7a3408 |
@@ -50,7 +50,7 @@ testCreateServer(const char *host, int family)
|
|
|
7a3408 |
}
|
|
|
7a3408 |
|
|
|
7a3408 |
if (!(srv = virNetServerNew(10, 50, 5, 100, 10,
|
|
|
7a3408 |
- 120, 5, true,
|
|
|
7a3408 |
+ 120, 5,
|
|
|
7a3408 |
mdns_group,
|
|
|
7a3408 |
NULL,
|
|
|
7a3408 |
NULL,
|
|
|
7a3408 |
--
|
|
|
7a3408 |
2.5.0
|
|
|
7a3408 |
|