xend_internal.h 6.3 KB
Newer Older
1 2 3
/*
 * libxend/xend.h -- Xend library
 *
4
 * Copyright (C) 2005,2006
5 6
 *
 *      Anthony Liguori <aliguori@us.ibm.com>
7
 *	Daniel Veillard <veillard@redhat.com>
8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 *  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>

21
#include "libvirt/libvirt.h"
22
#include "capabilities.h"
23
#include "buf.h"
24

25 26 27 28
#ifdef __cplusplus
extern "C" {
#endif

29 30
int
xenDaemonOpen_unix(virConnectPtr conn, const char *path);
31 32 33 34 35 36

/**
 * \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
37
 *
38 39 40 41 42 43
 * 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.
 */
44
    int xend_wait_for_devices(virConnectPtr xend, const char *name);
45 46


47 48 49 50 51 52 53 54
/**
 * \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
55
 * xenDaemonResumeDomain() to begin execution.
56
 */
57
    int xenDaemonDomainCreateLinux(virConnectPtr xend, const char *sexpr);
58

59 60 61 62
/**
 * \brief Lookup the id of a domain
 * \param xend A xend instance
 * \param name The name of the domain
63
 * \param uuid pointer to store a copy of the uuid
64 65
 * \return the id number on success; -1 (with errno) on error
 *
66
 * This method looks up the ids of a domain
67
 */
68
int xenDaemonDomainLookupByName_ids(virConnectPtr xend,
69
                            const char *name, unsigned char *uuid);
70

71

72 73 74 75 76 77 78 79 80 81
/**
 * \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,
82 83
                              int id,
                              char **name, unsigned char *uuid);
84 85


86
char *xenDaemonDomainDumpXMLByID(virConnectPtr xend,
87 88 89
                                 int domid,
                                 int flags,
                                 const char *cpus);
90

91
char *xenDaemonDomainDumpXMLByName(virConnectPtr xend,
92 93 94
                                   const char *name,
                                   int flags,
                                   const char *cpus);
95

96 97 98 99 100 101 102
    int xend_parse_sexp_desc_char(virConnectPtr conn,
                                  virBufferPtr buf,
                                  const char *devtype,
                                  int portNum,
                                  const char *value,
                                  const char *tty);

103
  char *xend_parse_domain_sexp(virConnectPtr conn,  char *root, int xendConfigVersion);
104

D
Daniel Veillard 已提交
105 106 107 108 109
  int is_sound_model_valid(const char *model);
  int is_sound_model_conflict(const char *model, const char *soundstr);
  char *sound_string_to_xml(const char *sound);


110
/* refactored ones */
111
int xenDaemonOpen(virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags);
112
int xenDaemonClose(virConnectPtr conn);
113
int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
114
int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
115
int xenDaemonNodeGetTopology(virConnectPtr conn, virCapsPtr caps);
116 117 118
int xenDaemonDomainSuspend(virDomainPtr domain);
int xenDaemonDomainResume(virDomainPtr domain);
int xenDaemonDomainShutdown(virDomainPtr domain);
119
int xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags);
120 121 122
int xenDaemonDomainDestroy(virDomainPtr domain);
int xenDaemonDomainSave(virDomainPtr domain, const char *filename);
int xenDaemonDomainRestore(virConnectPtr conn, const char *filename);
123
int xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory);
124 125
int xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory);
int xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
126
char *xenDaemonDomainDumpXML(virDomainPtr domain, int flags, const char *cpus);
127
unsigned long xenDaemonDomainGetMaxMemory(virDomainPtr domain);
128
char **xenDaemonListDomainsOld(virConnectPtr xend);
129

130 131 132 133
virDomainPtr xenDaemonDomainDefineXML(virConnectPtr xend, const char *sexpr);
int xenDaemonDomainCreate(virDomainPtr domain);
int xenDaemonDomainUndefine(virDomainPtr domain);

134
int	xenDaemonDomainSetVcpus		(virDomainPtr domain,
135
                                         unsigned int vcpus);
136
int	xenDaemonDomainPinVcpu		(virDomainPtr domain,
137 138 139
                                         unsigned int vcpu,
                                         unsigned char *cpumap,
                                         int maplen);
140
int	xenDaemonDomainGetVcpus		(virDomainPtr domain,
141 142 143 144
                                         virVcpuInfoPtr info,
                                         int maxinfo,
                                         unsigned char *cpumaps,
                                         int maplen);
145 146 147 148
int xenDaemonDomainGetAutostart          (virDomainPtr dom,
                                          int *autostart);
int xenDaemonDomainSetAutostart          (virDomainPtr domain,
                                          int autostart);
149

150 151 152 153 154 155 156
/* 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);
157 158
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);
159

R
Richard W.M. Jones 已提交
160 161
int xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, unsigned long long offset, size_t size, void *buffer);

162 163 164 165
#ifdef __cplusplus
}
#endif
#endif