[libvirt] [PATCH REPOST 2/5] admin: Introduce some public constants related to client processing controls

Erik Skultety eskultet at redhat.com
Wed May 11 13:35:09 UTC 2016


On 11/05/16 14:35, Michal Privoznik wrote:
> On 11.05.2016 12:20, Erik Skultety wrote:
>> In order for typed params validation to pass on daemon side, we should
>> encourage users to use our exported constants with typed params to diminish
>> to avoid any potential problems related to argument validity.
>>
>> Signed-off-by: Erik Skultety <eskultet at redhat.com>
>> ---
>>  include/libvirt/libvirt-admin.h | 42 +++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 42 insertions(+)
>>
>> diff --git a/include/libvirt/libvirt-admin.h b/include/libvirt/libvirt-admin.h
>> index 4e6074e..245313e 100644
>> --- a/include/libvirt/libvirt-admin.h
>> +++ b/include/libvirt/libvirt-admin.h
>> @@ -351,6 +351,48 @@ int virAdmClientGetInfo(virAdmClientPtr client,
>>  
>>  int virAdmClientClose(virAdmClientPtr client, unsigned int flags);
>>  
>> +/* Manage per-server client processing controls */
>> +
>> +/**
>> + * VIR_SERVER_CLIENTS_MAX:
>> + * Macro for per-server nclients_max limit: represents the upper limit to
>> + * number of clients connected to the server, as uint.
>> + */
>> +
>> +# define VIR_SERVER_CLIENTS_MAX "nclients_max"
>> +
>> +/**
>> + * VIR_SERVER_CLIENTS_CURRENT:
>> + * Macro for per-server nclients attribute: represents the current number of
>> + * clients connected to the server, as VIR_TYPED_PARAM_UINT.
>> + *
>> + * NOTE: This attribute is read-only and any attempt to set it will be denied
>> + * by daemon
>> + */
>> +
>> +# define VIR_SERVER_CLIENTS_CURRENT "nclients"
>> +
>> +/**
>> + * VIR_SERVER_CLIENTS_UNAUTH_MAX:
>> + * Macro for per-server nclients_unauth_max limit: represents the upper limit
>> + * to number of clients connected to the server, but not authenticated yet,
>> + * as VIR_TYPED_PARAM_UINT.
>> + */
>> +
>> +# define VIR_SERVER_CLIENTS_UNAUTH_MAX "nclients_unauth_max"
>> +
>> +/**
>> + * VIR_SERVER_CLIENTS_UNAUTH_CURRENT:
>> + * Macro for per-server nclients_unauth attribute: represents the current
>> + * number of clients connected to the server, but not authenticated yet,
>> + * as VIR_TYPED_PARAM_UINT.
>> + *
>> + * NOTE: This attribute is read-only and any attempt to set it will be denied
>> + * by daemon
>> + */
>> +
>> +# define VIR_SERVER_CLIENTS_UNAUTH_CURRENT "nclients_unauth"
>> +
> 
> I wonder whether we should expose other two knobs max_queued_clients and
> max_client_requests. While those are currently not part of virNetServer
> rather than virNetServerService, there's no model of service now. The
> way we have it documented now suggests those are part of server.
> 
>>  # ifdef __cplusplus
>>  }
>>  # endif
>>
> 
> Michal
> 

Well, I can also imagine a per-client setting regarding the maximum
number of requests it can make. I think we can wait till there's need
for that and enable both the per-client max number of requests and
per-server max number of requests for all clients connected to that
server. About the max number of queued clients, well, since this can
only be set during startup when the socket is created and cannot be
changed thereafter without destroying the socket and creating another
one instead, I don't see much usage in polling for that attribute, since
it's going to have the same value as the config says.

Erik




More information about the libvir-list mailing list