/*
* Connection and disconnections to the Hypervisor
*/
-xenConnectPtr xenOpenConnect (const char *name);
-int xenCloseConnect (xenConnectPtr conn);
-unsigned long xenGetVersion (xenConnectPtr conn);
+xenConnectPtr xenConnectOpen (const char *name);
+int xenConnectClose (xenConnectPtr conn);
+unsigned long xenConnectGetVersion (xenConnectPtr conn);
/*
* Domain creation and destruction
*/
-xenDomainPtr xenCreateLinuxDomain (xenConnectPtr conn,
+xenDomainPtr xenDomainCreateLinux (xenConnectPtr conn,
const char *kernel_path,
const char *initrd_path,
const char *cmdline,
unsigned long memory,
unsigned int flags);
-xenDomainPtr xenDomainByName (xenConnectPtr conn,
+xenDomainPtr xenDomainLookupByName (xenConnectPtr conn,
const char *name);
-xenDomainPtr xenDomainByID (xenConnectPtr conn,
+xenDomainPtr xenDomainLookupByID (xenConnectPtr conn,
int id);
-int xenDestroyDomain (xenDomainPtr domain);
+int xenDomainDestroy (xenDomainPtr domain);
/*
* Domain suspend/resume
*/
-int xenSuspendDomain (xenDomainPtr domain);
-int xenResumeDomain (xenDomainPtr domain);
+int xenDomainSuspend (xenDomainPtr domain);
+int xenDomainResume (xenDomainPtr domain);
/*
* Dynamic control of domains
*/
-const char * xenGetName (xenDomainPtr domain);
-unsigned int xenGetID (xenDomainPtr domain);
-unsigned long xenGetMaxMemory (xenDomainPtr domain);
-int xenSetMaxMemory (xenDomainPtr domain,
+const char * xenDomainGetName (xenDomainPtr domain);
+unsigned int xenDomainGetID (xenDomainPtr domain);
+unsigned long xenDomainGetMaxMemory (xenDomainPtr domain);
+int xenDomainSetMaxMemory (xenDomainPtr domain,
unsigned long memory);
#ifdef __cplusplus
};
/**
- * xenGetConnect:
+ * xenConnectOpen:
* @name: optional argument currently unused, pass NULL
*
* This function should be called first to get a connection to the
* Returns a pointer to the hypervisor connection or NULL in case of error
*/
xenConnectPtr
-xenOpenConnect(const char *name) {
+xenConnectOpen(const char *name) {
xenConnectPtr ret;
int handle = -1;
struct xs_handle *xshandle = NULL;
}
/**
- * xenDestroyDomainName:
+ * xenDomainDestroyName:
* @domain: a domain object
*
* Destroy the domain object, this is just used by the domain hash callback.
* Returns 0 in case of success and -1 in case of failure.
*/
static int
-xenDestroyDomainName(xenDomainPtr domain, const char *name ATTRIBUTE_UNUSED) {
- return(xenDestroyDomain(domain));
+xenDomainDestroyName(xenDomainPtr domain, const char *name ATTRIBUTE_UNUSED) {
+ return(xenDomainDestroy(domain));
}
/**
- * xenCloseConnect:
+ * xenConnectClose:
* @conn: pointer to the hypervisor connection
*
* This function closes the connection to the Hypervisor. This should
* Returns 0 in case of success or -1 in case of error.
*/
int
-xenCloseConnect(xenConnectPtr conn) {
+xenConnectClose(xenConnectPtr conn) {
if ((conn == NULL) || (conn->magic != XEN_CONNECT_MAGIC))
return(-1);
- xenHashFree(conn->domains, (xenHashDeallocator) xenDestroyDomainName);
+ xenHashFree(conn->domains, (xenHashDeallocator) xenDomainDestroyName);
conn->magic = -1;
xs_daemon_close(conn->xshandle);
conn->xshandle = NULL;
}
/**
- * xenGetVersion:
+ * xenConnectGetVersion:
* @conn: pointer to the hypervisor connection
*
* Get the version level of the Hypervisor running.
* Returns -1 in case of error or major * 10,000 + minor * 100 + rev otherwise
*/
unsigned long
-xenGetVersion(xenConnectPtr conn) {
+xenConnectGetVersion(xenConnectPtr conn) {
if (conn == NULL)
return(-1);
}
/**
- * xenCreateLinuxDomain:
+ * xenDomainCreateLinux:
* @conn: pointer to the hypervisor connection
* @kernel_path: the file path to the kernel image
* @initrd_path: an optional file path to an initrd
* Returns a new domain object or NULL in case of failure
*/
xenDomainPtr
-xenCreateLinuxDomain(xenConnectPtr conn, const char *kernel_path,
+xenDomainCreateLinux(xenConnectPtr conn, const char *kernel_path,
const char *initrd_path, const char *cmdline,
unsigned long memory, unsigned int flags) {
if ((conn == NULL) || (conn->magic != XEN_CONNECT_MAGIC) ||
}
/**
- * xenDomainByName:
+ * xenDomainLookupByName:
* @conn: pointer to the hypervisor connection
* @name: name for the domain
*
* Returns a new domain object or NULL in case of failure
*/
xenDomainPtr
-xenDomainByName(xenConnectPtr conn, const char *name) {
+xenDomainLookupByName(xenConnectPtr conn, const char *name) {
if ((conn == NULL) || (conn->magic != XEN_CONNECT_MAGIC) || (name == NULL))
return(NULL);
TODO
}
/**
- * xenDomainByID:
+ * xenDomainLookupByID:
* @conn: pointer to the hypervisor connection
* @id: the domain ID number
*
* Returns a new domain object or NULL in case of failure
*/
xenDomainPtr
-xenDomainByID(xenConnectPtr conn, int id) {
+xenDomainLookupByID(xenConnectPtr conn, int id) {
char *path;
xenDomainPtr ret;
xc_dominfo_t info;
}
/**
- * xenDestroyDomain:
+ * xenDomainDestroy:
* @domain: a domain object
*
* Destroy the domain object. The running instance is shutdown if not down
* Returns 0 in case of success and -1 in case of failure.
*/
int
-xenDestroyDomain(xenDomainPtr domain) {
+xenDomainDestroy(xenDomainPtr domain) {
if ((domain == NULL) || (domain->magic != XEN_DOMAIN_MAGIC))
return(-1);
TODO
}
/**
- * xenSuspendDomain:
+ * xenDomainSuspend:
* @domain: a domain object
*
* Suspends an active domain, the process is frozen without further access
* Returns 0 in case of success and -1 in case of failure.
*/
int
-xenSuspendDomain(xenDomainPtr domain) {
+xenDomainSuspend(xenDomainPtr domain) {
if ((domain == NULL) || (domain->magic != XEN_DOMAIN_MAGIC))
return(-1);
TODO
* Returns 0 in case of success and -1 in case of failure.
*/
int
-xenResumeDomain(xenDomainPtr domain) {
+xenDomainResume(xenDomainPtr domain) {
if ((domain == NULL) || (domain->magic != XEN_DOMAIN_MAGIC))
return(-1);
TODO
}
/**
- * xenGetName:
+ * xenDomainGetName:
* @domain: a domain object
*
* Get the public name for that domain
* its lifetime will be the same as the domain object.
*/
const char *
-xenGetName(xenDomainPtr domain) {
+xenDomainGetName(xenDomainPtr domain) {
if ((domain == NULL) || (domain->magic != XEN_DOMAIN_MAGIC))
return(NULL);
return(domain->name);
}
/**
- * xenGetID:
+ * xenDomainGetID:
* @domain: a domain object
*
* Get the hypervisor ID number for the domain
* Returns the domain ID number or (unsigned int) -1 in case of error
*/
unsigned int
-xenGetID(xenDomainPtr domain) {
+xenDomainGetID(xenDomainPtr domain) {
if ((domain == NULL) || (domain->magic != XEN_DOMAIN_MAGIC))
return((unsigned int) -1);
return(domain->handle);
}
/**
- * xenGetMaxMemory:
+ * xenDomainGetMaxMemory:
* @domain: a domain object or NULL
*
* Retrieve the maximum amount of physical memory allocated to a
* Returns the memory size in kilobytes or 0 in case of error.
*/
unsigned long
-xenGetMaxMemory(xenDomainPtr domain) {
+xenDomainGetMaxMemory(xenDomainPtr domain) {
if ((domain == NULL) || (domain->magic != XEN_DOMAIN_MAGIC))
return(0);
TODO
}
/**
- * xenSetMaxMemory:
+ * xenDomainSetMaxMemory:
* @domain: a domain object or NULL
* @memory: the memory size in kilobytes
*
* Returns 0 in case of success and -1 in case of failure.
*/
int
-xenSetMaxMemory(xenDomainPtr domain, unsigned long memory) {
+xenDomainSetMaxMemory(xenDomainPtr domain, unsigned long memory) {
if ((domain == NULL) || (domain->magic != XEN_DOMAIN_MAGIC) ||
(memory < 4096))
return(-1);