mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
* 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 Daniel
This commit is contained in:
parent
70eb59b8be
commit
8af506b89f
@ -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>
|
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
|
* TODO libxen.pc.in libxen.spec.in include/Makefile.am Makefile.am
|
||||||
|
6
TODO
6
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
|
||||||
|
@ -47,7 +47,6 @@ typedef struct _xenDomain xenDomain;
|
|||||||
*/
|
*/
|
||||||
typedef xenDomain *xenDomainPtr;
|
typedef xenDomain *xenDomainPtr;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xenDomainFlags:
|
* xenDomainFlags:
|
||||||
*
|
*
|
||||||
@ -72,7 +71,23 @@ xenDomainPtr xenCreateLinuxDomain (xenConnectPtr conn,
|
|||||||
const char *kernel_path,
|
const char *kernel_path,
|
||||||
const char *initrd_path,
|
const char *initrd_path,
|
||||||
const char *cmdline,
|
const char *cmdline,
|
||||||
|
unsigned long memory,
|
||||||
unsigned int flags);
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ATTRIBUTE_UNUSED:
|
||||||
|
*
|
||||||
|
* Macro to flag conciously unused parameters to functions
|
||||||
|
*/
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
#ifdef HAVE_ANSIDECL_H
|
#ifdef HAVE_ANSIDECL_H
|
||||||
#include <ansidecl.h>
|
#include <ansidecl.h>
|
||||||
@ -20,6 +25,15 @@ extern "C" {
|
|||||||
#define ATTRIBUTE_UNUSED
|
#define ATTRIBUTE_UNUSED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO:
|
||||||
|
*
|
||||||
|
* macro to flag unimplemented blocks
|
||||||
|
*/
|
||||||
|
#define TODO \
|
||||||
|
fprintf(stderr, "Unimplemented block at %s:%d\n", \
|
||||||
|
__FILE__, __LINE__);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
106
src/libxen.c
106
src/libxen.c
@ -12,7 +12,6 @@
|
|||||||
#include "libxen.h"
|
#include "libxen.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -74,5 +73,108 @@ xenCloseConnect(xenConnectPtr conn) {
|
|||||||
* xenGetVersion:
|
* xenGetVersion:
|
||||||
* @conn: pointer to the hypervisor connection
|
* @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);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -4,5 +4,9 @@
|
|||||||
xenCloseConnect;
|
xenCloseConnect;
|
||||||
xenGetVersion;
|
xenGetVersion;
|
||||||
xenCreateLinuxDomain;
|
xenCreateLinuxDomain;
|
||||||
|
xenDestroyDomain;
|
||||||
|
xenSuspendDomain;
|
||||||
|
xenResumeDomain;
|
||||||
|
xenSetMaxMemory;
|
||||||
local: *;
|
local: *;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user