remote: change generated methods to not directly access connection

The driver dispatch methods access the priv->conn variables directly.
In future we want to dynamically open the connections for the secondary
driver. Thus we want the methods to call a method to get the connection
handle instead of assuming the private variable is non-NULL.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2019-07-17 15:26:08 +01:00
parent 690f02751f
commit 9cc8ecc809
3 changed files with 183 additions and 43 deletions

View File

@@ -206,6 +206,15 @@ adminConnectGetLibVersion(virNetDaemonPtr dmn ATTRIBUTE_UNUSED,
return 0;
}
static virNetDaemonPtr
adminGetConn(virNetServerClientPtr client)
{
struct daemonAdmClientPrivate *priv =
virNetServerClientGetPrivateData(client);
return priv->dmn;
}
static int
adminDispatchServerGetThreadpoolParameters(virNetServerPtr server ATTRIBUTE_UNUSED,
virNetServerClientPtr client,