2015-08-14 07:17:01 +00:00
|
|
|
/*
|
|
|
|
* admin_server.h: admin methods to manage daemons and clients
|
|
|
|
*
|
|
|
|
* Copyright (C) 2016 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Authors: Erik Skultety <eskultet@redhat.com>
|
|
|
|
* Martin Kletzander <mkletzan@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LIBVIRTD_ADMIN_SERVER_H__
|
|
|
|
# define __LIBVIRTD_ADMIN_SERVER_H__
|
|
|
|
|
|
|
|
# include "rpc/virnetdaemon.h"
|
2016-03-01 16:33:37 +00:00
|
|
|
# include "rpc/virnetserver.h"
|
2015-08-14 07:17:01 +00:00
|
|
|
|
2016-03-02 14:32:55 +00:00
|
|
|
int adminConnectListServers(virNetDaemonPtr dmn,
|
|
|
|
virNetServerPtr **servers,
|
|
|
|
unsigned int flags);
|
2015-08-14 07:17:01 +00:00
|
|
|
|
2016-03-01 16:33:37 +00:00
|
|
|
virNetServerPtr adminConnectLookupServer(virNetDaemonPtr dmn,
|
|
|
|
const char *name,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2015-11-23 11:41:32 +00:00
|
|
|
int
|
|
|
|
adminServerGetThreadPoolParameters(virNetServerPtr srv,
|
|
|
|
virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
admin: Introduce virAdmServerSetThreadPoolParameters
Since threadpool increments the current number of threads according to current
load, i.e. how many jobs are waiting in the queue. The count however, is
constrained by max and min limits of workers. The logic of this new API works
like this:
1) setting the minimum
a) When the limit is increased, depending on the current number of
threads, new threads are possibly spawned if the current number of
threads is less than the new minimum limit
b) Decreasing the minimum limit has no possible effect on the current
number of threads
2) setting the maximum
a) Icreasing the maximum limit has no immediate effect on the current
number of threads, it only allows the threadpool to spawn more
threads when new jobs, that would otherwise end up queued, arrive.
b) Decreasing the maximum limit may affect the current number of
threads, if the current number of threads is less than the new
maximum limit. Since there may be some ongoing time-consuming jobs
that would effectively block this API from killing any threads.
Therefore, this API is asynchronous with best-effort execution,
i.e. the necessary number of workers will be terminated once they
finish their previous job, unless other workers had already
terminated, decreasing the limit to the requested value.
3) setting priority workers
- both increase and decrease in count of these workers have an
immediate impact on the current number of workers, new ones will be
spawned or some of them get terminated respectively.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2016-02-22 13:24:04 +00:00
|
|
|
int
|
|
|
|
adminServerSetThreadPoolParameters(virNetServerPtr srv,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
unsigned int flags);
|
2015-11-23 11:41:32 +00:00
|
|
|
|
2016-04-14 22:20:11 +00:00
|
|
|
int adminServerListClients(virNetServerPtr srv,
|
|
|
|
virNetServerClientPtr **clients,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2016-04-22 07:47:09 +00:00
|
|
|
virNetServerClientPtr adminServerLookupClient(virNetServerPtr srv,
|
|
|
|
unsigned long long id,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2016-04-22 11:05:42 +00:00
|
|
|
int adminClientGetInfo(virNetServerClientPtr client,
|
|
|
|
virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2016-04-28 08:26:25 +00:00
|
|
|
int adminClientClose(virNetServerClientPtr client,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2016-04-04 08:28:22 +00:00
|
|
|
int adminServerGetClientLimits(virNetServerPtr srv,
|
|
|
|
virTypedParameterPtr *params,
|
|
|
|
int *nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2016-04-04 12:24:52 +00:00
|
|
|
int adminServerSetClientLimits(virNetServerPtr srv,
|
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2015-08-14 07:17:01 +00:00
|
|
|
#endif /* __LIBVIRTD_ADMIN_SERVER_H__ */
|