[libvirt PATCH 3/6] rpc: Introduce virNetServerHasGranularPolkit()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It's always set to false for now.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/libvirt_remote.syms    |  1 +
 src/locking/lock_daemon.c  |  6 ++++--
 src/logging/log_daemon.c   |  6 ++++--
 src/lxc/lxc_controller.c   |  3 ++-
 src/remote/remote_daemon.c |  6 ++++--
 src/rpc/virnetserver.c     | 16 ++++++++++++++--
 src/rpc/virnetserver.h     |  4 +++-
 tests/virnetdaemontest.c   |  3 ++-
 8 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/src/libvirt_remote.syms b/src/libvirt_remote.syms
index f0f90815cf..16a8adcdcc 100644
--- a/src/libvirt_remote.syms
+++ b/src/libvirt_remote.syms
@@ -136,6 +136,7 @@ virNetServerGetMaxUnauthClients;
 virNetServerGetName;
 virNetServerGetThreadPoolParameters;
 virNetServerHasClients;
+virNetServerHasGranularPolkit;
 virNetServerNeedsAuth;
 virNetServerNew;
 virNetServerNewPostExecRestart;
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index ba52ce7d77..ac44c80927 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -129,7 +129,8 @@ virLockDaemonNew(virLockDaemonConfig *config, bool privileged)
                                 virLockDaemonClientNew,
                                 virLockDaemonClientPreExecRestart,
                                 virLockDaemonClientFree,
-                                (void*)(intptr_t)(privileged ? 0x1 : 0x0))))
+                                (void*)(intptr_t)(privileged ? 0x1 : 0x0),
+                                false)))
         goto error;
 
     if (virNetDaemonAddServer(lockd->dmn, srv) < 0)
@@ -142,7 +143,8 @@ virLockDaemonNew(virLockDaemonConfig *config, bool privileged)
                                 remoteAdmClientNew,
                                 remoteAdmClientPreExecRestart,
                                 remoteAdmClientFree,
-                                lockd->dmn)))
+                                lockd->dmn,
+                                false)))
         goto error;
 
     if (virNetDaemonAddServer(lockd->dmn, srv) < 0)
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index daf7ef4b2f..752f4bd7b6 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -124,7 +124,8 @@ virLogDaemonNew(virLogDaemonConfig *config, bool privileged)
                                 virLogDaemonClientNew,
                                 virLogDaemonClientPreExecRestart,
                                 virLogDaemonClientFree,
-                                (void*)(intptr_t)(privileged ? 0x1 : 0x0))))
+                                (void*)(intptr_t)(privileged ? 0x1 : 0x0),
+                                false)))
         goto error;
 
     if (virNetDaemonAddServer(logd->dmn, srv) < 0)
@@ -137,7 +138,8 @@ virLogDaemonNew(virLogDaemonConfig *config, bool privileged)
                                 remoteAdmClientNew,
                                 remoteAdmClientPreExecRestart,
                                 remoteAdmClientFree,
-                                logd->dmn)))
+                                logd->dmn,
+                                false)))
         goto error;
 
     if (virNetDaemonAddServer(logd->dmn, srv) < 0)
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 48f5c73fce..54409d6961 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -928,7 +928,8 @@ static int virLXCControllerSetupServer(virLXCController *ctrl)
                                 virLXCControllerClientPrivateNew,
                                 NULL,
                                 virLXCControllerClientPrivateFree,
-                                ctrl)))
+                                ctrl,
+                                false)))
         goto error;
 
     if (virSecurityManagerSetSocketLabel(ctrl->securityManager, ctrl->def) < 0)
diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
index 657c053f6f..59170373cb 100644
--- a/src/remote/remote_daemon.c
+++ b/src/remote/remote_daemon.c
@@ -1035,7 +1035,8 @@ int main(int argc, char **argv) {
                                 remoteClientNew,
                                 NULL,
                                 remoteClientFree,
-                                NULL))) {
+                                NULL,
+                                false))) {
         ret = VIR_DAEMON_ERR_INIT;
         goto cleanup;
     }
