mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-17 18:15:17 +00:00
server rpc: Remove APIs for manipulating filters on locked client
We don't need to add or remove filters when client object is already locked anymore. There's no reason to keep the *Locked variants of those APIs. (cherry picked from commit d9ad41669828e33623ba8177f260b9f313c1963d)
This commit is contained in:
parent
6180670cd2
commit
f8e651117f
@ -218,20 +218,21 @@ static void virNetServerClientUpdateEvent(virNetServerClientPtr client)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virNetServerClientAddFilterLocked(virNetServerClientPtr client,
|
||||
virNetServerClientFilterFunc func,
|
||||
void *opaque)
|
||||
int virNetServerClientAddFilter(virNetServerClientPtr client,
|
||||
virNetServerClientFilterFunc func,
|
||||
void *opaque)
|
||||
{
|
||||
virNetServerClientFilterPtr filter;
|
||||
virNetServerClientFilterPtr *place;
|
||||
int ret = -1;
|
||||
int ret;
|
||||
|
||||
if (VIR_ALLOC(filter) < 0) {
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
return -1;
|
||||
}
|
||||
|
||||
virNetServerClientLock(client);
|
||||
|
||||
filter->id = client->nextFilterID++;
|
||||
filter->func = func;
|
||||
filter->opaque = opaque;
|
||||
@ -243,28 +244,18 @@ virNetServerClientAddFilterLocked(virNetServerClientPtr client,
|
||||
|
||||
ret = filter->id;
|
||||
|
||||
cleanup:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int virNetServerClientAddFilter(virNetServerClientPtr client,
|
||||
virNetServerClientFilterFunc func,
|
||||
void *opaque)
|
||||
{
|
||||
int ret;
|
||||
|
||||
virNetServerClientLock(client);
|
||||
ret = virNetServerClientAddFilterLocked(client, func, opaque);
|
||||
virNetServerClientUnlock(client);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
virNetServerClientRemoveFilterLocked(virNetServerClientPtr client,
|
||||
int filterID)
|
||||
void virNetServerClientRemoveFilter(virNetServerClientPtr client,
|
||||
int filterID)
|
||||
{
|
||||
virNetServerClientFilterPtr tmp, prev;
|
||||
|
||||
virNetServerClientLock(client);
|
||||
|
||||
prev = NULL;
|
||||
tmp = client->filters;
|
||||
while (tmp) {
|
||||
@ -280,13 +271,7 @@ virNetServerClientRemoveFilterLocked(virNetServerClientPtr client,
|
||||
prev = tmp;
|
||||
tmp = tmp->next;
|
||||
}
|
||||
}
|
||||
|
||||
void virNetServerClientRemoveFilter(virNetServerClientPtr client,
|
||||
int filterID)
|
||||
{
|
||||
virNetServerClientLock(client);
|
||||
virNetServerClientRemoveFilterLocked(client, filterID);
|
||||
virNetServerClientUnlock(client);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user