2006-01-12 09:38:07 -06:00
|
|
|
/*
|
|
|
|
* libxend/xend.h -- Xend library
|
|
|
|
*
|
2006-03-22 07:44:01 -06:00
|
|
|
* Copyright (C) 2005,2006
|
2006-01-12 09:38:07 -06:00
|
|
|
*
|
|
|
|
* Anthony Liguori <aliguori@us.ibm.com>
|
2006-03-22 07:44:01 -06:00
|
|
|
* Daniel Veillard <veillard@redhat.com>
|
2006-01-12 09:38:07 -06: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 10:02:18 -05:00
|
|
|
#include "libvirt/libvirt.h"
|
2006-01-13 10:41:01 -06:00
|
|
|
|
2006-01-12 09:38:07 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
Use the default setting as determined by Xend.
|
|
|
|
*/
|
|
|
|
#define XEND_DEFAULT 0
|
|
|
|
|
|
|
|
/**
|
|
|
|
This structure represents a virtual block device.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
struct xend_device_vbd {
|
|
|
|
|
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The domain ID of the backend.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int backend;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
A URI representing the device. This is typically in the form
|
|
|
|
file:/path/to/image or phy:/dev/device
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *uname;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The name (or number) of the device to expose to the frontend.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *dev;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
A flag specifying the permissions to expose the device with.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
virDeviceMode mode;
|
|
|
|
};
|
2006-01-12 09:38:07 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
This structure represents a range of PIO to enable for a guest.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
struct xend_device_ioport {
|
|
|
|
|
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The beginning address of an ioport range to enable.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
uint16_t from;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The ending address of an ioport range to enable.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
uint16_t to;
|
|
|
|
};
|
2006-01-12 09:38:07 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
This structure represents a virtual network interface configuration.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
struct xend_device_vif {
|
|
|
|
|
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
A string representing the domain that will serve as the backend for
|
|
|
|
this device.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int backend;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The name of the bridge device to pass to the network script.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *bridge;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The ip address to configure the virtal network device with.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *ip;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The mac address to use for the virtual network device.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
uint8_t mac[6];
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The path to the network script that is to be used for initializing
|
|
|
|
the network device.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *script;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The name of the vif. The primary use for this is to allow the user
|
|
|
|
to operate on vifs by name.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *vifname;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct xend_domain_live {
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true is domain is currently scheduled.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool running;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true is domain has crashed.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool crashed;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true if domain has been shutdown.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool poweroff;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true if domain has requested a reboot.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool reboot;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true if domain has requested a suspend.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool suspend;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true if domain is blocked on IO
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool blocked;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true if domain has been destroyed but resources are not
|
|
|
|
fully deallocated.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool dying;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
true if domain is paused.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
bool paused;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
the amount of time the domain has been running (in seconds)
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
double cpu_time;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
the wall clock time since the domain was created (in seconds)
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
double up_time;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
the time (in seconds since epoch) the domain was created
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
double start_time;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
the number of enabled VCPUs
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int online_vcpus;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
the total number of available VCPUs
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int vcpu_avail;
|
2006-01-17 10:56:17 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-17 10:56:17 -06:00
|
|
|
the domain id number
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int id;
|
|
|
|
};
|
2006-01-12 09:38:07 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
This structure represents the configuration of a domain. It's primary
|
|
|
|
purpose (currently) is for domain creation.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
struct xend_domain {
|
|
|
|
|
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The name of the domain.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *name;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The amount of memory to assign to the domain before creation.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
uint64_t memory;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The maximum amount of memory that can be given to the domain
|
|
|
|
while it's running. Please note that a domain can increase its
|
|
|
|
memory on its own while running up to this value.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
uint64_t max_memory;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The uuid to use to identify the domain. This is compatible with
|
|
|
|
libuuid's uuid_t and should be able to be used interchangably.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
unsigned char *uuid;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The ssidref to assign to the domain.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int ssidref;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The action to perform when the domain powers off.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
virDomainRestart on_poweroff;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The action to perform when the domain reboots.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
virDomainRestart on_reboot;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The action to perform when the domain crashes.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
virDomainRestart on_crash;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of VCPUs to assign to the domain.
|
|
|
|
|
|
|
|
Required.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int vcpus;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/* FIXME cpus */
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
virDomainKernel image;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of VBDs pointed to be vbds.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
size_t n_vbds;
|
|
|
|
struct xend_device_vbd *vbds;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of IO port ranges pointed to by ioports.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
size_t n_ioports;
|
|
|
|
struct xend_device_ioport *ioports;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of VIFs pointed to be vifs.
|
|
|
|
|
|
|
|
Optional.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
size_t n_vifs;
|
|
|
|
struct xend_device_vif *vifs;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
A pointer to run-time information about the domain.
|
|
|
|
|
|
|
|
Only set by xen_get_domain().
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
struct xend_domain_live *live;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum xend_node_system {
|
|
|
|
XEND_SYSTEM_LINUX = 1,
|
|
|
|
};
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
struct xend_node {
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
An enumeration value specifying the host system.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
enum xend_node_system system;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The DNS host name.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *host;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The dom0 kernel release string.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *release;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The result of uname -v.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *version;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The machine type.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *machine;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of physical cpus.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int nr_cpus;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of NUMA nodes.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int nr_nodes;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of sockets per NUMA node.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int sockets_per_node;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of cores per NUMA socket.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int cores_per_socket;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The number of hyperthreads per core.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int threads_per_core;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The clock rating (in megahertz) of each core.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int cpu_mhz;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
I honestly don't know what this is.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *hw_caps;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The total memory (in bytes).
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
uint64_t total_memory;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The free memory (in bytes).
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
uint64_t free_memory;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The Xen major version number.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int xen_major;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The Xen minor version number.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int xen_minor;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The Xen extra version number.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int xen_extra;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
A string descirbing the Xen platform.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *xen_caps;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
Dunno.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *platform_params;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The build changeset.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *xen_changeset;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The compiler version.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *cc_compiler;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The user that compiled this binary.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *cc_compile_by;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The system this binary was built on.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *cc_compile_domain;
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-03-15 06:13:25 -06:00
|
|
|
/**
|
2006-01-12 09:38:07 -06:00
|
|
|
The date that this binary was built on.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *cc_compile_date;
|
|
|
|
};
|
2006-01-12 09:38:07 -06:00
|
|
|
|
|
|
|
/**
|
2006-01-13 10:41:01 -06:00
|
|
|
* \brief Setup the connection to a xend instance via TCP
|
2006-01-12 09:38:07 -06:00
|
|
|
* \param host The host name to connect to
|
|
|
|
* \param port The port number to connect to
|
2006-01-13 10:41:01 -06:00
|
|
|
* \return 0 in case of success, -1 in case of error
|
2006-01-12 09:38:07 -06:00
|
|
|
*
|
|
|
|
* This method creates a new Xend instance via TCP.
|
|
|
|
*
|
|
|
|
* This function may not fail if Xend is not running.
|
|
|
|
*
|
2006-03-22 07:44:01 -06:00
|
|
|
* Make sure to call xenDaemonClose().
|
2006-01-12 09:38:07 -06:00
|
|
|
*/
|
2006-03-22 07:44:01 -06:00
|
|
|
int xenDaemonOpen_tcp(virConnectPtr xend, const char *host, int port);
|
2006-01-12 09:38:07 -06:00
|
|
|
|
|
|
|
/**
|
2006-01-13 10:41:01 -06:00
|
|
|
* \brief Setup the connection to xend instance via a Unix domain socket
|
2006-01-12 09:38:07 -06:00
|
|
|
* \param path The path to the domain socket
|
2006-01-13 10:41:01 -06:00
|
|
|
* \return 0 in case of success, -1 in case of error
|
2006-01-12 09:38:07 -06: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 07:44:01 -06:00
|
|
|
* Make sure to call xenDaemonClose().
|
2006-01-12 09:38:07 -06:00
|
|
|
*/
|
2006-03-22 07:44:01 -06:00
|
|
|
int xenDaemonOpen_unix(virConnectPtr xend, const char *path);
|
2006-01-12 09:38:07 -06: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 06:13:25 -06:00
|
|
|
int xend_wait_for_devices(virConnectPtr xend, const char *name);
|
2006-01-12 09:38:07 -06:00
|
|
|
|
|
|
|
/**
|
2006-03-22 07:44:01 -06:00
|
|
|
* \brief Rename a domain
|
2006-01-12 09:38:07 -06:00
|
|
|
* \param xend A xend instance
|
|
|
|
* \param oldname The domain's name
|
|
|
|
* \param name The new name
|
|
|
|
* \return 0 for success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This method allows a domain to have its name changed after creation.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int xend_rename(virConnectPtr xend, const char *oldname,
|
|
|
|
const char *name);
|
2006-01-12 09:38:07 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Sends a SYSRQ to a domain
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param name The domain's name
|
|
|
|
* \param key The key that was held during the SYSRQ
|
|
|
|
* \return 0 for success; -1 (with errno) on error
|
|
|
|
*
|
|
|
|
* This method simulates the pressing of a SYSRQ sequence.
|
|
|
|
*/
|
2006-03-15 06:13:25 -06:00
|
|
|
int xend_sysrq(virConnectPtr xend, const char *name, const char *key);
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-02-16 16:50:52 -06: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 07:44:01 -06:00
|
|
|
* xenDaemonResumeDomain() to begin execution.
|
2006-02-16 16:50:52 -06:00
|
|
|
*/
|
2006-03-22 07:44:01 -06:00
|
|
|
int xenDaemonDomainCreateLinux(virConnectPtr xend, const char *sexpr);
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-01-19 04:23:15 -06:00
|
|
|
/**
|
|
|
|
* \brief Lookup the id of a domain
|
|
|
|
* \param xend A xend instance
|
|
|
|
* \param name The name of the domain
|
2006-02-23 04:13:55 -06:00
|
|
|
* \param uuid pointer to store a copy of the uuid
|
2006-01-19 04:23:15 -06:00
|
|
|
* \return the id number on success; -1 (with errno) on error
|
|
|
|
*
|
2006-02-23 04:13:55 -06:00
|
|
|
* This method looks up the ids of a domain
|
2006-01-19 04:23:15 -06:00
|
|
|
*/
|
2006-04-13 12:18:49 -05:00
|
|
|
int xenDaemonDomainLookupByName_ids(virConnectPtr xend,
|
2006-03-15 06:13:25 -06:00
|
|
|
const char *name, unsigned char *uuid);
|
2006-01-19 04:23:15 -06:00
|
|
|
|
2006-01-17 10:56:17 -06:00
|
|
|
|
2006-07-07 13:58:35 -05: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 10:21:16 -05:00
|
|
|
char *xenDaemonDomainDumpXMLByID(virConnectPtr xend,
|
|
|
|
int domid);
|
|
|
|
|
2006-01-12 09:38:07 -06: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 06:13:25 -06:00
|
|
|
struct xend_node *xend_get_node(virConnectPtr xend);
|
2006-01-12 09:38:07 -06: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 06:13:25 -06:00
|
|
|
int xend_node_shutdown(virConnectPtr xend);
|
2006-01-12 09:38:07 -06: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 06:13:25 -06:00
|
|
|
int xend_node_restart(virConnectPtr xend);
|
2006-01-12 09:38:07 -06: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 06:13:25 -06:00
|
|
|
int xend_dmesg(virConnectPtr xend, char *buffer, size_t n_buffer);
|
2006-01-12 09:38:07 -06: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 06:13:25 -06:00
|
|
|
int xend_dmesg_clear(virConnectPtr xend);
|
2006-01-12 09:38:07 -06: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 06:13:25 -06:00
|
|
|
int xend_log(virConnectPtr xend, char *buffer, size_t n_buffer);
|
2006-01-12 09:38:07 -06:00
|
|
|
|
2006-11-15 15:03:34 -06:00
|
|
|
int xend_get_config_version(virConnectPtr conn);
|
2006-09-11 20:16:22 -05:00
|
|
|
char *xend_parse_domain_sexp(virConnectPtr conn, char *root, int xendConfigVersion);
|
2006-08-24 10:05:19 -05:00
|
|
|
|
2006-03-22 07:44:01 -06:00
|
|
|
/* refactored ones */
|
2006-03-27 09:24:36 -06:00
|
|
|
void xenDaemonRegister(void);
|
2006-03-22 07:44:01 -06:00
|
|
|
int xenDaemonOpen(virConnectPtr conn, const char *name, int flags);
|
|
|
|
int xenDaemonClose(virConnectPtr conn);
|
2006-06-29 09:44:37 -05:00
|
|
|
int xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer);
|
2006-07-03 06:12:12 -05:00
|
|
|
int xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
|
2006-03-22 07:44:01 -06:00
|
|
|
int xenDaemonDomainSuspend(virDomainPtr domain);
|
|
|
|
int xenDaemonDomainResume(virDomainPtr domain);
|
|
|
|
int xenDaemonDomainShutdown(virDomainPtr domain);
|
2006-04-03 08:46:43 -05:00
|
|
|
int xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags);
|
2006-03-22 07:44:01 -06:00
|
|
|
int xenDaemonDomainDestroy(virDomainPtr domain);
|
|
|
|
int xenDaemonDomainSave(virDomainPtr domain, const char *filename);
|
|
|
|
int xenDaemonDomainRestore(virConnectPtr conn, const char *filename);
|
2006-04-13 12:18:49 -05:00
|
|
|
int xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory);
|
2006-03-22 07:44:01 -06:00
|
|
|
int xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory);
|
|
|
|
int xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info);
|
2006-08-09 10:21:16 -05:00
|
|
|
char *xenDaemonDomainDumpXML(virDomainPtr domain, int flags);
|
2006-03-23 09:42:10 -06:00
|
|
|
virDomainPtr xenDaemonDomainLookupByName(virConnectPtr conn, const char *domname);
|
|
|
|
unsigned long xenDaemonDomainGetMaxMemory(virDomainPtr domain);
|
2006-06-29 18:53:31 -05:00
|
|
|
char **xenDaemonListDomainsOld(virConnectPtr xend);
|
2006-03-22 07:44:01 -06:00
|
|
|
|
2006-08-04 05:41:05 -05:00
|
|
|
int xenDaemonDomainSetVcpus (virDomainPtr domain,
|
2006-08-08 17:22:55 -05:00
|
|
|
unsigned int vcpus);
|
2006-08-04 05:41:05 -05: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);
|
|
|
|
|
2006-01-12 09:38:07 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|