libvirt/include/libvirt/libvirt-admin.h
Erik Skultety 3245e1783c 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.
2015-12-21 10:07:59 +01:00

91 lines
2.8 KiB
C

/*
* libvirt-admin.h: Admin interface for libvirt
* Summary: Interfaces for handling server-related tasks
* Description: Provides the interfaces of the libvirt library to operate
* with the server itself, not any hypervisors.
*
* Copyright (C) 2014-2015 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*
* Author: Martin Kletzander <mkletzan@redhat.com>
*/
#ifndef __VIR_ADMIN_H__
# define __VIR_ADMIN_H__
# ifdef __cplusplus
extern "C" {
# endif
# define __VIR_ADMIN_H_INCLUDES__
# include <libvirt/libvirt-common.h>
# undef __VIR_ADMIN_H_INCLUDES__
/**
* virAdmConnect:
*
* a virAdmConnect is a private structure representing a connection to
* libvirt daemon.
*/
typedef struct _virAdmConnect virAdmConnect;
/**
* virAdmConnectPtr:
*
* 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 virAdmConnect *virAdmConnectPtr;
virAdmConnectPtr virAdmConnectOpen(const char *name, unsigned int flags);
int virAdmConnectClose(virAdmConnectPtr conn);
int virAdmConnectRef(virAdmConnectPtr conn);
int virAdmConnectIsAlive(virAdmConnectPtr conn);
int virAdmGetVersion(unsigned long long *libVer);
char *virAdmConnectGetURI(virAdmConnectPtr conn);
int virAdmConnectGetLibVersion(virAdmConnectPtr conn,
unsigned long long *libVer);
/**
* 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 (*virAdmConnectCloseFunc)(virAdmConnectPtr conn,
int reason,
void *opaque);
int virAdmConnectRegisterCloseCallback(virAdmConnectPtr conn,
virAdmConnectCloseFunc cb,
void *opaque,
virFreeCallback freecb);
int virAdmConnectUnregisterCloseCallback(virAdmConnectPtr conn,
virAdmConnectCloseFunc cb);
# ifdef __cplusplus
}
# endif
#endif /* __VIR_ADMIN_H__ */