]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
* TODO: updated
authorDaniel Veillard <veillard@redhat.com>
Mon, 7 Nov 2005 17:16:18 +0000 (17:16 +0000)
committerDaniel Veillard <veillard@redhat.com>
Mon, 7 Nov 2005 17:16:18 +0000 (17:16 +0000)
* include/libxen.h src/libxen.c src/libxen_sym.version: extended
  entry points to a first minimal set.
* src/internal.h: TODO macro
Daniel

ChangeLog
TODO
include/libxen.h
src/internal.h
src/libxen.c
src/libxen_sym.version

index bab0c03eaec75c02574e5ce9a4956c5fa6bc51be..53cbf471933c9dfe2b4873ac22eb2bf4114772cd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Nov  7 18:14:50 CET 2005 Daniel Veillard <veillard@redhat.com>
+
+       * TODO: updated
+       * include/libxen.h src/libxen.c src/libxen_sym.version: extended
+         entry points to a first minimal set.
+       * src/internal.h: TODO macro
+
 Wed Nov  2 16:35:54 CET 2005 Daniel Veillard <veillard@redhat.com>
 
        * TODO libxen.pc.in libxen.spec.in include/Makefile.am Makefile.am
diff --git a/TODO b/TODO
index 43294464493a46cfb1917846f25fe46af1ee37cf..7902d5624d6f34bf42c0550dbc9cc45eb1922f9b 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1 +1,5 @@
-- everything at this point
+- nearly everything at this point
+
+Done:
+- make dist and make rpm targets
+- set a no public by default policy for libxen symbols
index 1f74d75ab25b767a720d88f9644f393e233d0f34..3832d23fd3655f6f995346b2f415dca04f6ea1f8 100644 (file)
@@ -47,7 +47,6 @@ typedef struct _xenDomain xenDomain;
  */
 typedef xenDomain *xenDomainPtr;
 
-
 /**
  * xenDomainFlags:
  *
@@ -72,7 +71,23 @@ xenDomainPtr         xenCreateLinuxDomain    (xenConnectPtr conn,
                                                 const char *kernel_path,
                                                 const char *initrd_path,
                                                 const char *cmdline,
+                                                unsigned long memory,
                                                 unsigned int flags);
+
+int                    xenDestroyDomain        (xenDomainPtr domain);
+
+/*
+ * Domain suspend/resume
+ */
+int                    xenSuspendDomain        (xenDomainPtr domain);
+int                    xenResumeDomain         (xenDomainPtr domain);
+
+/*
+ * Dynamic control of domains
+ */
+int                    xenSetMaxMemory         (xenDomainPtr domain,
+                                                unsigned long memory);
+
 #ifdef __cplusplus
 }
 #endif
index ca13e360cca4e2f29b91ac96a1f50876344a9e0e..e79fe47b14632a0402e246ed4d1975d36bf64268 100644 (file)
@@ -9,6 +9,11 @@
 extern "C" {
 #endif
 
+/**
+ * ATTRIBUTE_UNUSED:
+ *
+ * Macro to flag conciously unused parameters to functions
+ */
 #ifdef __GNUC__
 #ifdef HAVE_ANSIDECL_H
 #include <ansidecl.h>
@@ -20,6 +25,15 @@ extern "C" {
 #define ATTRIBUTE_UNUSED
 #endif
 
+/**
+ * TODO:
+ *
+ * macro to flag unimplemented blocks
+ */
+#define TODO                                                           \
+    fprintf(stderr, "Unimplemented block at %s:%d\n",                  \
+            __FILE__, __LINE__);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 941fbbde0293090e6dcb206c3feaa482dee1a690..7aba219e9ee9355809dd9e3f700448279be3b56a 100644 (file)
@@ -12,7 +12,6 @@
 #include "libxen.h"
 
 #include <stdio.h>
-
 #include "internal.h"
 
 /*
@@ -74,5 +73,108 @@ xenCloseConnect(xenConnectPtr conn) {
  * 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);
+}
+
index 24536aeefd6ac0d0df4a27f8e65455f012f449f6..0ac937ac5bbf6d2fb8fdb62d631618512d3a731f 100644 (file)
@@ -4,5 +4,9 @@
        xenCloseConnect;
        xenGetVersion;
        xenCreateLinuxDomain;
+       xenDestroyDomain;
+       xenSuspendDomain;
+       xenResumeDomain;
+       xenSetMaxMemory;
     local: *;
 };