2006-01-12 15:38:07 +00:00
|
|
|
/*
|
2008-07-25 13:17:27 +00:00
|
|
|
* xend_internal.h
|
2006-01-12 15:38:07 +00:00
|
|
|
*
|
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
|
|
|
*
|
2008-07-25 13:17:27 +00:00
|
|
|
* Copyright 2006-2008 Red Hat
|
|
|
|
*
|
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.
|
|
|
|
*/
|
|
|
|
|
2008-07-25 13:17:27 +00:00
|
|
|
#ifndef __XEND_INTERNAL_H_
|
|
|
|
#define __XEND_INTERNAL_H_
|
2006-01-12 15:38:07 +00:00
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2008-07-25 13:17:27 +00:00
|
|
|
#include "internal.h"
|
2008-02-27 04:35:08 +00:00
|
|
|
#include "capabilities.h"
|
2008-07-25 10:49:33 +00:00
|
|
|
#include "domain_conf.h"
|
2008-04-26 14:22:02 +00:00
|
|
|
#include "buf.h"
|
2006-01-13 16:41:01 +00:00
|
|
|
|
2006-01-12 15:38:07 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-07-25 09:51:23 +00:00
|
|
|
int
|
|
|
|
xenDaemonOpen_unix(virConnectPtr conn, 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
|
2008-02-05 19:27:37 +00:00
|
|
|
*
|
2006-01-12 15:38:07 +00:00
|
|
|
* 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,
|
2008-04-10 16:54:54 +00:00
|
|
|
int id,
|
|
|
|
char **name, unsigned char *uuid);
|
2006-07-07 18:58:35 +00:00
|
|
|
|
|
|
|
|
2008-07-25 13:17:27 +00:00
|
|
|
virDomainDefPtr
|
|
|
|
xenDaemonDomainFetch(virConnectPtr xend,
|
|
|
|
int domid,
|
|
|
|
const char *name,
|
|
|
|
const char *cpus);
|
2006-12-14 01:56:14 +00:00
|
|
|
|
2008-04-26 14:22:02 +00:00
|
|
|
int xend_parse_sexp_desc_char(virConnectPtr conn,
|
|
|
|
virBufferPtr buf,
|
|
|
|
const char *devtype,
|
|
|
|
int portNum,
|
|
|
|
const char *value,
|
|
|
|
const char *tty);
|
|
|
|
|
2008-07-25 10:49:33 +00:00
|
|
|
virDomainDefPtr
|
|
|
|
xenDaemonParseSxprString(virConnectPtr conn,
|
|
|
|
const char *sexpr,
|
|
|
|
int xendConfigVersion);
|
2008-07-25 13:50:08 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
xenDaemonParseSxprSound(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
const char *str);
|
|
|
|
virDomainChrDefPtr
|
|
|
|
xenDaemonParseSxprChar(virConnectPtr conn,
|
|
|
|
const char *value,
|
|
|
|
const char *tty);
|
|
|
|
|
2008-07-25 14:10:49 +00:00
|
|
|
int
|
|
|
|
xenDaemonFormatSxprChr(virConnectPtr conn,
|
|
|
|
virDomainChrDefPtr def,
|
|
|
|
virBufferPtr buf);
|
|
|
|
int
|
|
|
|
xenDaemonFormatSxprSound(virConnectPtr conn,
|
|
|
|
virDomainSoundDefPtr sound,
|
|
|
|
virBufferPtr buf);
|
|
|
|
|
2008-07-25 13:17:27 +00:00
|
|
|
char *
|
|
|
|
xenDaemonFormatSxpr(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
int xendConfigVersion);
|
2006-08-24 15:05:19 +00:00
|
|
|
|
2008-05-07 14:04:40 +00:00
|
|
|
int is_sound_model_valid(const char *model);
|
|
|
|
int is_sound_model_conflict(const char *model, const char *soundstr);
|
|
|
|
|
|
|
|
|
2006-03-22 13:44:01 +00:00
|
|
|
/* refactored ones */
|
2007-12-05 18:28:05 +00:00
|
|
|
int xenDaemonOpen(virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags);
|
2006-03-22 13:44:01 +00:00
|
|
|
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);
|
2008-02-27 04:35:08 +00:00
|
|
|
int xenDaemonNodeGetTopology(virConnectPtr conn, virCapsPtr caps);
|
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);
|
2007-10-31 09:39:13 +00:00
|
|
|
char *xenDaemonDomainDumpXML(virDomainPtr domain, int flags, const char *cpus);
|
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,
|
2008-04-10 16:54:54 +00:00
|
|
|
unsigned int vcpus);
|
2006-08-04 10:41:05 +00:00
|
|
|
int xenDaemonDomainPinVcpu (virDomainPtr domain,
|
2008-04-10 16:54:54 +00:00
|
|
|
unsigned int vcpu,
|
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen);
|
2006-08-04 10:41:05 +00:00
|
|
|
int xenDaemonDomainGetVcpus (virDomainPtr domain,
|
2008-04-10 16:54:54 +00:00
|
|
|
virVcpuInfoPtr info,
|
|
|
|
int maxinfo,
|
|
|
|
unsigned char *cpumaps,
|
|
|
|
int maplen);
|
2008-05-09 08:17:18 +00:00
|
|
|
int xenDaemonDomainGetAutostart (virDomainPtr dom,
|
|
|
|
int *autostart);
|
|
|
|
int xenDaemonDomainSetAutostart (virDomainPtr domain,
|
|
|
|
int autostart);
|
2006-08-04 10:41:05 +00:00
|
|
|
|
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
|
|
|
|
virDomainBlockPeek call
* configure.in: Document AC_SYS_LARGEFILE.
* docs/hvsupport.html.in: Document HV support for virDomainBlockPeek.
* include/libvirt/libvirt.h.in, src/driver.h, src/libvirt.c,
src/libvirt_sym.version: Add virDomainBlockPeek infrastructure.
* src/qemu_driver.c, src/test.c: Null versions of this call.
* src/xen_unified.c, src/xend_internal.c, src/xend_internal.h,
src/xm_internal.c, src/xm_internal.h: Xen implementation.
* tests/sexpr2xmldata/sexpr2xml-curmem.xml,
tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml: XML output
has been reordered slightly in the Xen driver, but should be
functionally the same.
2008-06-05 13:17:45 +00:00
|
|
|
int xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path, unsigned long long offset, size_t size, void *buffer);
|
|
|
|
|
2008-07-25 13:17:27 +00:00
|
|
|
#endif /* __XEND_INTERNAL_H_ */
|