* src/libvirt.c src/xend_internal.c src/xend_internal.h: move the

XML dump function around to make sure all entry points are centralized
  in libvirt.c and also avoid doc generation troubles.
* docs/examples/Makefile.am docs/examples/index.py: fix the makefile
  a bit.
* TODO: updated
* docs/format.html: added a description of the XML used for the
  domains.
* docs//*: rebuilt
Daniel
This commit is contained in:
Daniel Veillard
2006-02-20 23:08:47 +00:00
parent 9c5111b9c9
commit 9a2ec00a05
23 changed files with 358 additions and 75 deletions

View File

@@ -399,8 +399,9 @@ virConnectNumOfDomains(virConnectPtr conn) {
* @xmlDesc: an XML description of the domain
* @flags: an optional set of virDomainFlags
*
* Launch a new Linux guest domain, unimplemented yet, API to be defined.
* This function requires priviledged access to the hypervisor.
* Launch a new Linux guest domain, based on an XML description similar
* to the one returned by virDomainGetXMLDesc()
* This function may requires priviledged access to the hypervisor.
*
* Returns a new domain object or NULL in case of failure
*/
@@ -1238,3 +1239,23 @@ xend_info:
return(0);
}
/**
* virDomainGetXMLDesc:
* @domain: a domain object
* @flags: and OR'ed set of extraction flags, not used yet
*
* Provide an XML description of the domain. The description may be reused
* later to relaunch the domain with virDomainCreateLinux().
*
* Returns a 0 terminated UTF-8 encoded XML instance, or NULL in case of error.
* the caller must free() the returned value.
*/
char *
virDomainGetXMLDesc(virDomainPtr domain, int flags) {
if (!VIR_IS_DOMAIN(domain))
return(NULL);
if (flags != 0)
return(NULL);
return(xend_get_domain_xml(domain));
}

View File

@@ -2105,7 +2105,7 @@ xend_log(virConnectPtr xend, char *buffer, size_t n_buffer)
}
/**
* virDomainParseSExprDesc:
* xend_parse_sexp_desc:
* @root: the root of the parsed S-Expression
* @name: output name of the domain
*
@@ -2116,7 +2116,7 @@ xend_log(virConnectPtr xend, char *buffer, size_t n_buffer)
* the caller must free() the returned value.
*/
static char *
virDomainParseSExprDesc(struct sexpr *root) {
xend_parse_sexp_desc(struct sexpr *root) {
char *ret;
struct sexpr *cur, *node;
const char *tmp;
@@ -2252,31 +2252,27 @@ error:
}
/**
* virDomainGetXMLDesc:
* xend_get_domain_xml:
* @domain: a domain object
* @flags: and OR'ed set of extraction flags, not used yet
*
* Provide an XML description of the domain. NOTE: this API is subject
* to changes.
* Provide an XML description of the domain.
*
* Returns a 0 terminated UTF-8 encoded XML instance, or NULL in case of error.
* the caller must free() the returned value.
*/
char *
virDomainGetXMLDesc(virDomainPtr domain, int flags) {
xend_get_domain_xml(virDomainPtr domain) {
char *ret = NULL;
struct sexpr *root;
if (!VIR_IS_DOMAIN(domain))
return(NULL);
if (flags != 0)
return(NULL);
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
if (root == NULL)
return(NULL);
ret = virDomainParseSExprDesc(root);
ret = xend_parse_sexp_desc(root);
sexpr_free(root);
return(ret);

View File

@@ -846,6 +846,15 @@ int xend_log(virConnectPtr xend,
char *buffer,
size_t n_buffer);
/**
* \brief Provide an XML description of the domain.
* \param domain a xend domain object
* \return a 0 terminated UTF-8 encoded XML instance, or NULL in case of error.
* the caller must free() the returned value.
*
* Provide an XML description of the domain.
*/
char *xend_get_domain_xml(virDomainPtr domain);
#ifdef __cplusplus
}
#endif