#include "libxen.h"
#include <stdio.h>
-
#include "internal.h"
/*
* xenGetVersion:
* @conn: pointer to the hypervisor connection
*
- * Get the version level of the Hypervisor running
+ * 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) {
+ if (conn == NULL)
+ return(-1);
+}
+
+/**
+ * xenCreateLinuxDomain:
+ * @conn: pointer to the hypervisor connection
+ * @kernel_path: the file path to the kernel image
+ * @initrd_path: an optional file path to an initrd
+ * @cmdline: optional command line parameters for the kernel
+ * @memory: the memory size in kilobytes
+ * @flags: an optional set of xenDomainFlags
+ *
+ * Launch a new Linux guest domain
+ *
+ * Returns a new domain object or NULL in case of failure
+ */
+xenDomainPtr
+xenCreateLinuxDomain(xenConnectPtr conn, const char *kernel_path,
+ const char *initrd_path, const char *cmdline,
+ unsigned long memory, unsigned int flags) {
+ if ((conn == NULL) || (kernel_path == NULL) || (memory < 4096))
+ return(NULL);
+ TODO
+ return(NULL);
+}
+
+/**
+ * xenDestroyDomain:
+ * @domain: a domain object
+ *
+ * Destroy the domain object. The running instance is shutdown if not down
+ * already and all resources used by it are given back to the hypervisor.
+ *
+ * Returns 0 in case of success and -1 in case of failure.
*/
+int
+xenDestroyDomain(xenDomainPtr domain) {
+ if (domain == NULL)
+ return(-1);
+ TODO
+ return(-1);
+}
+
+/**
+ * xenSuspendDomain:
+ * @domain: a domain object
+ *
+ * Suspends an active domain, the process is frozen without further access
+ * to CPU resources and I/O but the memory used by the domain at the
+ * hypervisor level will stay allocated. Use xenResumeDomain() to reactivate
+ * the domain.
+ *
+ * Returns 0 in case of success and -1 in case of failure.
+ */
+int
+xenSuspendDomain(xenDomainPtr domain) {
+ if (domain == NULL)
+ return(-1);
+ TODO
+ return(-1);
+}
+
+/**
+ * xenResumeDomain:
+ * @domain: a domain object
+ *
+ * Resume an suspended domain, the process is restarted from the state where
+ * it was frozen by calling xenSuspendDomain().
+ *
+ * Returns 0 in case of success and -1 in case of failure.
+ */
+int
+xenResumeDomain(xenDomainPtr domain) {
+ if (domain == NULL)
+ return(-1);
+ TODO
+ return(-1);
+}
+
+/**
+ * xenSetMaxMemory:
+ * @domain: a domain object or NULL
+ * @memory: the memory size in kilobytes
+ *
+ * Dynamically change the maximum amount of physical memory allocated to a
+ * domain. If domain is NULL, then this change the amount of memory reserved
+ * to Domain0 i.e. the domain where the application runs.
+ *
+ * Returns 0 in case of success and -1 in case of failure.
+ */
+int
+xenSetMaxMemory(xenDomainPtr domain, unsigned long memory) {
+ if ((domain == NULL) || (memory < 4096))
+ return(-1);
+ TODO
+ return(-1);
+}
+