aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2005-12-01 10:51:34 +0000
committerDaniel Veillard <veillard@redhat.com>2005-12-01 10:51:34 +0000
commit363bb8380fc9719c1f8e0ea2a80f9444c71c5d37 (patch)
treee6037b9e75a8a8a557eac094f22313e7b798dd95 /src
parentoops, forgot hash.[ch], Daniel (diff)
downloadlibvirt-363bb8380fc9719c1f8e0ea2a80f9444c71c5d37.tar.gz
libvirt-363bb8380fc9719c1f8e0ea2a80f9444c71c5d37.tar.bz2
libvirt-363bb8380fc9719c1f8e0ea2a80f9444c71c5d37.zip
* include/libxen.h src/libxen.c src/libxen_sym.version src/xensh.c:
changed entry points naming conventions based on feedback with Karel Zak Daniel
Diffstat (limited to 'src')
-rw-r--r--src/libxen.c58
-rw-r--r--src/libxen_sym.version26
-rw-r--r--src/xensh.c9
3 files changed, 47 insertions, 46 deletions
diff --git a/src/libxen.c b/src/libxen.c
index 270c71aad..4836a833f 100644
--- a/src/libxen.c
+++ b/src/libxen.c
@@ -56,7 +56,7 @@ struct _xenDomain {
};
/**
- * xenGetConnect:
+ * xenConnectOpen:
* @name: optional argument currently unused, pass NULL
*
* This function should be called first to get a connection to the
@@ -65,7 +65,7 @@ struct _xenDomain {
* 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;
@@ -101,7 +101,7 @@ failed:
}
/**
- * xenDestroyDomainName:
+ * xenDomainDestroyName:
* @domain: a domain object
*
* Destroy the domain object, this is just used by the domain hash callback.
@@ -109,12 +109,12 @@ failed:
* 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
@@ -125,11 +125,11 @@ xenDestroyDomainName(xenDomainPtr domain, const char *name ATTRIBUTE_UNUSED) {
* 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;
@@ -140,7 +140,7 @@ xenCloseConnect(xenConnectPtr conn) {
}
/**
- * xenGetVersion:
+ * xenConnectGetVersion:
* @conn: pointer to the hypervisor connection
*
* Get the version level of the Hypervisor running.
@@ -148,13 +148,13 @@ xenCloseConnect(xenConnectPtr conn) {
* 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
@@ -167,7 +167,7 @@ xenGetVersion(xenConnectPtr conn) {
* 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) ||
@@ -178,7 +178,7 @@ xenCreateLinuxDomain(xenConnectPtr conn, const char *kernel_path,
}
/**
- * xenDomainByName:
+ * xenDomainLookupByName:
* @conn: pointer to the hypervisor connection
* @name: name for the domain
*
@@ -187,7 +187,7 @@ xenCreateLinuxDomain(xenConnectPtr conn, const char *kernel_path,
* 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
@@ -195,7 +195,7 @@ xenDomainByName(xenConnectPtr conn, const char *name) {
}
/**
- * xenDomainByID:
+ * xenDomainLookupByID:
* @conn: pointer to the hypervisor connection
* @id: the domain ID number
*
@@ -204,7 +204,7 @@ xenDomainByName(xenConnectPtr conn, const char *name) {
* 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;
@@ -236,7 +236,7 @@ xenDomainByID(xenConnectPtr conn, int id) {
}
/**
- * xenDestroyDomain:
+ * xenDomainDestroy:
* @domain: a domain object
*
* Destroy the domain object. The running instance is shutdown if not down
@@ -245,7 +245,7 @@ xenDomainByID(xenConnectPtr conn, int id) {
* 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
@@ -253,7 +253,7 @@ xenDestroyDomain(xenDomainPtr domain) {
}
/**
- * xenSuspendDomain:
+ * xenDomainSuspend:
* @domain: a domain object
*
* Suspends an active domain, the process is frozen without further access
@@ -264,7 +264,7 @@ xenDestroyDomain(xenDomainPtr domain) {
* 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
@@ -281,7 +281,7 @@ xenSuspendDomain(xenDomainPtr domain) {
* 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
@@ -289,7 +289,7 @@ xenResumeDomain(xenDomainPtr domain) {
}
/**
- * xenGetName:
+ * xenDomainGetName:
* @domain: a domain object
*
* Get the public name for that domain
@@ -298,14 +298,14 @@ xenResumeDomain(xenDomainPtr 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
@@ -313,14 +313,14 @@ xenGetName(xenDomainPtr 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
@@ -330,7 +330,7 @@ xenGetID(xenDomainPtr domain) {
* 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
@@ -338,7 +338,7 @@ xenGetMaxMemory(xenDomainPtr domain) {
}
/**
- * xenSetMaxMemory:
+ * xenDomainSetMaxMemory:
* @domain: a domain object or NULL
* @memory: the memory size in kilobytes
*
@@ -349,7 +349,7 @@ xenGetMaxMemory(xenDomainPtr domain) {
* 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);
diff --git a/src/libxen_sym.version b/src/libxen_sym.version
index 6b9adb4d4..8dbc587c1 100644
--- a/src/libxen_sym.version
+++ b/src/libxen_sym.version
@@ -1,17 +1,17 @@
{
global:
- xenOpenConnect;
- xenCloseConnect;
- xenGetVersion;
- xenCreateLinuxDomain;
- xenDomainByName;
- xenDomainByID;
- xenDestroyDomain;
- xenSuspendDomain;
- xenResumeDomain;
- xenGetName;
- xenGetID;
- xenGetMaxMemory;
- xenSetMaxMemory;
+ xenConnectOpen;
+ xenConnectClose;
+ xenConnectGetVersion;
+ xenDomainCreateLinux;
+ xenDomainLookupByName;
+ xenDomainLookupByID;
+ xenDomainDestroy;
+ xenDomainSuspend;
+ xenDomainResume;
+ xenDomainGetName;
+ xenDomainGetID;
+ xenDomainGetMaxMemory;
+ xenDomainSetMaxMemory;
local: *;
};
diff --git a/src/xensh.c b/src/xensh.c
index afca43e8f..f830aa987 100644
--- a/src/xensh.c
+++ b/src/xensh.c
@@ -18,23 +18,24 @@ xenDomainPtr dom0;
int main(int argc, char **argv) {
int ret;
- conn = xenOpenConnect(NULL);
+ conn = xenConnectOpen(NULL);
if (conn == NULL) {
fprintf(stderr, "Failed to connect to the hypervisor\n");
errcode = 1;
goto done;
}
- dom0 = xenDomainByID(conn, 0);
+ dom0 = xenDomainLookupByID(conn, 0);
if (dom0 == NULL) {
fprintf(stderr, "Failed to get domain 0 informations\n");
errcode = 2;
goto done;
}
- printf("Dom0: name %s, id %d\n", xenGetName(dom0), xenGetID(dom0));
+ printf("Dom0: name %s, id %d\n", xenDomainGetName(dom0),
+ xenDomainGetID(dom0));
done:
if (conn != NULL) {
- ret = xenCloseConnect(conn);
+ ret = xenConnectClose(conn);
if (ret != 0) {
fprintf(stderr, "Failed to connect to the hypervisor\n");
if (errcode == 0)