admin: add support for post-exec restart callbacks

We don't have any per-client private data we need to persist, but the
RPC infrastructure requires that we provide the callbacks and serialize
an empty JSON object. This makes us future proof going forwards.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2018-01-23 13:20:19 +00:00 committed by Daniel P. Berrangé
parent 99d69f6925
commit b42c591fec
2 changed files with 26 additions and 0 deletions

View File

@ -86,6 +86,27 @@ remoteAdmClientNew(virNetServerClientPtr client ATTRIBUTE_UNUSED,
return priv; return priv;
} }
void *remoteAdmClientNewPostExecRestart(virNetServerClientPtr client,
virJSONValuePtr object ATTRIBUTE_UNUSED,
void *opaque)
{
return remoteAdmClientNew(client, opaque);
}
virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED)
{
virJSONValuePtr object = virJSONValueNewObject();
if (!object)
return NULL;
/* No content to add at this time - just need empty object */
return object;
}
/* Helpers */ /* Helpers */
static virNetServerPtr static virNetServerPtr

View File

@ -33,5 +33,10 @@ extern size_t adminNProcs;
void remoteAdmClientFree(void *data); void remoteAdmClientFree(void *data);
void *remoteAdmClientNew(virNetServerClientPtr client, void *opaque); void *remoteAdmClientNew(virNetServerClientPtr client, void *opaque);
void *remoteAdmClientNewPostExecRestart(virNetServerClientPtr client,
virJSONValuePtr object,
void *opaque);
virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client,
void *data);
#endif /* __ADMIN_SERVER_DISPATCH_H__ */ #endif /* __ADMIN_SERVER_DISPATCH_H__ */