admin: Rename virAdmConnect to virAdmDaemon

virAdmConnect was named after virConnect, but after some discussions,
most of the APIs called will be working with remote daemon and starting
them virAdmDaemon will make more sense.  Only possibly controversal name
is CloseCallback (de)registration, and connecting to the daemon (which
will still be Open/Close), but even this makes sense if one thinks about
the daemon being opened and closed, e.g. as file, etc.

This way all the APIs working with the daemon will start with
virAdmDaemon prefix, they will accept virAdmDaemonPtr as first parameter
and that will better suit with other namings as well (virDomain*,
virAdmServer*, etc.).

Because in virt-admin, the connection name does not refer to a struct
that would have a connect in its name, also adjust 'connname' in
clients.  And because it is not used anywhere in the vsh code, move it
from there into each client.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander
2015-11-25 16:59:30 +01:00
parent 15b0a6d641
commit df8192aaf4
16 changed files with 248 additions and 249 deletions

View File

@@ -35,53 +35,51 @@ extern "C" {
# undef __VIR_ADMIN_H_INCLUDES__
/**
* virAdmConnect:
* virAdmDaemon:
*
* a virAdmConnect is a private structure representing a connection to
* libvirt daemon.
* a virAdmDaemon is a private structure representing a remote daemon.
*/
typedef struct _virAdmConnect virAdmConnect;
typedef struct _virAdmDaemon virAdmDaemon;
/**
* virAdmConnectPtr:
* virAdmDaemonPtr:
*
* a virAdmConnectPtr is pointer to a virAdmConnect private structure,
* this is the type used to reference a connection to the daemon
* in the API.
* a virAdmDaemonPtr is pointer to a virAdmDaemon private structure,
* this is the type used to reference a daemon in the API.
*/
typedef virAdmConnect *virAdmConnectPtr;
typedef virAdmDaemon *virAdmDaemonPtr;
virAdmConnectPtr virAdmConnectOpen(const char *name, unsigned int flags);
int virAdmConnectClose(virAdmConnectPtr conn);
virAdmDaemonPtr virAdmDaemonOpen(const char *name, unsigned int flags);
int virAdmDaemonClose(virAdmDaemonPtr dmn);
int virAdmConnectRef(virAdmConnectPtr conn);
int virAdmConnectIsAlive(virAdmConnectPtr conn);
int virAdmDaemonRef(virAdmDaemonPtr dmn);
int virAdmDaemonIsAlive(virAdmDaemonPtr dmn);
int virAdmGetVersion(unsigned long long *libVer);
char *virAdmConnectGetURI(virAdmConnectPtr conn);
char *virAdmDaemonGetURI(virAdmDaemonPtr dmn);
int virAdmConnectGetLibVersion(virAdmConnectPtr conn,
unsigned long long *libVer);
int virAdmDaemonGetVersion(virAdmDaemonPtr dmn,
unsigned long long *libVer);
/**
* virAdmConnectCloseFunc:
* @conn: virAdmConnect connection
* virAdmDaemonCloseFunc:
* @dmn: virAdmDaemon connection
* @reason: reason why the connection was closed (see virConnectCloseReason)
* @opaque: opaque client data
*
* A callback to be registered, in case a connection was closed.
*/
typedef void (*virAdmConnectCloseFunc)(virAdmConnectPtr conn,
typedef void (*virAdmDaemonCloseFunc)(virAdmDaemonPtr dmn,
int reason,
void *opaque);
int virAdmConnectRegisterCloseCallback(virAdmConnectPtr conn,
virAdmConnectCloseFunc cb,
void *opaque,
virFreeCallback freecb);
int virAdmConnectUnregisterCloseCallback(virAdmConnectPtr conn,
virAdmConnectCloseFunc cb);
int virAdmDaemonRegisterCloseCallback(virAdmDaemonPtr dmn,
virAdmDaemonCloseFunc cb,
void *opaque,
virFreeCallback freecb);
int virAdmDaemonUnregisterCloseCallback(virAdmDaemonPtr dmn,
virAdmDaemonCloseFunc cb);
# ifdef __cplusplus
}