const char *filters,
unsigned int flags);
+int virAdmConnectSetDaemonTimeout(virAdmConnectPtr conn,
+ unsigned int timeout,
+ unsigned int flags);
+
# ifdef __cplusplus
}
# endif
unsigned int flags;
};
+struct admin_connect_set_daemon_timeout_args {
+ unsigned int timeout;
+ unsigned int flags;
+};
+
/* Define the program number, protocol version and procedure numbers here. */
const ADMIN_PROGRAM = 0x06900690;
const ADMIN_PROTOCOL_VERSION = 1;
/**
* @generate: both
*/
- ADMIN_PROC_SERVER_UPDATE_TLS_FILES = 18
+ ADMIN_PROC_SERVER_UPDATE_TLS_FILES = 18,
+
+ /**
+ * @generate: both
+ */
+ ADMIN_PROC_CONNECT_SET_DAEMON_TIMEOUT = 19
};
return virLogSetFilters(filters);
}
+
+static int
+adminConnectSetDaemonTimeout(virNetDaemon *dmn,
+ unsigned int timeout,
+ unsigned int flags)
+{
+ virCheckFlags(0, -1);
+
+ return virNetDaemonAutoShutdown(dmn, timeout);
+}
+
+
static int
adminDispatchConnectGetLoggingOutputs(virNetServer *server G_GNUC_UNUSED,
virNetServerClient *client G_GNUC_UNUSED,
virDispatchError(NULL);
return -1;
}
+
+
+/**
+ * virAdmConnectSetDaemonTimeout:
+ * @conn: pointer to an active admin connection
+ * @timeout: timeout to set in seconds (0 disables timeout)
+ * @flags: extra flags; not used yet, so callers should always pass 0
+ *
+ * Reconfigure the existing timeout of the daemon to @timeout. Setting timeout
+ * to 0 disables the daemon timeout.
+ *
+ * Returns 0 on success, -1 on error.
+ *
+ * Since: 8.6.0
+ */
+int
+virAdmConnectSetDaemonTimeout(virAdmConnectPtr conn,
+ unsigned int timeout,
+ unsigned int flags)
+{
+ int ret;
+
+ VIR_DEBUG("conn=%p, timeout=%u, flags=0x%x", conn, timeout, flags);
+
+ virResetLastError();
+ virCheckAdmConnectReturn(conn, -1);
+
+ if ((ret = remoteAdminConnectSetDaemonTimeout(conn, timeout, flags)) < 0) {
+ virDispatchError(NULL);
+ return -1;
+ }
+
+ return ret;
+}
virAdmConnectSetLoggingOutputs;
virAdmConnectSetLoggingFilters;
} LIBVIRT_ADMIN_2.0.0;
+
+LIBVIRT_ADMIN_8.6.0 {
+ global:
+ virAdmConnectSetDaemonTimeout;
+} LIBVIRT_ADMIN_3.0.0;
admin_string filters;
u_int flags;
};
+struct admin_connect_set_daemon_timeout_args {
+ u_int timeout;
+ u_int flags;
+};
enum admin_procedure {
ADMIN_PROC_CONNECT_OPEN = 1,
ADMIN_PROC_CONNECT_CLOSE = 2,
ADMIN_PROC_CONNECT_SET_LOGGING_OUTPUTS = 16,
ADMIN_PROC_CONNECT_SET_LOGGING_FILTERS = 17,
ADMIN_PROC_SERVER_UPDATE_TLS_FILES = 18,
+ ADMIN_PROC_CONNECT_SET_DAEMON_TIMEOUT = 19,
};