@@ -1102,7 +1103,8 @@ int main(int argc, char **argv) {
                                    remoteAdmClientNew,
                                    NULL,
                                    remoteAdmClientFree,
-                                   dmn))) {
+                                   dmn,
+                                   false))) {
         ret = VIR_DAEMON_ERR_INIT;
         goto cleanup;
     }
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 770476c1a6..d8c91172d0 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -71,6 +71,8 @@ struct _virNetServer {
     virNetServerClientPrivPreExecRestart clientPrivPreExecRestart;
     virFreeCallback clientPrivFree;
     void *clientPrivOpaque;
+
+    bool granularPolkit;
 };
 
 
@@ -365,7 +367,8 @@ virNetServerNew(const char *name,
                 virNetServerClientPrivNew clientPrivNew,
                 virNetServerClientPrivPreExecRestart clientPrivPreExecRestart,
                 virFreeCallback clientPrivFree,
-                void *clientPrivOpaque)
+                void *clientPrivOpaque,
+                bool granularPolkit)
 {
     g_autoptr(virNetServer) srv = NULL;
     g_autofree char *jobName = g_strdup_printf("rpc-%s", name);
@@ -402,6 +405,8 @@ virNetServerNew(const char *name,
     srv->clientPrivFree = clientPrivFree;
     srv->clientPrivOpaque = clientPrivOpaque;
 
+    srv->granularPolkit = granularPolkit;
+
     return g_steal_pointer(&srv);
 }
 
@@ -486,7 +491,7 @@ virNetServerNewPostExecRestart(virJSONValue *object,
                                 max_anonymous_clients,
                                 keepaliveInterval, keepaliveCount,
                                 clientPrivNew, clientPrivPreExecRestart,
-                                clientPrivFree, clientPrivOpaque)))
+                                clientPrivFree, clientPrivOpaque, false)))
         return NULL;
 
     if (!(services = virJSONValueObjectGet(object, "services"))) {
@@ -988,6 +993,13 @@ virNetServerGetName(virNetServer *srv)
 }
 
 
+bool
+virNetServerHasGranularPolkit(virNetServer *srv)
+{
+    return srv->granularPolkit;
+}
+
+
 int
 virNetServerGetThreadPoolParameters(virNetServer *srv,
                                     size_t *minWorkers,
diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h
index 9f0cf3a3fc..efdfab03b8 100644
--- a/src/rpc/virnetserver.h
+++ b/src/rpc/virnetserver.h
@@ -41,7 +41,8 @@ virNetServer *virNetServerNew(const char *name,
                                 virNetServerClientPrivNew clientPrivNew,
                                 virNetServerClientPrivPreExecRestart clientPrivPreExecRestart,
                                 virFreeCallback clientPrivFree,
-                                void *clientPrivOpaque)
+                                void *clientPrivOpaque,
+                                bool granularPolkit)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(10) ATTRIBUTE_NONNULL(12);
 
 virNetServer *virNetServerNewPostExecRestart(virJSONValue *object,
@@ -100,6 +101,7 @@ void virNetServerSetClientAuthenticated(virNetServer *srv, virNetServerClient *c
 void virNetServerUpdateServices(virNetServer *srv, bool enabled);
 
 const char *virNetServerGetName(virNetServer *srv);
+bool virNetServerHasGranularPolkit(virNetServer *srv);
 
 int virNetServerGetThreadPoolParameters(virNetServer *srv,
                                         size_t *minWorkers,
diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c
index 110ec748f8..a52f427d89 100644
--- a/tests/virnetdaemontest.c
+++ b/tests/virnetdaemontest.c
@@ -104,7 +104,8 @@ testCreateServer(const char *server_name, const char *host, int family)
                                 testClientNew,
                                 testClientPreExec,
                                 testClientFree,
-                                NULL)))
+                                NULL,
+                                false)))
         goto error;
 
     if (!(svc1 = virNetServerServiceNewTCP(host,
-- 
2.42.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux