mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
rpc: virnetserver: virNetServerAddService() to void
virNetServerAddService() return value is invariant, so change it type and remove all dependent checks. Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
46c9458654
commit
bce48d99a7
@ -947,8 +947,7 @@ static int virLXCControllerSetupServer(virLXCController *ctrl)
|
|||||||
if (virSecurityManagerClearSocketLabel(ctrl->securityManager, ctrl->def) < 0)
|
if (virSecurityManagerClearSocketLabel(ctrl->securityManager, ctrl->def) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virNetServerAddService(srv, svc) < 0)
|
virNetServerAddService(srv, svc);
|
||||||
goto error;
|
|
||||||
g_clear_pointer(&svc, virObjectUnref);
|
g_clear_pointer(&svc, virObjectUnref);
|
||||||
|
|
||||||
if (!(ctrl->prog = virNetServerProgramNew(VIR_LXC_MONITOR_PROGRAM,
|
if (!(ctrl->prog = virNetServerProgramNew(VIR_LXC_MONITOR_PROGRAM,
|
||||||
|
@ -513,10 +513,7 @@ virNetServerNewPostExecRestart(virJSONValue *object,
|
|||||||
if (!(service = virNetServerServiceNewPostExecRestart(child)))
|
if (!(service = virNetServerServiceNewPostExecRestart(child)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (virNetServerAddService(srv, service) < 0) {
|
virNetServerAddService(srv, service);
|
||||||
virObjectUnref(service);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -623,7 +620,7 @@ virNetServerPreExecRestart(virNetServer *srv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
void
|
||||||
virNetServerAddService(virNetServer *srv,
|
virNetServerAddService(virNetServer *srv,
|
||||||
virNetServerService *svc)
|
virNetServerService *svc)
|
||||||
{
|
{
|
||||||
@ -633,7 +630,6 @@ virNetServerAddService(virNetServer *srv,
|
|||||||
srv->services[srv->nservices-1] = virObjectRef(svc);
|
srv->services[srv->nservices-1] = virObjectRef(svc);
|
||||||
|
|
||||||
virNetServerServiceSetDispatcher(svc, virNetServerDispatchNewClient, srv);
|
virNetServerServiceSetDispatcher(svc, virNetServerDispatchNewClient, srv);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -669,10 +665,7 @@ virNetServerAddServiceActivation(virNetServer *srv,
|
|||||||
if (!svc)
|
if (!svc)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virNetServerAddService(srv, svc) < 0) {
|
virNetServerAddService(srv, svc);
|
||||||
virObjectUnref(svc);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Intentionally return 1 any time activation is present,
|
/* Intentionally return 1 any time activation is present,
|
||||||
@ -723,11 +716,7 @@ virNetServerAddServiceTCP(virNetServer *srv,
|
|||||||
nrequests_client_max)))
|
nrequests_client_max)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virNetServerAddService(srv, svc) < 0) {
|
virNetServerAddService(srv, svc);
|
||||||
virObjectUnref(svc);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virObjectUnref(svc);
|
virObjectUnref(svc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -772,11 +761,7 @@ virNetServerAddServiceUNIX(virNetServer *srv,
|
|||||||
nrequests_client_max)))
|
nrequests_client_max)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virNetServerAddService(srv, svc) < 0) {
|
virNetServerAddService(srv, svc);
|
||||||
virObjectUnref(svc);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virObjectUnref(svc);
|
virObjectUnref(svc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -59,8 +59,8 @@ void virNetServerShutdownWait(virNetServer *srv);
|
|||||||
|
|
||||||
virJSONValue *virNetServerPreExecRestart(virNetServer *srv);
|
virJSONValue *virNetServerPreExecRestart(virNetServer *srv);
|
||||||
|
|
||||||
int virNetServerAddService(virNetServer *srv,
|
void virNetServerAddService(virNetServer *srv,
|
||||||
virNetServerService *svc);
|
virNetServerService *svc);
|
||||||
int virNetServerAddServiceTCP(virNetServer *srv,
|
int virNetServerAddServiceTCP(virNetServer *srv,
|
||||||
virSystemdActivation *act,
|
virSystemdActivation *act,
|
||||||
const char *actname,
|
const char *actname,
|
||||||
|
@ -127,10 +127,8 @@ testCreateServer(const char *server_name, const char *host, int family)
|
|||||||
5)))
|
5)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virNetServerAddService(srv, svc1) < 0)
|
virNetServerAddService(srv, svc1);
|
||||||
goto error;
|
virNetServerAddService(srv, svc2);
|
||||||
if (virNetServerAddService(srv, svc2) < 0)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
if (virNetSocketNewConnectSockFD(fdclient[0], &sk1) < 0)
|
if (virNetSocketNewConnectSockFD(fdclient[0], &sk1) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user