summaryrefslogtreecommitdiff
path: root/src/admin_protocol-structs
Commit message (Collapse)AuthorAgeFilesLines
* admin: Introduce virAdmConnectSetDaemonTimeoutPeter Krempa2022-07-071-0/+5
| | | | | | | | | | | | | | Use of the admin APIs to modify logging temporarily has a rather serious deficiency when the daemon whose config is being changed is using auto-shutdown (default with socket-activated deployments) as the configuration is discarded if there is no client or VM/other object blocking auto shutdown. This API allows users to disable/postpone shutdown timeout so that the configuration doesn't change under their hands. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
* admin: Introduce virAdmServerUpdateTlsFilesZhang Bo2020-03-131-0/+5
| | | | | | | | | | | The server needs to use CA certificate, CRL, server certificate/key to complete the TLS handshake. If these files change, we needed to restart libvirtd for them to take effect. This API can update the TLS context *ONLINE* without restarting libvirtd. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com> Signed-off-by: Wu Qingliang <wuqingliang4@huawei.com>
* remote: don't pull anonymous enums into rpc protocol structsDaniel P. Berrangé2019-10-011-9/+0
| | | | | | | | | | The VIR_TYPED_PARAM_* enum fields are defined in libvirt-common.h, not in the remote protcol, so shouldn't be part of the protocol structs output check. This avoids similar problems hitting when we add use of glib, which has other such anonymous enums. Reviewed-by: Pavel Hrdina <phrdina@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
* admin: Introduce virAdmConnectSetLoggingFiltersErik Skultety2016-12-151-0/+5
| | | | | | Enable libvirt users to modify logging filters of a daemon from outside. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmConnectSetLoggingOutputsErik Skultety2016-12-151-0/+5
| | | | | | | | | Enable libvirt users to modify daemon's logging output settings from outside. If either an empty string or NULL is passed, a default logging output will be used the same way as it would be in case writing an empty string to the libvirtd.conf Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmConnectGetLoggingFiltersErik Skultety2016-12-151-0/+8
| | | | | | Enable libvirt users to query logging filter settings. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmConnectGetLoggingOutputsErik Skultety2016-12-151-0/+8
| | | | | | Enable libvirt users to query logging output settings. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmServerSetClientLimitsErik Skultety2016-05-191-0/+9
| | | | | | | | | | | | | | | | Opposite operation to virAdmServerGetClientLimits. Understandably though, setting values for current number of clients connected or still waiting for authentication does not make sense, since changes to these values are event dependent, i.e. a client connects - counter is increased. Thus only the limits to maximum clients connected and waiting for authentication can be set. Should a request for other controls to be set arrive (provided such a setting will be first introduced to the config), the set of configuration controls can be later expanded (thanks to typed params). This patch also introduces a constraint that the maximum number of clients waiting for authentication has to be less than the overall maximum number of clients connected and any attempt to violate this constraint will be denied. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmServerGetClientLimitsErik Skultety2016-05-191-0/+11
| | | | | | | | | | | | | Enable retrieval of the number of maximum clients connected to all sockets combined, as well as the number of maximum clients waiting for authentication, in order to be successfully connected. These are the attributes configurable through libvirtd.conf, however, it could be handy to not only know values for these limits, but also the values for the current number of clients connected and number of clients currently waiting for authentication which are changing dynamically. This API does both, retrieves the limits as well as the current dynamic values. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmClientClose APIErik Skultety2016-05-101-0/+5
| | | | | | | | | | Once we're able to list and identify all clients connected to a specific server, we can then support force-closing a connection. This patch introduces a simple API calling virNetServerClientClose on a specific client, which can be later extended easily, e.g. by sending an event once the client is disconnected successfully. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmClientGetInfo APIErik Skultety2016-05-031-0/+11
| | | | | | | | | | | | | Expose a public API to retrieve some identity and connection information about a client connected to the specified server on daemon. The identity info retrieved is mostly connection transport dependent, i.e. there won't be any socket address returned for a local (UNIX socket) connection, while on the other hand, when connected through TLS or unencrypted TCP, obviously no UNIX process identification will be present in the returned data. All supported values that can be returned in typed params are exposed and documented in include/libvirt/libvirt-admin.h Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmServerLookupClientErik Skultety2016-05-031-0/+9
| | | | | | | | | Just like with server-related APIs, before any of client-based APIs can be called, a reference to a client-side client object needs to be obtained. For this purpose, a lookup method should exist. Apart from the client retrieval logic, a new error code for non-existent client had to be added as well. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce listing clientsErik Skultety2016-05-031-0/+13
| | | | | | | Finally add public method to retrieve the list of currently connected clients to a given server. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmClient client-side objectErik Skultety2016-05-021-0/+6
| | | | | | | | | | | Besides ID, the object also stores static data like connection transport and connection timestamp, since once obtained a list of all clients connected to a server, from user's perspective, it would be nice to know whether a given client is remote or local only and when did it connect to the daemon. Along with the object introduction, all necessary client-side methods necessary to work with the object are added as well. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Introduce virAdmServerSetThreadPoolParametersErik Skultety2016-04-181-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* admin: Introduce virAdmServerGethreadPoolParametersErik Skultety2016-04-181-0/+11
| | | | | | | | New API to retrieve current server workerpool specs. Since it uses typed parameters, more specs to retrieve can be further included in the pool of supported ones. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Enable usage of typed parametersErik Skultety2016-04-181-0/+25
| | | | | | Make all relevant changes to admin protocol, in order to achieve $(subj) Signed-off-by: Erik Skultety <eskultet@redhat.com>
* admin: Add virAdmConnectLookupServerMartin Kletzander2016-03-171-0/+8
| | | | | | | | It does not have a suffix ByName because there are no other means of looking up the server and since the name is known, this should be the preferred one. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* admin: Introduce adminDaemonConnectListServers APIErik Skultety2016-02-171-0/+12
| | | | | | | | | | | This API is merely a convenience API, i.e. when managing clients connected to daemon's servers, we should know (convenience) which server the specific client is connected to. This implies a client-side representation of a server along with a basic API to let the administrating client know what servers are actually available on the daemon. Signed-off-by: Erik Skultety <eskultet@redhat.com> Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* admin: Introduce virAdmServer structureErik Skultety2016-02-171-0/+3
| | | | | | | | | | This is the key structure of all management operations performed on the daemon/clients. An admin client needs to be able to identify another client (either admin or non-privileged client) to perform an action on it. This identification includes a server the client is connected to, thus a client-side representation of a server is needed. Signed-off-by: Erik Skultety <eskultet@redhat.com>
* Revert "admin: Rename virAdmConnect to virAdmDaemon"Erik Skultety2015-12-211-5/+5
| | | | | | | | | | | | | | | | | | | Commmit df8192aa introduced admin related rename and some minor (caused by automated approach, aka sed) and some more severe isues along with it. First reason to revert is the inconsistency with libvirt library. Although we deal with the daemon directly rather than with a specific hypervisor, we still do have a connection. That being said, contributors might get under the impression that AdmDaemonNew would spawn/start a new daemon (since it's admin API, why not...), or AdmDaemonClose would do the exact opposite or they might expect DaemonIsAlive report overall status of the daemon which definitely isn't the case. The second reason to revert this patch is renaming virt-admin client. The client tool does not necessarily have to reflect the names of the API's it's using in his internals. An example would be 's/vshAdmConnect/vshAdmDaemon' where noone can be certain of what the latter function really does. The former is quite expressive about some connection magic it performs, but the latter does not say anything, especially when vshAdmReconnect and vshAdmDisconnect were left untouched.
* admin: Rename virAdmConnect to virAdmDaemonMartin Kletzander2015-12-011-5/+5
| | | | | | | | | | | | | | | | | | | | | virAdmConnect was named after virConnect, but after some discussions, most of the APIs called will be working with remote daemon and starting them virAdmDaemon will make more sense. Only possibly controversal name is CloseCallback (de)registration, and connecting to the daemon (which will still be Open/Close), but even this makes sense if one thinks about the daemon being opened and closed, e.g. as file, etc. This way all the APIs working with the daemon will start with virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter and that will better suit with other namings as well (virDomain*, virAdmServer*, etc.). Because in virt-admin, the connection name does not refer to a struct that would have a connect in its name, also adjust 'connname' in clients. And because it is not used anywhere in the vsh code, move it from there into each client. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* admin: Introduce virAdmConnectGetLibVersionErik Skultety2015-11-301-0/+4
| | | | | | | | Introduce a new API to get libvirt version. It is worth noting, that libvirt-admin and libvirt share the same version number. Unfortunately, our existing API isn't generic enough to be used with virAdmConnectPtr as well. Also this patch wires up this API to the virt-admin client as a generic cmdVersion command.
* Revert "admin: Add virAdmHello function"Martin Kletzander2015-06-161-7/+0
| | | | | | This reverts commit 5792fabb7b712749147e9d03348c798dc1943651. I mistakenly pushed it along with the Admin API series.
* admin: Add virAdmHello functionMartin Kletzander2015-06-161-0/+7
| | | | | | | | | | | | | | | | | | | Just one of the simplest functions that returns string "Clients: X" where X is the number of connected clients to daemon's first subserver (the original one), so it can be tested using virsh, ipython, etc. The subserver is gathered by incrementing its reference counter (similarly to getting qemu capabilities), so there is no deadlock with admin subserver in this API. Here you can see how functions should be named in the client (virAdm*) and server (adm*). There is also a parameter @flags that must be 0, which helps testing proper error propagation into the client. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
* Add admin protocolMartin Kletzander2015-06-161-0/+8
For now there are only CONNECT_OPEN and CONNECT_CLOSE procedures. Signed-off-by: Martin Kletzander <mkletzan@redhat.com>