admin: Do not work with virAdm on the server side

virAdm is prefix only used on the client side.  Or at least for now.  On
server, though, this corresponds to virNet structures (virAdmConnect is
virNetDaemon, virAdmServer should be virNetServer, in the future
virAdmClient will be resolved to virNetServerClient, and so on).

This will also make future work clearer and easier.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2016-03-01 15:31:18 +01:00
parent 83942e5b6a
commit a0dbed6160
3 changed files with 9 additions and 10 deletions

View File

@ -82,9 +82,9 @@ remoteAdmClientInitHook(virNetServerClientPtr client ATTRIBUTE_UNUSED,
static void static void
make_nonnull_server(admin_nonnull_server *srv_dst, make_nonnull_server(admin_nonnull_server *srv_dst,
virAdmServerPtr srv_src) virNetServerPtr srv_src)
{ {
ignore_value(VIR_STRDUP_QUIET(srv_dst->name, srv_src->name)); ignore_value(VIR_STRDUP_QUIET(srv_dst->name, virNetServerGetName(srv_src)));
} }
/* Functions */ /* Functions */
@ -141,7 +141,7 @@ adminDispatchConnectListServers(virNetServerPtr server ATTRIBUTE_UNUSED,
admin_connect_list_servers_args *args, admin_connect_list_servers_args *args,
admin_connect_list_servers_ret *ret) admin_connect_list_servers_ret *ret)
{ {
virAdmServerPtr *servers = NULL; virNetServerPtr *servers = NULL;
int nservers = 0; int nservers = 0;
int rv = -1; int rv = -1;
size_t i; size_t i;

View File

@ -38,12 +38,12 @@ VIR_LOG_INIT("daemon.admin_server");
int int
adminDaemonListServers(virNetDaemonPtr dmn, adminDaemonListServers(virNetDaemonPtr dmn,
virAdmServerPtr **servers, virNetServerPtr **servers,
unsigned int flags) unsigned int flags)
{ {
int ret = -1; int ret = -1;
const char **srv_names = NULL; const char **srv_names = NULL;
virAdmServerPtr *srvs = NULL; virNetServerPtr *srvs = NULL;
size_t i; size_t i;
ssize_t nsrvs = 0; ssize_t nsrvs = 0;
@ -57,7 +57,7 @@ adminDaemonListServers(virNetDaemonPtr dmn,
goto cleanup; goto cleanup;
for (i = 0; i < nsrvs; i++) { for (i = 0; i < nsrvs; i++) {
if (!(srvs[i] = virAdmGetServer(NULL, srv_names[i]))) if (!(srvs[i] = virNetDaemonGetServer(dmn, srv_names[i])))
goto cleanup; goto cleanup;
} }

View File

@ -26,9 +26,8 @@
# include "rpc/virnetdaemon.h" # include "rpc/virnetdaemon.h"
int int adminDaemonListServers(virNetDaemonPtr dmn,
adminDaemonListServers(virNetDaemonPtr dmn, virNetServerPtr **servers,
virAdmServerPtr **servers, unsigned int flags);
unsigned int flags);
#endif /* __LIBVIRTD_ADMIN_SERVER_H__ */ #endif /* __LIBVIRTD_ADMIN_SERVER_H__ */