2006-01-12 15:38:07 +00:00
|
|
|
/*
|
|
|
|
* libxend/xend.h -- Xend library
|
|
|
|
*
|
2006-03-22 13:44:01 +00:00
|
|
|
* Copyright (C) 2005,2006
|
2006-01-12 15:38:07 +00:00
|
|
|
*
|
|
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
2006-03-22 13:44:01 +00:00
|
|
|
* Daniel Veillard <veillard@redhat.com>
|
2006-01-12 15:38:07 +00:00
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser General
|
|
|
|
* Public License. See the file COPYING in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LIBXEND_XEND_H_
|
|
|
|
#define _LIBXEND_XEND_H_
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2006-06-26 15:02:18 +00:00
|
|
|
#include "libvirt/libvirt.h"
|
2006-01-13 16:41:01 +00:00
|
|
|
|
2006-01-12 15:38:07 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2006-01-13 16:41:01 +00:00
|
|
|
* \brief Setup the connection to a xend instance via TCP
|
2006-01-12 15:38:07 +00:00
|
|
|
* \param host The host name to connect to
|
|
|
|
* \param port The port number to connect to
|
2006-01-13 16:41:01 +00:00
|
|
|
* \return 0 in case of success, -1 in case of error
|
2006-01-12 15:38:07 +00:00
|
|
|
*
|
|
|
|
* This method creates a new Xend instance via TCP.
|
|
|
|
*
|
|
|
|
* This function may not fail if Xend is not running.
|
|
|
|
*
|
2006-03-22 13:44:01 +00:00
|
|
|
* Make sure to call xenDaemonClose().
|
2006-01-12 15:38:07 +00:00
|
|
|
*/
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonOpen_tcp(virConnectPtr xend, const char *host, int port);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
/**
|
2006-01-13 16:41:01 +00:00
|
|
|
* \brief Setup the connection to xend instance via a Unix domain socket
|
2006-01-12 15:38:07 +00:00
|
|
|
* \param path The path to the domain socket
|
2006-01-13 16:41:01 +00:00
|
|
|
* \return 0 in case of success, -1 in case of error
|
2006-01-12 15:38:07 +00:00
|
|
|
*
|
|
|
|
* This method creates a new xend instance via a Unix domain socket.
|
|
|
|
*
|
|
|
|
* This function may not fail if Xend is not running.
|
|
|
|
*
|
2006-03-22 13:44:01 +00:00
|
|
|
* Make sure to call xenDaemonClose().
|
2006-01-12 15:38:07 +00:00
|
|
|
*/
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonOpen_unix(virConnectPtr xend, const char *path);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Blocks until a domain's devices are initialized
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param name The domain's name
|
|
|
|
* \return 0 for success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* xen_create() returns after a domain has been allocated including
|
|
|
|
* its memory. This does not guarentee, though, that the devices
|
|
|
|
* have come up properly. For instance, if you create a VBD with an
|
|
|
|
* invalid filename, the error won't occur until after this function
|
|
|
|
* returns.
|
|
|
|
*/
|
2006-03-15 12:13:25 +00:00
|
|
|
int xend_wait_for_devices(virConnectPtr xend, const char *name);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
|
2006-02-16 22:50:52 +00:00
|
|
|
/**
|
|
|
|
* \brief Create a new domain
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param sexpr An S-Expr defining the domain
|
|
|
|
* \return 0 for success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This method will create a domain based the passed in description. The
|
|
|
|
* domain will be paused after creation and must be unpaused with
|
2006-03-22 13:44:01 +00:00
|
|
|
* xenDaemonResumeDomain() to begin execution.
|
2006-02-16 22:50:52 +00:00
|
|
|
*/
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonDomainCreateLinux(virConnectPtr xend, const char *sexpr);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
2006-01-19 10:23:15 +00:00
|
|
|
/**
|
|
|
|
* \brief Lookup the id of a domain
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param name The name of the domain
|
2006-02-23 10:13:55 +00:00
|
|
|
* \param uuid pointer to store a copy of the uuid
|
2006-01-19 10:23:15 +00:00
|
|
|
* \return the id number on success; -1 (with errno) on error
|
|
|
|
*
|
2006-02-23 10:13:55 +00:00
|
|
|
* This method looks up the ids of a domain
|
2006-01-19 10:23:15 +00:00
|
|
|
*/
|
2006-04-13 17:18:49 +00:00
|
|
|
int xenDaemonDomainLookupByName_ids(virConnectPtr xend,
|
2006-03-15 12:13:25 +00:00
|
|
|
const char *name, unsigned char *uuid);
|
2006-01-19 10:23:15 +00:00
|
|
|
|
2006-01-17 16:56:17 +00:00
|
|
|
|
2006-07-07 18:58:35 +00:00
|
|
|
/**
|
|
|
|
* \brief Lookup the name of a domain
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param id The id of the domain
|
|
|
|
* \param name pointer to store a copy of the name
|
|
|
|
* \param uuid pointer to store a copy of the uuid
|
|
|
|
*
|
|
|
|
* This method looks up the name/uuid of a domain
|
|
|
|
*/
|
|
|
|
int xenDaemonDomainLookupByID(virConnectPtr xend,
|
|
|
|
int id,
|
|
|
|
char **name, unsigned char *uuid);
|
|
|
|
|
|
|
|
|
2006-08-09 15:21:16 +00:00
|
|
|
char *xenDaemonDomainDumpXMLByID(virConnectPtr xend,
|
|
|
|
int domid);
|
|
|
|
|
2006-12-14 01:56:14 +00:00
|
|
|
char *xenDaemonDomainDumpXMLByName(virConnectPtr xend,
|
|
|
|
const char *name);
|
|
|
|
|
2006-01-12 15:38:07 +00:00
|
|
|
/**
|
|
|
|
* \brief Lookup information about the host machine
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \return node info on success; NULL (with errno) on error
|
|
|
|
*
|
|
|
|
* This method returns information about the physical host
|
|
|
|
* machine running Xen.
|
|
|
|
*/
|
2006-03-15 12:13:25 +00:00
|
|
|
struct xend_node *xend_get_node(virConnectPtr xend);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Shutdown physical host machine
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \return 0 on success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This method shuts down the physical machine running Xen.
|
|
|
|
*/
|
2006-03-15 12:13:25 +00:00
|
|
|
int xend_node_shutdown(virConnectPtr xend);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Restarts physical host machine
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \return 0 on success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This method restarts the physical machine running Xen.
|
|
|
|
*/
|
2006-03-15 12:13:25 +00:00
|
|
|
int xend_node_restart(virConnectPtr xend);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Return hypervisor debugging messages
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param buffer A buffer to hold the messages
|
|
|
|
* \param n_buffer Size of buffer (including null terminator)
|
|
|
|
* \return 0 on success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This function will place the debugging messages from the
|
|
|
|
* hypervisor into a buffer with a null terminator.
|
|
|
|
*/
|
2006-03-15 12:13:25 +00:00
|
|
|
int xend_dmesg(virConnectPtr xend, char *buffer, size_t n_buffer);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Clear the hypervisor debugging messages
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \return 0 on success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This function will clear the debugging message ring queue
|
|
|
|
* in the hypervisor.
|
|
|
|
*/
|
2006-03-15 12:13:25 +00:00
|
|
|
int xend_dmesg_clear(virConnectPtr xend);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Obtain the Xend log messages
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param buffer The buffer to hold the messages
|
|
|
|
* \param n_buffer Size of buffer (including null terminator)
|
|
|
|
* \return 0 on success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This function will place the Xend debugging messages into
|
|
|
|
* a buffer with a null terminator.
|
|
|
|
*/
|
2006-03-15 12:13:25 +00:00
|
|
|
int xend_log(virConnectPtr xend, char *buffer, size_t n_buffer);
|
2006-01-12 15:38:07 +00:00
|
|
|
|
2006-09-12 01:16:22 +00:00
|
|
|
char *xend_parse_domain_sexp(virConnectPtr conn, char *root, int xendConfigVersion);
|
2006-08-24 15:05:19 +00:00
|
|
|
|
2006-03-22 13:44:01 +00:00
|
|
|
/* refactored ones */
|
|
|
|
int xenDaemonOpen(virConnectPtr conn, const char *name, int flags);
|
|
|
|
int xenDaemonClose(virConnectPtr conn);
|
2006-06-29 14:44:37 +00:00
|
|
|
int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
|
2006-07-03 11:12:12 +00:00
|
|
|
int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonDomainSuspend(virDomainPtr domain);
|
|
|
|
int xenDaemonDomainResume(virDomainPtr domain);
|
|
|
|
int xenDaemonDomainShutdown(virDomainPtr domain);
|
2006-04-03 13:46:43 +00:00
|
|
|
int xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags);
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonDomainDestroy(virDomainPtr domain);
|
|
|
|
int xenDaemonDomainSave(virDomainPtr domain, const char *filename);
|
|
|
|
int xenDaemonDomainRestore(virConnectPtr conn, const char *filename);
|
2006-04-13 17:18:49 +00:00
|
|
|
int xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory);
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory);
|
|
|
|
int xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
|
2006-08-09 15:21:16 +00:00
|
|
|
char *xenDaemonDomainDumpXML(virDomainPtr domain, int flags);
|
2006-03-23 15:42:10 +00:00
|
|
|
unsigned long xenDaemonDomainGetMaxMemory(virDomainPtr domain);
|
2006-06-29 23:53:31 +00:00
|
|
|
char **xenDaemonListDomainsOld(virConnectPtr xend);
|
2006-03-22 13:44:01 +00:00
|
|
|
|
2006-12-14 01:56:14 +00:00
|
|
|
virDomainPtr xenDaemonDomainDefineXML(virConnectPtr xend, const char *sexpr);
|
|
|
|
int xenDaemonDomainCreate(virDomainPtr domain);
|
|
|
|
int xenDaemonDomainUndefine(virDomainPtr domain);
|
|
|
|
|
2006-08-04 10:41:05 +00:00
|
|
|
int xenDaemonDomainSetVcpus (virDomainPtr domain,
|
2006-08-08 22:22:55 +00:00
|
|
|
unsigned int vcpus);
|
2006-08-04 10:41:05 +00:00
|
|
|
int xenDaemonDomainPinVcpu (virDomainPtr domain,
|
|
|
|
unsigned int vcpu,
|
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen);
|
|
|
|
int xenDaemonDomainGetVcpus (virDomainPtr domain,
|
|
|
|
virVcpuInfoPtr info,
|
|
|
|
int maxinfo,
|
|
|
|
unsigned char *cpumaps,
|
|
|
|
int maplen);
|
|
|
|
|
Fri Jul 6 16:08:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/proxy_internal.c, src/proxy_internal.h,
src.xen_internal.c, src/xen_internal.h,
src/xen_unified.c, src/xen_unified.h,
src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h,
src/xs_internal.c, src/xs_internal.h: The interface
between xen_unified.c and its underlying driver now uses
a custom structure (struct xenUnifiedDriver) instead
of reusing virDriver.
* src/xen_unified.c: virDomainLookup* functions in Xen
now throw VIR_ERR_NO_DOMAIN if the domain does not exist.
* src/xs_internal.c: Fix indentation.
2007-07-06 15:11:22 +00:00
|
|
|
/* xen_unified calls through here. */
|
|
|
|
extern struct xenUnifiedDriver xenDaemonDriver;
|
|
|
|
int xenDaemonInit (void);
|
|
|
|
|
|
|
|
virDomainPtr xenDaemonLookupByID(virConnectPtr conn, int id);
|
|
|
|
virDomainPtr xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid);
|
|
|
|
virDomainPtr xenDaemonLookupByName(virConnectPtr conn, const char *domname);
|
2007-08-21 09:31:12 +00:00
|
|
|
int xenDaemonDomainMigratePrepare (virConnectPtr dconn, char **cookie, int *cookielen, const char *uri_in, char **uri_out, unsigned long flags, const char *dname, unsigned long resource);
|
|
|
|
int xenDaemonDomainMigratePerform (virDomainPtr domain, const char *cookie, int cookielen, const char *uri, unsigned long flags, const char *dname, unsigned long resource);
|
Fri Jul 6 16:08:00 BST 2007 Richard W.M. Jones <rjones@redhat.com>
* src/proxy_internal.c, src/proxy_internal.h,
src.xen_internal.c, src/xen_internal.h,
src/xen_unified.c, src/xen_unified.h,
src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h,
src/xs_internal.c, src/xs_internal.h: The interface
between xen_unified.c and its underlying driver now uses
a custom structure (struct xenUnifiedDriver) instead
of reusing virDriver.
* src/xen_unified.c: virDomainLookup* functions in Xen
now throw VIR_ERR_NO_DOMAIN if the domain does not exist.
* src/xs_internal.c: Fix indentation.
2007-07-06 15:11:22 +00:00
|
|
|
|
2006-01-12 15:38:07 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|