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
|
|
|
*
|
2013-05-14 23:42:12 +00:00
|
|
|
* Copyright (C) 2006-2008, 2010-2013 Red Hat, Inc.
|
|
|
|
* Copyright (C) 2005,2006 Anthony Liguori <aliguori@us.ibm.com>
|
|
|
|
* and Daniel Veillard <veillard@redhat.com>
|
2006-01-12 15:38:07 +00:00
|
|
|
*
|
2013-05-14 23:42:12 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2006-01-12 15:38:07 +00:00
|
|
|
*
|
2013-05-14 23:42:12 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2008-07-25 13:17:27 +00:00
|
|
|
*
|
2013-05-14 23:42:12 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see
|
|
|
|
* <http://www.gnu.org/licenses/>.
|
2006-01-12 15:38:07 +00:00
|
|
|
*/
|
|
|
|
|
2008-07-25 13:17:27 +00:00
|
|
|
#ifndef __XEND_INTERNAL_H_
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __XEND_INTERNAL_H_
|
2006-01-12 15:38:07 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include <sys/types.h>
|
|
|
|
# include <stdint.h>
|
2006-01-12 15:38:07 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "capabilities.h"
|
|
|
|
# include "domain_conf.h"
|
|
|
|
# include "driver.h"
|
2012-12-04 12:04:07 +00:00
|
|
|
# include "virbuffer.h"
|
2012-02-24 18:48:55 +00:00
|
|
|
# include "viruri.h"
|
2006-01-13 16:41:01 +00:00
|
|
|
|
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
|
2011-07-20 22:53:31 +00:00
|
|
|
* its memory. This does not guarantee, though, that the devices
|
2006-01-12 15:38:07 +00:00
|
|
|
* 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
|
|
|
*/
|
2008-10-10 09:32:27 +00:00
|
|
|
int xenDaemonDomainCreateXML(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
|
|
|
|
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-07-25 13:50:08 +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 */
|
2013-04-30 13:41:48 +00:00
|
|
|
int xenDaemonOpen(virConnectPtr conn, virConnectAuthPtr auth,
|
|
|
|
unsigned int flags);
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonClose(virConnectPtr conn);
|
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);
|
2013-05-01 09:54:30 +00:00
|
|
|
int xenDaemonDomainSuspend(virConnectPtr conn, virDomainDefPtr def);
|
|
|
|
int xenDaemonDomainResume(virConnectPtr conn, virDomainDefPtr def);
|
|
|
|
int xenDaemonDomainShutdown(virConnectPtr conn, virDomainDefPtr def);
|
|
|
|
int xenDaemonDomainReboot(virConnectPtr conn, virDomainDefPtr def);
|
|
|
|
int xenDaemonDomainDestroy(virConnectPtr conn, virDomainDefPtr def);
|
2013-05-01 13:03:26 +00:00
|
|
|
int xenDaemonDomainSave(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
const char *filename);
|
2013-05-02 10:26:40 +00:00
|
|
|
int xenDaemonDomainCoreDump(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
const char *filename,
|
2011-07-21 21:11:32 +00:00
|
|
|
unsigned int flags);
|
2006-03-22 13:44:01 +00:00
|
|
|
int xenDaemonDomainRestore(virConnectPtr conn, const char *filename);
|
2013-05-01 10:29:08 +00:00
|
|
|
int xenDaemonDomainSetMemory(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
unsigned long memory);
|
|
|
|
int xenDaemonDomainSetMaxMemory(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
unsigned long memory);
|
|
|
|
int xenDaemonDomainGetInfo(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
virDomainInfoPtr info);
|
|
|
|
int xenDaemonDomainGetState(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2011-05-02 09:35:29 +00:00
|
|
|
int *state,
|
2013-04-30 15:42:29 +00:00
|
|
|
int *reason);
|
2013-05-01 13:15:10 +00:00
|
|
|
virDomainDefPtr xenDaemonDomainGetXMLDesc(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
const char *cpus);
|
2013-05-01 10:29:08 +00:00
|
|
|
unsigned long long xenDaemonDomainGetMaxMemory(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def);
|
2006-06-29 23:53:31 +00:00
|
|
|
char **xenDaemonListDomainsOld(virConnectPtr xend);
|
2006-03-22 13:44:01 +00:00
|
|
|
|
2013-05-01 10:29:08 +00:00
|
|
|
char *xenDaemonDomainGetOSType(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def);
|
2013-04-30 15:04:36 +00:00
|
|
|
|
2013-04-30 16:31:40 +00:00
|
|
|
int xenDaemonNumOfDefinedDomains(virConnectPtr conn);
|
|
|
|
int xenDaemonListDefinedDomains(virConnectPtr conn,
|
|
|
|
char **const names,
|
|
|
|
int maxnames);
|
|
|
|
|
2013-05-02 09:56:31 +00:00
|
|
|
int xenDaemonAttachDeviceFlags(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2013-04-30 16:43:07 +00:00
|
|
|
const char *xml,
|
|
|
|
unsigned int flags);
|
2013-05-02 09:56:31 +00:00
|
|
|
int xenDaemonDetachDeviceFlags(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2013-04-30 16:43:07 +00:00
|
|
|
const char *xml,
|
|
|
|
unsigned int flags);
|
|
|
|
|
2013-05-01 13:15:10 +00:00
|
|
|
int xenDaemonDomainDefineXML(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def);
|
2013-05-01 13:03:26 +00:00
|
|
|
int xenDaemonDomainCreate(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def);
|
2013-05-01 13:15:10 +00:00
|
|
|
int xenDaemonDomainUndefine(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def);
|
2006-12-14 01:56:14 +00:00
|
|
|
|
2013-05-01 17:37:29 +00:00
|
|
|
int xenDaemonDomainSetVcpus (virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2008-04-10 16:54:54 +00:00
|
|
|
unsigned int vcpus);
|
2013-05-01 17:37:29 +00:00
|
|
|
int xenDaemonDomainSetVcpusFlags (virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2010-10-14 22:17:18 +00:00
|
|
|
unsigned int vcpus,
|
|
|
|
unsigned int flags);
|
2013-05-01 17:37:29 +00:00
|
|
|
int xenDaemonDomainPinVcpu (virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2008-04-10 16:54:54 +00:00
|
|
|
unsigned int vcpu,
|
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen);
|
2013-05-01 17:37:29 +00:00
|
|
|
int xenDaemonDomainGetVcpusFlags (virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2010-10-06 23:54:41 +00:00
|
|
|
unsigned int flags);
|
2013-05-01 17:37:29 +00:00
|
|
|
int xenDaemonDomainGetVcpus (virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2008-04-10 16:54:54 +00:00
|
|
|
virVcpuInfoPtr info,
|
|
|
|
int maxinfo,
|
|
|
|
unsigned char *cpumaps,
|
|
|
|
int maplen);
|
2013-05-02 09:56:31 +00:00
|
|
|
int xenDaemonUpdateDeviceFlags(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
const char *xml,
|
2011-07-21 21:11:32 +00:00
|
|
|
unsigned int flags);
|
2013-05-02 10:05:55 +00:00
|
|
|
int xenDaemonDomainGetAutostart(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
int *autostart);
|
|
|
|
int xenDaemonDomainSetAutostart(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
int autostart);
|
2006-08-04 10:41:05 +00:00
|
|
|
|
2013-05-01 13:15:10 +00:00
|
|
|
int xenDaemonCreateXML(virConnectPtr conn, virDomainDefPtr def);
|
2013-05-01 09:31:23 +00:00
|
|
|
virDomainDefPtr xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid);
|
|
|
|
virDomainDefPtr xenDaemonLookupByName(virConnectPtr conn, const char *domname);
|
2013-05-01 13:15:10 +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 (virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
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
|
|
|
|
2013-05-02 10:24:49 +00:00
|
|
|
int xenDaemonDomainBlockPeek(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
const char *path,
|
|
|
|
unsigned long long offset,
|
|
|
|
size_t size,
|
|
|
|
void *buffer);
|
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
|
|
|
|
2013-05-02 10:13:39 +00:00
|
|
|
char * xenDaemonGetSchedulerType(virConnectPtr conn,
|
|
|
|
int *nparams);
|
|
|
|
int xenDaemonGetSchedulerParameters(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2013-04-30 16:52:19 +00:00
|
|
|
virTypedParameterPtr params,
|
|
|
|
int *nparams);
|
2013-05-02 10:13:39 +00:00
|
|
|
int xenDaemonSetSchedulerParameters(virConnectPtr conn,
|
|
|
|
virDomainDefPtr def,
|
2013-04-30 16:52:19 +00:00
|
|
|
virTypedParameterPtr params,
|
|
|
|
int nparams);
|
|
|
|
|
2008-07-25 13:17:27 +00:00
|
|
|
#endif /* __XEND_INTERNAL_H_ */
|