Revert "admin: Rename virAdmConnect to virAdmDaemon"

Commmit df8192aa introduced admin related rename and some minor
(caused by automated approach, aka sed) and some more severe isues along with
it. First reason to revert is the inconsistency with libvirt library.
Although we deal with the daemon directly rather than with a specific
hypervisor, we still do have a connection. That being said, contributors might
get under the impression that AdmDaemonNew would spawn/start a new daemon
(since it's admin API, why not...), or AdmDaemonClose would do the exact
opposite or they might expect DaemonIsAlive report overall status of the daemon
which definitely isn't the case.
The second reason to revert this patch is renaming virt-admin client. The
client tool does not necessarily have to reflect the names of the API's it's
using in his internals. An example would be 's/vshAdmConnect/vshAdmDaemon'
where noone can be certain of what the latter function really does. The former
is quite expressive about some connection magic it performs, but the latter does
not say anything, especially when vshAdmReconnect and vshAdmDisconnect were
left untouched.
This commit is contained in:
Erik Skultety
2015-12-10 13:46:45 +01:00
parent 5b74103b0b
commit 3245e1783c
16 changed files with 249 additions and 248 deletions

View File

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