2008-07-11 16:23:36 +00:00
|
|
|
/*
|
|
|
|
* domain_conf.h: domain XML processing
|
|
|
|
*
|
2010-03-15 20:42:01 +00:00
|
|
|
* Copyright (C) 2006-2008, 2010 Red Hat, Inc.
|
2008-07-11 16:23:36 +00:00
|
|
|
* Copyright (C) 2006-2008 Daniel P. Berrange
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
* Author: Daniel P. Berrange <berrange@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DOMAIN_CONF_H
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __DOMAIN_CONF_H
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include <libxml/parser.h>
|
|
|
|
# include <libxml/tree.h>
|
|
|
|
# include <libxml/xpath.h>
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "capabilities.h"
|
|
|
|
# include "storage_encryption_conf.h"
|
|
|
|
# include "cpu_conf.h"
|
|
|
|
# include "util.h"
|
|
|
|
# include "threads.h"
|
|
|
|
# include "hash.h"
|
|
|
|
# include "network.h"
|
2010-03-25 17:46:07 +00:00
|
|
|
# include "nwfilter_params.h"
|
|
|
|
# include "nwfilter_conf.h"
|
2010-05-25 21:37:00 +00:00
|
|
|
# include "macvtap.h"
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2009-07-17 21:08:33 +00:00
|
|
|
/* Private component of virDomainXMLFlags */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_XML_INTERNAL_STATUS = (1<<16), /* dump internal domain status information */
|
|
|
|
} virDomainXMLInternalFlags;
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Different types of hypervisor */
|
|
|
|
/* NB: Keep in sync with virDomainVirtTypeToString impl */
|
|
|
|
enum virDomainVirtType {
|
|
|
|
VIR_DOMAIN_VIRT_QEMU,
|
|
|
|
VIR_DOMAIN_VIRT_KQEMU,
|
|
|
|
VIR_DOMAIN_VIRT_KVM,
|
|
|
|
VIR_DOMAIN_VIRT_XEN,
|
|
|
|
VIR_DOMAIN_VIRT_LXC,
|
|
|
|
VIR_DOMAIN_VIRT_UML,
|
|
|
|
VIR_DOMAIN_VIRT_OPENVZ,
|
|
|
|
VIR_DOMAIN_VIRT_VSERVER,
|
|
|
|
VIR_DOMAIN_VIRT_LDOM,
|
|
|
|
VIR_DOMAIN_VIRT_TEST,
|
|
|
|
VIR_DOMAIN_VIRT_VMWARE,
|
|
|
|
VIR_DOMAIN_VIRT_HYPERV,
|
2009-04-17 16:09:07 +00:00
|
|
|
VIR_DOMAIN_VIRT_VBOX,
|
2009-05-25 11:56:00 +00:00
|
|
|
VIR_DOMAIN_VIRT_ONE,
|
2009-07-24 14:17:06 +00:00
|
|
|
VIR_DOMAIN_VIRT_PHYP,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_VIRT_LAST,
|
|
|
|
};
|
|
|
|
|
2009-11-30 18:35:58 +00:00
|
|
|
enum virDomainDeviceAddressType {
|
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE,
|
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI,
|
2009-12-01 16:56:24 +00:00
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE,
|
2010-02-18 16:52:03 +00:00
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL,
|
2009-11-30 18:35:58 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainDevicePCIAddress virDomainDevicePCIAddress;
|
|
|
|
typedef virDomainDevicePCIAddress *virDomainDevicePCIAddressPtr;
|
|
|
|
struct _virDomainDevicePCIAddress {
|
|
|
|
unsigned int domain;
|
|
|
|
unsigned int bus;
|
|
|
|
unsigned int slot;
|
|
|
|
unsigned int function;
|
|
|
|
};
|
|
|
|
|
2009-12-01 16:56:24 +00:00
|
|
|
typedef struct _virDomainDeviceDriveAddress virDomainDeviceDriveAddress;
|
|
|
|
typedef virDomainDeviceDriveAddress *virDomainDeviceDriveAddressPtr;
|
|
|
|
struct _virDomainDeviceDriveAddress {
|
|
|
|
unsigned int controller;
|
|
|
|
unsigned int bus;
|
|
|
|
unsigned int unit;
|
|
|
|
};
|
|
|
|
|
2010-02-18 16:52:03 +00:00
|
|
|
typedef struct _virDomainDeviceVirtioSerialAddress virDomainDeviceVirtioSerialAddress;
|
|
|
|
typedef virDomainDeviceVirtioSerialAddress *virDomainDeviceVirtioSerialAddressPtr;
|
|
|
|
struct _virDomainDeviceVirtioSerialAddress {
|
|
|
|
unsigned int controller;
|
|
|
|
unsigned int bus;
|
2010-06-02 15:58:39 +00:00
|
|
|
unsigned int port;
|
2010-02-18 16:52:03 +00:00
|
|
|
};
|
|
|
|
|
2009-11-30 18:35:58 +00:00
|
|
|
typedef struct _virDomainDeviceInfo virDomainDeviceInfo;
|
|
|
|
typedef virDomainDeviceInfo *virDomainDeviceInfoPtr;
|
|
|
|
struct _virDomainDeviceInfo {
|
2010-01-08 15:53:53 +00:00
|
|
|
char *alias;
|
2009-11-30 18:35:58 +00:00
|
|
|
int type;
|
|
|
|
union {
|
|
|
|
virDomainDevicePCIAddress pci;
|
2009-12-01 16:56:24 +00:00
|
|
|
virDomainDeviceDriveAddress drive;
|
2010-02-18 16:52:03 +00:00
|
|
|
virDomainDeviceVirtioSerialAddress vioserial;
|
2009-11-30 18:35:58 +00:00
|
|
|
} addr;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Two types of disk backends */
|
|
|
|
enum virDomainDiskType {
|
|
|
|
VIR_DOMAIN_DISK_TYPE_BLOCK,
|
|
|
|
VIR_DOMAIN_DISK_TYPE_FILE,
|
2009-11-16 18:08:29 +00:00
|
|
|
VIR_DOMAIN_DISK_TYPE_DIR,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Three types of disk frontend */
|
|
|
|
enum virDomainDiskDevice {
|
|
|
|
VIR_DOMAIN_DISK_DEVICE_DISK,
|
|
|
|
VIR_DOMAIN_DISK_DEVICE_CDROM,
|
|
|
|
VIR_DOMAIN_DISK_DEVICE_FLOPPY,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_DEVICE_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainDiskBus {
|
|
|
|
VIR_DOMAIN_DISK_BUS_IDE,
|
|
|
|
VIR_DOMAIN_DISK_BUS_FDC,
|
|
|
|
VIR_DOMAIN_DISK_BUS_SCSI,
|
|
|
|
VIR_DOMAIN_DISK_BUS_VIRTIO,
|
|
|
|
VIR_DOMAIN_DISK_BUS_XEN,
|
2008-08-08 15:03:00 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_USB,
|
2008-11-19 16:58:23 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_UML,
|
2009-11-12 14:45:18 +00:00
|
|
|
VIR_DOMAIN_DISK_BUS_SATA,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_BUS_LAST
|
|
|
|
};
|
|
|
|
|
2009-01-30 17:15:39 +00:00
|
|
|
enum virDomainDiskCache {
|
|
|
|
VIR_DOMAIN_DISK_CACHE_DEFAULT,
|
|
|
|
VIR_DOMAIN_DISK_CACHE_DISABLE,
|
|
|
|
VIR_DOMAIN_DISK_CACHE_WRITETHRU,
|
|
|
|
VIR_DOMAIN_DISK_CACHE_WRITEBACK,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_CACHE_LAST
|
|
|
|
};
|
|
|
|
|
2010-03-24 15:32:10 +00:00
|
|
|
enum virDomainDiskErrorPolicy {
|
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_DEFAULT,
|
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_STOP,
|
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_IGNORE,
|
2010-04-08 20:05:50 +00:00
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_ENOSPACE,
|
2010-03-24 15:32:10 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_LAST
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Stores the virtual disk configuration */
|
|
|
|
typedef struct _virDomainDiskDef virDomainDiskDef;
|
|
|
|
typedef virDomainDiskDef *virDomainDiskDefPtr;
|
|
|
|
struct _virDomainDiskDef {
|
|
|
|
int type;
|
|
|
|
int device;
|
|
|
|
int bus;
|
|
|
|
char *src;
|
|
|
|
char *dst;
|
|
|
|
char *driverName;
|
|
|
|
char *driverType;
|
2009-08-14 11:22:01 +00:00
|
|
|
char *serial;
|
2009-01-30 17:15:39 +00:00
|
|
|
int cachemode;
|
2010-03-24 15:32:10 +00:00
|
|
|
int error_policy;
|
2008-07-11 16:23:36 +00:00
|
|
|
unsigned int readonly : 1;
|
|
|
|
unsigned int shared : 1;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDeviceInfo info;
|
2009-07-21 05:23:03 +00:00
|
|
|
virStorageEncryptionPtr encryption;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-12-02 19:15:38 +00:00
|
|
|
enum virDomainControllerType {
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_IDE,
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_FDC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_SCSI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_SATA,
|
2010-02-18 16:52:03 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL,
|
2009-12-02 19:15:38 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2010-06-17 14:39:50 +00:00
|
|
|
|
|
|
|
enum virDomainControllerModel {
|
2010-07-06 17:02:48 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_AUTO,
|
2010-06-17 14:39:50 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068,
|
2010-06-24 14:58:54 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_VMPVSCSI,
|
2010-06-17 14:39:50 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_LAST
|
|
|
|
};
|
|
|
|
|
2010-02-18 16:52:03 +00:00
|
|
|
typedef struct _virDomainVirtioSerialOpts virDomainVirtioSerialOpts;
|
|
|
|
typedef virDomainVirtioSerialOpts *virDomainVirtioSerialOptsPtr;
|
|
|
|
struct _virDomainVirtioSerialOpts {
|
|
|
|
int ports; /* -1 == undef */
|
|
|
|
int vectors; /* -1 == undef */
|
|
|
|
};
|
|
|
|
|
2009-12-02 19:15:38 +00:00
|
|
|
/* Stores the virtual disk controller configuration */
|
|
|
|
typedef struct _virDomainControllerDef virDomainControllerDef;
|
|
|
|
typedef virDomainControllerDef *virDomainControllerDefPtr;
|
|
|
|
struct _virDomainControllerDef {
|
|
|
|
int type;
|
|
|
|
int idx;
|
2010-06-17 14:39:50 +00:00
|
|
|
int model; /* -1 == undef */
|
2010-02-18 16:52:03 +00:00
|
|
|
union {
|
|
|
|
virDomainVirtioSerialOpts vioserial;
|
|
|
|
} opts;
|
2009-12-02 19:15:38 +00:00
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-08-01 13:31:37 +00:00
|
|
|
/* Two types of disk backends */
|
|
|
|
enum virDomainFSType {
|
|
|
|
VIR_DOMAIN_FS_TYPE_MOUNT, /* Better named 'bind' */
|
|
|
|
VIR_DOMAIN_FS_TYPE_BLOCK,
|
|
|
|
VIR_DOMAIN_FS_TYPE_FILE,
|
|
|
|
VIR_DOMAIN_FS_TYPE_TEMPLATE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2010-10-14 13:08:24 +00:00
|
|
|
/* Filesystem mount access mode */
|
|
|
|
enum virDomainFSAccessMode {
|
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH,
|
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_MAPPED,
|
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_SQUASH,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_ACCESSMODE_LAST
|
|
|
|
};
|
|
|
|
|
2008-08-01 13:31:37 +00:00
|
|
|
typedef struct _virDomainFSDef virDomainFSDef;
|
|
|
|
typedef virDomainFSDef *virDomainFSDefPtr;
|
|
|
|
struct _virDomainFSDef {
|
|
|
|
int type;
|
2010-10-14 13:08:24 +00:00
|
|
|
int accessmode;
|
2008-08-01 13:31:37 +00:00
|
|
|
char *src;
|
|
|
|
char *dst;
|
|
|
|
unsigned int readonly : 1;
|
Add device info to serial, parallel, channel, input & fs devices
Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
parsing / formatting device info for serial, parallel, channel
input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
devices, input & fs device
2010-01-06 12:39:53 +00:00
|
|
|
virDomainDeviceInfo info;
|
2008-08-01 13:31:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* 5 different types of networking config */
|
|
|
|
enum virDomainNetType {
|
|
|
|
VIR_DOMAIN_NET_TYPE_USER,
|
|
|
|
VIR_DOMAIN_NET_TYPE_ETHERNET,
|
|
|
|
VIR_DOMAIN_NET_TYPE_SERVER,
|
|
|
|
VIR_DOMAIN_NET_TYPE_CLIENT,
|
|
|
|
VIR_DOMAIN_NET_TYPE_MCAST,
|
|
|
|
VIR_DOMAIN_NET_TYPE_NETWORK,
|
|
|
|
VIR_DOMAIN_NET_TYPE_BRIDGE,
|
2009-05-11 09:50:27 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_INTERNAL,
|
2010-02-12 17:07:06 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_DIRECT,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_NET_TYPE_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-02-12 17:07:06 +00:00
|
|
|
/* the mode type for macvtap devices */
|
|
|
|
enum virDomainNetdevMacvtapType {
|
|
|
|
VIR_DOMAIN_NETDEV_MACVTAP_MODE_VEPA,
|
|
|
|
VIR_DOMAIN_NETDEV_MACVTAP_MODE_PRIVATE,
|
|
|
|
VIR_DOMAIN_NETDEV_MACVTAP_MODE_BRIDGE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_NETDEV_MACVTAP_MODE_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Stores the virtual network interface configuration */
|
|
|
|
typedef struct _virDomainNetDef virDomainNetDef;
|
|
|
|
typedef virDomainNetDef *virDomainNetDefPtr;
|
|
|
|
struct _virDomainNetDef {
|
2010-03-26 16:01:35 +00:00
|
|
|
enum virDomainNetType type;
|
2008-10-24 11:20:08 +00:00
|
|
|
unsigned char mac[VIR_MAC_BUFLEN];
|
2008-07-11 16:23:36 +00:00
|
|
|
char *model;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *dev;
|
|
|
|
char *script;
|
|
|
|
char *ipaddr;
|
|
|
|
} ethernet;
|
|
|
|
struct {
|
|
|
|
char *address;
|
|
|
|
int port;
|
|
|
|
} socket; /* any of NET_CLIENT or NET_SERVER or NET_MCAST */
|
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
} network;
|
|
|
|
struct {
|
|
|
|
char *brname;
|
2009-01-22 18:29:13 +00:00
|
|
|
char *script;
|
2009-01-23 01:48:47 +00:00
|
|
|
char *ipaddr;
|
2008-07-11 16:23:36 +00:00
|
|
|
} bridge;
|
2009-05-11 09:50:27 +00:00
|
|
|
struct {
|
|
|
|
char *name;
|
|
|
|
} internal;
|
2010-02-12 17:07:06 +00:00
|
|
|
struct {
|
|
|
|
char *linkdev;
|
|
|
|
int mode;
|
2010-05-25 21:37:00 +00:00
|
|
|
virVirtualPortProfileParams virtPortProfile;
|
2010-02-12 17:07:06 +00:00
|
|
|
} direct;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
|
|
|
char *ifname;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDeviceInfo info;
|
2010-03-25 17:46:07 +00:00
|
|
|
char *filter;
|
|
|
|
virNWFilterHashTablePtr filterparams;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2010-07-13 19:05:34 +00:00
|
|
|
enum virDomainChrDeviceType {
|
2010-07-13 20:06:38 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_MONITOR = 0,
|
2010-07-13 19:05:34 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL,
|
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL,
|
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE,
|
2010-07-13 20:06:38 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL,
|
2009-11-05 13:19:14 +00:00
|
|
|
|
2010-07-13 20:06:38 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainChrChannelTargetType {
|
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD = 0,
|
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST,
|
2009-11-05 13:19:14 +00:00
|
|
|
};
|
|
|
|
|
2010-07-22 17:56:21 +00:00
|
|
|
enum virDomainChrConsoleTargetType {
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL = 0,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML,
|
2010-07-14 17:02:04 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO,
|
2010-07-22 17:56:21 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST,
|
|
|
|
};
|
|
|
|
|
2009-11-05 13:19:14 +00:00
|
|
|
enum virDomainChrType {
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_NULL,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_VC,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_PTY,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_DEV,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_FILE,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_PIPE,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_STDIO,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_UDP,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_TCP,
|
|
|
|
VIR_DOMAIN_CHR_TYPE_UNIX,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_TYPE_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainChrTcpProtocol {
|
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_RAW,
|
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNET,
|
2010-09-29 21:04:19 +00:00
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_TELNETS, /* secure telnet */
|
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_TLS,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainChrDef virDomainChrDef;
|
|
|
|
typedef virDomainChrDef *virDomainChrDefPtr;
|
|
|
|
struct _virDomainChrDef {
|
2010-07-13 19:05:34 +00:00
|
|
|
int deviceType;
|
2010-07-13 20:06:38 +00:00
|
|
|
int targetType;
|
2009-11-05 13:19:14 +00:00
|
|
|
union {
|
|
|
|
int port; /* parallel, serial, console */
|
2009-11-05 14:31:03 +00:00
|
|
|
virSocketAddrPtr addr; /* guestfwd */
|
2010-02-18 16:52:03 +00:00
|
|
|
char *name; /* virtio */
|
2009-11-05 13:19:14 +00:00
|
|
|
} target;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
int type;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *path;
|
|
|
|
} file; /* pty, file, pipe, or device */
|
|
|
|
struct {
|
|
|
|
char *host;
|
|
|
|
char *service;
|
|
|
|
int listen;
|
|
|
|
int protocol;
|
|
|
|
} tcp;
|
|
|
|
struct {
|
|
|
|
char *bindHost;
|
|
|
|
char *bindService;
|
|
|
|
char *connectHost;
|
|
|
|
char *connectService;
|
|
|
|
} udp;
|
|
|
|
struct {
|
|
|
|
char *path;
|
|
|
|
int listen;
|
|
|
|
} nix;
|
|
|
|
} data;
|
Add device info to serial, parallel, channel, input & fs devices
Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
parsing / formatting device info for serial, parallel, channel
input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
devices, input & fs device
2010-01-06 12:39:53 +00:00
|
|
|
|
|
|
|
virDomainDeviceInfo info;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainInputType {
|
|
|
|
VIR_DOMAIN_INPUT_TYPE_MOUSE,
|
|
|
|
VIR_DOMAIN_INPUT_TYPE_TABLET,
|
|
|
|
|
|
|
|
VIR_DOMAIN_INPUT_TYPE_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainInputBus {
|
|
|
|
VIR_DOMAIN_INPUT_BUS_PS2,
|
|
|
|
VIR_DOMAIN_INPUT_BUS_USB,
|
|
|
|
VIR_DOMAIN_INPUT_BUS_XEN,
|
|
|
|
|
|
|
|
VIR_DOMAIN_INPUT_BUS_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainInputDef virDomainInputDef;
|
|
|
|
typedef virDomainInputDef *virDomainInputDefPtr;
|
|
|
|
struct _virDomainInputDef {
|
|
|
|
int type;
|
|
|
|
int bus;
|
Add device info to serial, parallel, channel, input & fs devices
Although the serial, parallel, chanel, input & fs devices do
not have PCI address info, they can all have device aliases.
Thus it neccessary to associate the virDomainDeviceInfo data
with them all.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Add hooks for
parsing / formatting device info for serial, parallel, channel
input and fs devices.
* docs/schemas/domain.rng: Associate device info with character
devices, input & fs device
2010-01-06 12:39:53 +00:00
|
|
|
virDomainDeviceInfo info;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainSoundModel {
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_SB16,
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_ES1370,
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_PCSPK,
|
2009-05-21 14:16:06 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_AC97,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainSoundDef virDomainSoundDef;
|
|
|
|
typedef virDomainSoundDef *virDomainSoundDefPtr;
|
|
|
|
struct _virDomainSoundDef {
|
|
|
|
int model;
|
2009-12-10 19:19:08 +00:00
|
|
|
virDomainDeviceInfo info;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2009-10-21 12:26:38 +00:00
|
|
|
enum virDomainWatchdogModel {
|
|
|
|
VIR_DOMAIN_WATCHDOG_MODEL_I6300ESB,
|
|
|
|
VIR_DOMAIN_WATCHDOG_MODEL_IB700,
|
|
|
|
|
|
|
|
VIR_DOMAIN_WATCHDOG_MODEL_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainWatchdogAction {
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_RESET,
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_SHUTDOWN,
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_POWEROFF,
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_PAUSE,
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_NONE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainWatchdogDef virDomainWatchdogDef;
|
|
|
|
typedef virDomainWatchdogDef *virDomainWatchdogDefPtr;
|
|
|
|
struct _virDomainWatchdogDef {
|
|
|
|
int model;
|
|
|
|
int action;
|
2009-12-10 19:19:08 +00:00
|
|
|
virDomainDeviceInfo info;
|
2009-10-21 12:26:38 +00:00
|
|
|
};
|
|
|
|
|
2009-07-06 13:54:44 +00:00
|
|
|
|
|
|
|
enum virDomainVideoType {
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_VGA,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_CIRRUS,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_VMVGA,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_XEN,
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_VBOX,
|
|
|
|
|
|
|
|
VIR_DOMAIN_VIDEO_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-09-03 08:26:41 +00:00
|
|
|
typedef struct _virDomainVideoAccelDef virDomainVideoAccelDef;
|
|
|
|
typedef virDomainVideoAccelDef *virDomainVideoAccelDefPtr;
|
|
|
|
struct _virDomainVideoAccelDef {
|
2010-01-19 12:07:32 +00:00
|
|
|
unsigned int support3d :1;
|
|
|
|
unsigned int support2d :1;
|
2009-09-03 08:26:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-07-06 13:54:44 +00:00
|
|
|
typedef struct _virDomainVideoDef virDomainVideoDef;
|
|
|
|
typedef virDomainVideoDef *virDomainVideoDefPtr;
|
|
|
|
struct _virDomainVideoDef {
|
|
|
|
int type;
|
|
|
|
unsigned int vram;
|
|
|
|
unsigned int heads;
|
2009-09-03 08:26:41 +00:00
|
|
|
virDomainVideoAccelDefPtr accel;
|
2009-12-10 19:19:08 +00:00
|
|
|
virDomainDeviceInfo info;
|
2009-07-06 13:54:44 +00:00
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* 3 possible graphics console modes */
|
|
|
|
enum virDomainGraphicsType {
|
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_SDL,
|
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_VNC,
|
2009-05-15 09:43:51 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_RDP,
|
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_DESKTOP,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainGraphicsDef virDomainGraphicsDef;
|
|
|
|
typedef virDomainGraphicsDef *virDomainGraphicsDefPtr;
|
|
|
|
struct _virDomainGraphicsDef {
|
|
|
|
int type;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
int port;
|
2010-01-19 12:07:32 +00:00
|
|
|
unsigned int autoport :1;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *listenAddr;
|
|
|
|
char *keymap;
|
|
|
|
char *passwd;
|
|
|
|
} vnc;
|
|
|
|
struct {
|
|
|
|
char *display;
|
|
|
|
char *xauth;
|
2008-12-11 11:44:30 +00:00
|
|
|
int fullscreen;
|
2008-07-11 16:23:36 +00:00
|
|
|
} sdl;
|
2009-05-15 09:43:51 +00:00
|
|
|
struct {
|
|
|
|
int port;
|
|
|
|
char *listenAddr;
|
2010-01-19 12:07:32 +00:00
|
|
|
unsigned int autoport :1;
|
|
|
|
unsigned int replaceUser :1;
|
|
|
|
unsigned int multiUser :1;
|
2009-05-15 09:43:51 +00:00
|
|
|
} rdp;
|
|
|
|
struct {
|
|
|
|
char *display;
|
2010-01-19 12:07:32 +00:00
|
|
|
unsigned int fullscreen :1;
|
2009-05-15 09:43:51 +00:00
|
|
|
} desktop;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|
2008-08-08 14:27:05 +00:00
|
|
|
enum virDomainHostdevMode {
|
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS,
|
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2008-08-08 14:27:05 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainHostdevSubsysType {
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainHostdevDef virDomainHostdevDef;
|
|
|
|
typedef virDomainHostdevDef *virDomainHostdevDefPtr;
|
|
|
|
struct _virDomainHostdevDef {
|
|
|
|
int mode; /* enum virDomainHostdevMode */
|
2009-03-02 16:40:30 +00:00
|
|
|
unsigned int managed : 1;
|
2008-08-08 14:27:05 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
int type; /* enum virDomainHostdevBusType */
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
unsigned bus;
|
|
|
|
unsigned device;
|
|
|
|
|
|
|
|
unsigned vendor;
|
|
|
|
unsigned product;
|
|
|
|
} usb;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDevicePCIAddress pci; /* host address */
|
2008-12-17 18:12:07 +00:00
|
|
|
} u;
|
2008-08-08 14:27:05 +00:00
|
|
|
} subsys;
|
|
|
|
struct {
|
|
|
|
/* TBD: struct capabilities see:
|
|
|
|
* https://www.redhat.com/archives/libvir-list/2008-July/msg00429.html
|
|
|
|
*/
|
2008-12-17 18:12:07 +00:00
|
|
|
int dummy;
|
2008-08-08 14:27:05 +00:00
|
|
|
} caps;
|
|
|
|
} source;
|
|
|
|
char* target;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDeviceInfo info; /* Guest address */
|
2008-08-08 14:27:05 +00:00
|
|
|
};
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-07-15 13:02:42 +00:00
|
|
|
|
|
|
|
enum {
|
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO,
|
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_XEN,
|
2010-08-11 09:28:17 +00:00
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_NONE,
|
2010-07-15 13:02:42 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_MEMBALLOON_MODEL_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainMemballoonDef virDomainMemballoonDef;
|
|
|
|
typedef virDomainMemballoonDef *virDomainMemballoonDefPtr;
|
|
|
|
struct _virDomainMemballoonDef {
|
|
|
|
int model;
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Flags for the 'type' field in next struct */
|
|
|
|
enum virDomainDeviceType {
|
|
|
|
VIR_DOMAIN_DEVICE_DISK,
|
2008-08-01 13:31:37 +00:00
|
|
|
VIR_DOMAIN_DEVICE_FS,
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_DOMAIN_DEVICE_NET,
|
|
|
|
VIR_DOMAIN_DEVICE_INPUT,
|
|
|
|
VIR_DOMAIN_DEVICE_SOUND,
|
2009-07-06 13:54:44 +00:00
|
|
|
VIR_DOMAIN_DEVICE_VIDEO,
|
2008-08-08 14:27:05 +00:00
|
|
|
VIR_DOMAIN_DEVICE_HOSTDEV,
|
2009-10-21 12:26:38 +00:00
|
|
|
VIR_DOMAIN_DEVICE_WATCHDOG,
|
2009-12-02 19:15:38 +00:00
|
|
|
VIR_DOMAIN_DEVICE_CONTROLLER,
|
2010-03-22 13:22:48 +00:00
|
|
|
VIR_DOMAIN_DEVICE_GRAPHICS,
|
2009-03-02 17:39:43 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DEVICE_LAST,
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainDeviceDef virDomainDeviceDef;
|
|
|
|
typedef virDomainDeviceDef *virDomainDeviceDefPtr;
|
|
|
|
struct _virDomainDeviceDef {
|
|
|
|
int type;
|
|
|
|
union {
|
|
|
|
virDomainDiskDefPtr disk;
|
2009-12-02 19:15:38 +00:00
|
|
|
virDomainControllerDefPtr controller;
|
2008-08-01 13:31:37 +00:00
|
|
|
virDomainFSDefPtr fs;
|
2008-07-11 16:23:36 +00:00
|
|
|
virDomainNetDefPtr net;
|
|
|
|
virDomainInputDefPtr input;
|
|
|
|
virDomainSoundDefPtr sound;
|
2009-07-06 13:54:44 +00:00
|
|
|
virDomainVideoDefPtr video;
|
2008-08-08 14:27:05 +00:00
|
|
|
virDomainHostdevDefPtr hostdev;
|
2009-10-21 12:26:38 +00:00
|
|
|
virDomainWatchdogDefPtr watchdog;
|
2010-03-22 13:22:48 +00:00
|
|
|
virDomainGraphicsDefPtr graphics;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# define VIR_DOMAIN_MAX_BOOT_DEVS 4
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
enum virDomainBootOrder {
|
|
|
|
VIR_DOMAIN_BOOT_FLOPPY,
|
|
|
|
VIR_DOMAIN_BOOT_CDROM,
|
|
|
|
VIR_DOMAIN_BOOT_DISK,
|
|
|
|
VIR_DOMAIN_BOOT_NET,
|
|
|
|
|
|
|
|
VIR_DOMAIN_BOOT_LAST,
|
|
|
|
};
|
|
|
|
|
2010-07-26 14:28:58 +00:00
|
|
|
enum virDomainBootMenu {
|
|
|
|
VIR_DOMAIN_BOOT_MENU_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_BOOT_MENU_ENABLED,
|
|
|
|
VIR_DOMAIN_BOOT_MENU_DISABLED,
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
enum virDomainFeature {
|
|
|
|
VIR_DOMAIN_FEATURE_ACPI,
|
|
|
|
VIR_DOMAIN_FEATURE_APIC,
|
|
|
|
VIR_DOMAIN_FEATURE_PAE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FEATURE_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainLifecycleAction {
|
|
|
|
VIR_DOMAIN_LIFECYCLE_DESTROY,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_RESTART,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_RESTART_RENAME,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_PRESERVE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_LIFECYCLE_LAST
|
|
|
|
};
|
|
|
|
|
2010-08-12 17:15:44 +00:00
|
|
|
enum virDomainLifecycleCrashAction {
|
|
|
|
VIR_DOMAIN_LIFECYCLE_CRASH_DESTROY,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_CRASH_RESTART,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_CRASH_RESTART_RENAME,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_CRASH_PRESERVE,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_DESTROY,
|
|
|
|
VIR_DOMAIN_LIFECYCLE_CRASH_COREDUMP_RESTART,
|
|
|
|
|
|
|
|
VIR_DOMAIN_LIFECYCLE_CRASH_LAST
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Operating system configuration data & machine / arch */
|
|
|
|
typedef struct _virDomainOSDef virDomainOSDef;
|
|
|
|
typedef virDomainOSDef *virDomainOSDefPtr;
|
|
|
|
struct _virDomainOSDef {
|
|
|
|
char *type;
|
|
|
|
char *arch;
|
|
|
|
char *machine;
|
|
|
|
int nBootDevs;
|
|
|
|
int bootDevs[VIR_DOMAIN_BOOT_LAST];
|
2010-07-26 14:28:58 +00:00
|
|
|
int bootmenu;
|
2008-08-01 13:31:37 +00:00
|
|
|
char *init;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *kernel;
|
|
|
|
char *initrd;
|
|
|
|
char *cmdline;
|
|
|
|
char *root;
|
|
|
|
char *loader;
|
|
|
|
char *bootloader;
|
|
|
|
char *bootloaderArgs;
|
|
|
|
};
|
|
|
|
|
2009-03-03 16:53:13 +00:00
|
|
|
enum virDomainSeclabelType {
|
|
|
|
VIR_DOMAIN_SECLABEL_DYNAMIC,
|
|
|
|
VIR_DOMAIN_SECLABEL_STATIC,
|
|
|
|
|
|
|
|
VIR_DOMAIN_SECLABEL_LAST,
|
|
|
|
};
|
|
|
|
|
2009-03-03 09:44:41 +00:00
|
|
|
/* Security configuration for domain */
|
|
|
|
typedef struct _virSecurityLabelDef virSecurityLabelDef;
|
|
|
|
typedef virSecurityLabelDef *virSecurityLabelDefPtr;
|
|
|
|
struct _virSecurityLabelDef {
|
|
|
|
char *model; /* name of security model */
|
|
|
|
char *label; /* security label string */
|
|
|
|
char *imagelabel; /* security image label string */
|
2009-03-03 16:53:13 +00:00
|
|
|
int type;
|
2009-03-03 09:44:41 +00:00
|
|
|
};
|
|
|
|
|
2010-03-30 11:44:22 +00:00
|
|
|
enum virDomainTimerNameType {
|
|
|
|
VIR_DOMAIN_TIMER_NAME_PLATFORM = 0,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_PIT,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_RTC,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_HPET,
|
|
|
|
VIR_DOMAIN_TIMER_NAME_TSC,
|
|
|
|
|
|
|
|
VIR_DOMAIN_TIMER_NAME_LAST,
|
|
|
|
};
|
|
|
|
|
2010-03-31 17:03:54 +00:00
|
|
|
enum virDomainTimerTrackType {
|
|
|
|
VIR_DOMAIN_TIMER_TRACK_BOOT = 0,
|
|
|
|
VIR_DOMAIN_TIMER_TRACK_GUEST,
|
|
|
|
VIR_DOMAIN_TIMER_TRACK_WALL,
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2010-03-31 17:03:54 +00:00
|
|
|
VIR_DOMAIN_TIMER_TRACK_LAST,
|
2010-03-30 11:44:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainTimerTickpolicyType {
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_DELAY = 0,
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_CATCHUP,
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_MERGE,
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_DISCARD,
|
|
|
|
|
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainTimerModeType {
|
|
|
|
VIR_DOMAIN_TIMER_MODE_AUTO = 0,
|
|
|
|
VIR_DOMAIN_TIMER_MODE_NATIVE,
|
|
|
|
VIR_DOMAIN_TIMER_MODE_EMULATE,
|
|
|
|
VIR_DOMAIN_TIMER_MODE_PARAVIRT,
|
2010-03-31 17:03:54 +00:00
|
|
|
VIR_DOMAIN_TIMER_MODE_SMPSAFE,
|
2010-03-30 11:44:22 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_TIMER_MODE_LAST,
|
|
|
|
};
|
|
|
|
|
2010-03-31 17:03:54 +00:00
|
|
|
typedef struct _virDomainTimerCatchupDef virDomainTimerCatchupDef;
|
|
|
|
typedef virDomainTimerCatchupDef *virDomainTimerCatchupDefPtr;
|
|
|
|
struct _virDomainTimerCatchupDef {
|
|
|
|
unsigned long threshold;
|
|
|
|
unsigned long slew;
|
|
|
|
unsigned long limit;
|
|
|
|
};
|
|
|
|
|
2010-03-30 11:44:22 +00:00
|
|
|
typedef struct _virDomainTimerDef virDomainTimerDef;
|
|
|
|
typedef virDomainTimerDef *virDomainTimerDefPtr;
|
|
|
|
struct _virDomainTimerDef {
|
|
|
|
int name;
|
|
|
|
int present; /* unspecified = -1, no = 0, yes = 1 */
|
|
|
|
int tickpolicy; /* none|catchup|merge|discard */
|
|
|
|
|
2010-03-31 17:03:54 +00:00
|
|
|
virDomainTimerCatchupDef catchup;
|
|
|
|
|
|
|
|
/* track is only valid for name='platform|rtc' */
|
|
|
|
int track; /* host|guest */
|
2010-03-30 11:44:22 +00:00
|
|
|
|
|
|
|
/* frequency & mode are only valid for name='tsc' */
|
|
|
|
unsigned long frequency; /* in Hz, unspecified = 0 */
|
|
|
|
int mode; /* auto|native|emulate|paravirt */
|
|
|
|
};
|
|
|
|
|
2010-02-02 17:22:03 +00:00
|
|
|
enum virDomainClockOffsetType {
|
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_UTC = 0,
|
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME = 1,
|
2010-02-02 17:49:09 +00:00
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_VARIABLE = 2,
|
2010-02-02 18:28:44 +00:00
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_TIMEZONE = 3,
|
2010-02-02 17:22:03 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_LAST,
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainClockDef virDomainClockDef;
|
|
|
|
typedef virDomainClockDef *virDomainClockDefPtr;
|
|
|
|
struct _virDomainClockDef {
|
|
|
|
int offset;
|
2010-02-02 17:49:09 +00:00
|
|
|
|
2010-02-02 18:28:44 +00:00
|
|
|
union {
|
|
|
|
/* Adjustment in seconds, relative to UTC, when
|
|
|
|
* offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE */
|
|
|
|
long long adjustment;
|
|
|
|
|
|
|
|
/* Timezone name, when
|
|
|
|
* offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME */
|
|
|
|
char *timezone;
|
|
|
|
} data;
|
2010-03-30 11:44:22 +00:00
|
|
|
|
|
|
|
int ntimers;
|
|
|
|
virDomainTimerDefPtr *timers;
|
2010-02-02 17:22:03 +00:00
|
|
|
};
|
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# define VIR_DOMAIN_CPUMASK_LEN 1024
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-04-02 14:41:30 +00:00
|
|
|
|
|
|
|
/* Snapshot state */
|
|
|
|
typedef struct _virDomainSnapshotDef virDomainSnapshotDef;
|
|
|
|
typedef virDomainSnapshotDef *virDomainSnapshotDefPtr;
|
|
|
|
struct _virDomainSnapshotDef {
|
|
|
|
char *name;
|
|
|
|
char *description;
|
|
|
|
char *parent;
|
|
|
|
time_t creationTime;
|
|
|
|
int state;
|
|
|
|
|
|
|
|
long active;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainSnapshotObj virDomainSnapshotObj;
|
|
|
|
typedef virDomainSnapshotObj *virDomainSnapshotObjPtr;
|
|
|
|
struct _virDomainSnapshotObj {
|
|
|
|
int refs;
|
|
|
|
|
|
|
|
virDomainSnapshotDefPtr def;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainSnapshotObjList virDomainSnapshotObjList;
|
|
|
|
typedef virDomainSnapshotObjList *virDomainSnapshotObjListPtr;
|
|
|
|
struct _virDomainSnapshotObjList {
|
|
|
|
/* name string -> virDomainSnapshotObj mapping
|
|
|
|
* for O(1), lockless lookup-by-name */
|
|
|
|
virHashTable *objs;
|
|
|
|
};
|
|
|
|
|
|
|
|
virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr,
|
|
|
|
int newSnapshot);
|
|
|
|
void virDomainSnapshotDefFree(virDomainSnapshotDefPtr def);
|
|
|
|
char *virDomainSnapshotDefFormat(char *domain_uuid,
|
|
|
|
virDomainSnapshotDefPtr def,
|
|
|
|
int internal);
|
|
|
|
virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots,
|
|
|
|
const virDomainSnapshotDefPtr def);
|
|
|
|
|
|
|
|
int virDomainSnapshotObjListInit(virDomainSnapshotObjListPtr objs);
|
|
|
|
int virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
|
|
|
|
char **const names, int maxnames);
|
|
|
|
int virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots);
|
|
|
|
virDomainSnapshotObjPtr virDomainSnapshotFindByName(const virDomainSnapshotObjListPtr snapshots,
|
|
|
|
const char *name);
|
|
|
|
void virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
|
|
|
|
virDomainSnapshotObjPtr snapshot);
|
|
|
|
int virDomainSnapshotObjUnref(virDomainSnapshotObjPtr snapshot);
|
|
|
|
int virDomainSnapshotHasChildren(virDomainSnapshotObjPtr snap,
|
|
|
|
virDomainSnapshotObjListPtr snapshots);
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Guest VM main configuration */
|
|
|
|
typedef struct _virDomainDef virDomainDef;
|
|
|
|
typedef virDomainDef *virDomainDefPtr;
|
|
|
|
struct _virDomainDef {
|
|
|
|
int virtType;
|
|
|
|
int id;
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
|
|
|
char *name;
|
2009-09-30 14:07:24 +00:00
|
|
|
char *description;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-10-12 14:43:39 +00:00
|
|
|
struct {
|
|
|
|
unsigned long max_balloon;
|
|
|
|
unsigned long cur_balloon;
|
|
|
|
unsigned long hugepage_backed;
|
|
|
|
unsigned long hard_limit;
|
|
|
|
unsigned long soft_limit;
|
|
|
|
unsigned long min_guarantee;
|
|
|
|
unsigned long swap_hard_limit;
|
|
|
|
} mem;
|
2008-07-11 16:23:36 +00:00
|
|
|
unsigned long vcpus;
|
|
|
|
int cpumasklen;
|
|
|
|
char *cpumask;
|
|
|
|
|
|
|
|
/* These 3 are based on virDomainLifeCycleAction enum flags */
|
|
|
|
int onReboot;
|
|
|
|
int onPoweroff;
|
|
|
|
int onCrash;
|
|
|
|
|
|
|
|
virDomainOSDef os;
|
|
|
|
char *emulator;
|
|
|
|
int features;
|
|
|
|
|
2010-02-02 17:22:03 +00:00
|
|
|
virDomainClockDef clock;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2009-05-07 07:27:49 +00:00
|
|
|
int ngraphics;
|
|
|
|
virDomainGraphicsDefPtr *graphics;
|
2008-10-10 16:08:01 +00:00
|
|
|
|
|
|
|
int ndisks;
|
|
|
|
virDomainDiskDefPtr *disks;
|
|
|
|
|
2009-12-02 19:15:38 +00:00
|
|
|
int ncontrollers;
|
|
|
|
virDomainControllerDefPtr *controllers;
|
|
|
|
|
2008-10-10 16:08:01 +00:00
|
|
|
int nfss;
|
|
|
|
virDomainFSDefPtr *fss;
|
|
|
|
|
|
|
|
int nnets;
|
|
|
|
virDomainNetDefPtr *nets;
|
|
|
|
|
|
|
|
int ninputs;
|
|
|
|
virDomainInputDefPtr *inputs;
|
|
|
|
|
|
|
|
int nsounds;
|
|
|
|
virDomainSoundDefPtr *sounds;
|
|
|
|
|
2009-07-06 13:54:44 +00:00
|
|
|
int nvideos;
|
|
|
|
virDomainVideoDefPtr *videos;
|
|
|
|
|
2008-10-10 16:08:01 +00:00
|
|
|
int nhostdevs;
|
|
|
|
virDomainHostdevDefPtr *hostdevs;
|
|
|
|
|
|
|
|
int nserials;
|
|
|
|
virDomainChrDefPtr *serials;
|
|
|
|
|
|
|
|
int nparallels;
|
|
|
|
virDomainChrDefPtr *parallels;
|
|
|
|
|
2009-11-05 14:31:03 +00:00
|
|
|
int nchannels;
|
|
|
|
virDomainChrDefPtr *channels;
|
|
|
|
|
2008-10-10 16:08:01 +00:00
|
|
|
/* Only 1 */
|
2008-07-11 16:23:36 +00:00
|
|
|
virDomainChrDefPtr console;
|
2009-03-03 09:44:41 +00:00
|
|
|
virSecurityLabelDef seclabel;
|
2009-10-21 12:26:38 +00:00
|
|
|
virDomainWatchdogDefPtr watchdog;
|
2010-07-15 13:02:42 +00:00
|
|
|
virDomainMemballoonDefPtr memballoon;
|
2009-12-18 13:44:55 +00:00
|
|
|
virCPUDefPtr cpu;
|
2010-04-17 03:08:29 +00:00
|
|
|
|
|
|
|
void *namespaceData;
|
|
|
|
virDomainXMLNamespace ns;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Guest VM runtime state */
|
|
|
|
typedef struct _virDomainObj virDomainObj;
|
|
|
|
typedef virDomainObj *virDomainObjPtr;
|
|
|
|
struct _virDomainObj {
|
2009-01-15 19:56:05 +00:00
|
|
|
virMutex lock;
|
2009-10-15 11:30:26 +00:00
|
|
|
int refs;
|
2008-12-04 22:00:14 +00:00
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
int pid;
|
|
|
|
int state;
|
|
|
|
|
|
|
|
unsigned int autostart : 1;
|
|
|
|
unsigned int persistent : 1;
|
|
|
|
|
|
|
|
virDomainDefPtr def; /* The current definition */
|
|
|
|
virDomainDefPtr newDef; /* New definition to activate at shutdown */
|
2009-10-06 11:50:58 +00:00
|
|
|
|
2010-04-02 14:41:30 +00:00
|
|
|
virDomainSnapshotObjList snapshots;
|
|
|
|
virDomainSnapshotObjPtr current_snapshot;
|
|
|
|
|
2009-10-06 11:50:58 +00:00
|
|
|
void *privateData;
|
|
|
|
void (*privateDataFreeFunc)(void *);
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2008-10-10 14:20:37 +00:00
|
|
|
typedef struct _virDomainObjList virDomainObjList;
|
|
|
|
typedef virDomainObjList *virDomainObjListPtr;
|
|
|
|
struct _virDomainObjList {
|
Convert virDomainObjListPtr to use a hash of domain objects
The current virDomainObjListPtr object stores domain objects in
an array. This means that to find a particular objects requires
O(n) time, and more critically acquiring O(n) mutex locks.
The new impl replaces the array with a virHashTable, keyed off
UUID. Finding a object based on UUID is now O(1) time, and only
requires a single mutex lock. Finding by name/id is unchanged
in complexity.
In changing this, all code which iterates over the array had
to be updated to use a hash table iterator function callback.
Several of the functions which were identically duplicating
across all drivers were pulled into domain_conf.c
* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
virDomainObjListPtr to use virHashTable. Add a initializer
method virDomainObjListInit, and rename virDomainObjListFree
to virDomainObjListDeinit, since its not actually freeing
the container, only its contents. Also add some convenient
methods virDomainObjListGetInactiveNames,
virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
which can be used to implement the correspondingly named
public API entry points in drivers
* src/libvirt_private.syms: Export new methods from domain_conf.h
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
src/qemu/qemu_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
to deal with hash tables instead of arrays for domains
2009-10-09 11:33:51 +00:00
|
|
|
/* uuid string -> virDomainObj mapping
|
|
|
|
* for O(1), lockless lookup-by-uuid */
|
|
|
|
virHashTable *objs;
|
2008-10-10 14:20:37 +00:00
|
|
|
};
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
static inline int
|
Rename internal APis
Rename virDomainIsActive to virDomainObjIsActive, and
virInterfaceIsActive to virInterfaceObjIsActive and finally
virNetworkIsActive to virNetworkObjIsActive.
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/interface_conf.h, src/conf/network_conf.c,
src/conf/network_conf.h, src/lxc/lxc_driver.c,
src/network/bridge_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_driver.c, src/qemu/qemu_driver.c,
src/test/test_driver.c, src/uml/uml_driver.c: Update for
renamed APIs.
2009-10-20 14:51:03 +00:00
|
|
|
virDomainObjIsActive(virDomainObjPtr dom)
|
2008-07-11 16:23:36 +00:00
|
|
|
{
|
|
|
|
return dom->def->id != -1;
|
|
|
|
}
|
|
|
|
|
2009-11-30 18:35:58 +00:00
|
|
|
|
Convert virDomainObjListPtr to use a hash of domain objects
The current virDomainObjListPtr object stores domain objects in
an array. This means that to find a particular objects requires
O(n) time, and more critically acquiring O(n) mutex locks.
The new impl replaces the array with a virHashTable, keyed off
UUID. Finding a object based on UUID is now O(1) time, and only
requires a single mutex lock. Finding by name/id is unchanged
in complexity.
In changing this, all code which iterates over the array had
to be updated to use a hash table iterator function callback.
Several of the functions which were identically duplicating
across all drivers were pulled into domain_conf.c
* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
virDomainObjListPtr to use virHashTable. Add a initializer
method virDomainObjListInit, and rename virDomainObjListFree
to virDomainObjListDeinit, since its not actually freeing
the container, only its contents. Also add some convenient
methods virDomainObjListGetInactiveNames,
virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
which can be used to implement the correspondingly named
public API entry points in drivers
* src/libvirt_private.syms: Export new methods from domain_conf.h
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
src/qemu/qemu_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
to deal with hash tables instead of arrays for domains
2009-10-09 11:33:51 +00:00
|
|
|
int virDomainObjListInit(virDomainObjListPtr objs);
|
|
|
|
void virDomainObjListDeinit(virDomainObjListPtr objs);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2008-10-10 14:20:37 +00:00
|
|
|
virDomainObjPtr virDomainFindByID(const virDomainObjListPtr doms,
|
2008-07-11 16:23:36 +00:00
|
|
|
int id);
|
2008-10-10 14:20:37 +00:00
|
|
|
virDomainObjPtr virDomainFindByUUID(const virDomainObjListPtr doms,
|
2008-07-11 16:23:36 +00:00
|
|
|
const unsigned char *uuid);
|
2008-10-10 14:20:37 +00:00
|
|
|
virDomainObjPtr virDomainFindByName(const virDomainObjListPtr doms,
|
2008-07-11 16:23:36 +00:00
|
|
|
const char *name);
|
|
|
|
|
|
|
|
|
|
|
|
void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def);
|
|
|
|
void virDomainInputDefFree(virDomainInputDefPtr def);
|
|
|
|
void virDomainDiskDefFree(virDomainDiskDefPtr def);
|
2009-12-02 19:15:38 +00:00
|
|
|
void virDomainControllerDefFree(virDomainControllerDefPtr def);
|
2008-08-01 13:31:37 +00:00
|
|
|
void virDomainFSDefFree(virDomainFSDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainNetDefFree(virDomainNetDefPtr def);
|
|
|
|
void virDomainChrDefFree(virDomainChrDefPtr def);
|
|
|
|
void virDomainSoundDefFree(virDomainSoundDefPtr def);
|
2010-07-15 13:02:42 +00:00
|
|
|
void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def);
|
2009-10-21 12:26:38 +00:00
|
|
|
void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def);
|
2009-07-06 13:54:44 +00:00
|
|
|
void virDomainVideoDefFree(virDomainVideoDefPtr def);
|
2008-08-08 14:27:05 +00:00
|
|
|
void virDomainHostdevDefFree(virDomainHostdevDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainDeviceDefFree(virDomainDeviceDefPtr def);
|
2009-11-30 18:35:58 +00:00
|
|
|
int virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
|
|
|
|
int type);
|
|
|
|
int virDomainDevicePCIAddressIsValid(virDomainDevicePCIAddressPtr addr);
|
2009-12-01 16:56:24 +00:00
|
|
|
int virDomainDeviceDriveAddressIsValid(virDomainDeviceDriveAddressPtr addr);
|
2010-02-18 16:52:03 +00:00
|
|
|
int virDomainDeviceVirtioSerialAddressIsValid(virDomainDeviceVirtioSerialAddressPtr addr);
|
2009-11-30 18:35:58 +00:00
|
|
|
int virDomainDeviceInfoIsSet(virDomainDeviceInfoPtr info);
|
|
|
|
void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info);
|
2010-01-06 10:35:30 +00:00
|
|
|
void virDomainDefClearPCIAddresses(virDomainDefPtr def);
|
2010-01-08 15:53:53 +00:00
|
|
|
void virDomainDefClearDeviceAliases(virDomainDefPtr def);
|
2010-01-06 10:35:30 +00:00
|
|
|
|
2010-01-27 15:10:34 +00:00
|
|
|
typedef int (*virDomainDeviceInfoCallback)(virDomainDefPtr def,
|
|
|
|
virDomainDeviceInfoPtr dev,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainDeviceInfoIterate(virDomainDefPtr def,
|
|
|
|
virDomainDeviceInfoCallback cb,
|
|
|
|
void *opaque);
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainDefFree(virDomainDefPtr vm);
|
2009-10-15 11:30:26 +00:00
|
|
|
void virDomainObjRef(virDomainObjPtr vm);
|
|
|
|
/* Returns 1 if the object was freed, 0 if more refs exist */
|
|
|
|
int virDomainObjUnref(virDomainObjPtr vm);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-03-24 14:31:21 +00:00
|
|
|
/* live == true means def describes an active domain (being migrated or
|
|
|
|
* restored) as opposed to a new persistent configuration of the domain */
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainObjPtr virDomainAssignDef(virCapsPtr caps,
|
2008-10-10 14:20:37 +00:00
|
|
|
virDomainObjListPtr doms,
|
2010-03-24 14:31:21 +00:00
|
|
|
const virDomainDefPtr def,
|
|
|
|
bool live);
|
2010-05-20 09:36:24 +00:00
|
|
|
void virDomainObjAssignDef(virDomainObjPtr domain,
|
|
|
|
const virDomainDefPtr def,
|
|
|
|
bool live);
|
2008-10-10 14:20:37 +00:00
|
|
|
void virDomainRemoveInactive(virDomainObjListPtr doms,
|
2008-07-11 16:23:36 +00:00
|
|
|
virDomainObjPtr dom);
|
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# ifndef PROXY
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
|
2008-07-11 16:23:36 +00:00
|
|
|
const virDomainDefPtr def,
|
2009-01-08 13:54:20 +00:00
|
|
|
const char *xmlStr,
|
|
|
|
int flags);
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainDefPtr virDomainDefParseString(virCapsPtr caps,
|
2009-01-08 13:54:20 +00:00
|
|
|
const char *xmlStr,
|
|
|
|
int flags);
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainDefPtr virDomainDefParseFile(virCapsPtr caps,
|
2008-12-04 12:02:59 +00:00
|
|
|
const char *filename,
|
|
|
|
int flags);
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainDefPtr virDomainDefParseNode(virCapsPtr caps,
|
2008-07-11 16:23:36 +00:00
|
|
|
xmlDocPtr doc,
|
2008-12-04 12:02:59 +00:00
|
|
|
xmlNodePtr root,
|
|
|
|
int flags);
|
2009-06-12 11:38:50 +00:00
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainObjPtr virDomainObjParseFile(virCapsPtr caps,
|
2009-06-12 11:38:50 +00:00
|
|
|
const char *filename);
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainObjPtr virDomainObjParseNode(virCapsPtr caps,
|
2009-06-12 11:38:50 +00:00
|
|
|
xmlDocPtr xml,
|
|
|
|
xmlNodePtr root);
|
|
|
|
|
2010-02-18 16:52:03 +00:00
|
|
|
int virDomainDefAddImplicitControllers(virDomainDefPtr def);
|
2010-01-05 13:31:20 +00:00
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# endif
|
2010-02-09 18:58:01 +00:00
|
|
|
char *virDomainDefFormat(virDomainDefPtr def,
|
2008-07-11 16:23:36 +00:00
|
|
|
int flags);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
int virDomainCpuSetParse(const char **str,
|
2008-07-11 16:23:36 +00:00
|
|
|
char sep,
|
|
|
|
char *cpuset,
|
|
|
|
int maxcpu);
|
2010-02-09 18:58:01 +00:00
|
|
|
char *virDomainCpuSetFormat(char *cpuset,
|
2008-07-11 16:23:36 +00:00
|
|
|
int maxcpu);
|
|
|
|
|
2009-08-14 09:31:36 +00:00
|
|
|
int virDomainDiskInsert(virDomainDefPtr def,
|
|
|
|
virDomainDiskDefPtr disk);
|
|
|
|
void virDomainDiskInsertPreAlloced(virDomainDefPtr def,
|
|
|
|
virDomainDiskDefPtr disk);
|
2010-06-15 22:17:34 +00:00
|
|
|
int virDomainDiskDefAssignAddress(virCapsPtr caps, virDomainDiskDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-08-23 09:31:26 +00:00
|
|
|
void virDomainDiskRemove(virDomainDefPtr def, size_t i);
|
|
|
|
|
2009-12-02 19:15:38 +00:00
|
|
|
int virDomainControllerInsert(virDomainDefPtr def,
|
|
|
|
virDomainControllerDefPtr controller);
|
|
|
|
void virDomainControllerInsertPreAlloced(virDomainDefPtr def,
|
|
|
|
virDomainControllerDefPtr controller);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
int virDomainSaveXML(const char *configDir,
|
2008-12-20 13:09:45 +00:00
|
|
|
virDomainDefPtr def,
|
|
|
|
const char *xml);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
int virDomainSaveConfig(const char *configDir,
|
2008-08-20 19:42:36 +00:00
|
|
|
virDomainDefPtr def);
|
2010-02-09 18:58:01 +00:00
|
|
|
int virDomainSaveStatus(virCapsPtr caps,
|
2009-06-12 11:38:50 +00:00
|
|
|
const char *statusDir,
|
2010-05-19 15:48:03 +00:00
|
|
|
virDomainObjPtr obj) ATTRIBUTE_RETURN_CHECK;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2008-11-17 16:52:32 +00:00
|
|
|
typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom,
|
|
|
|
int newDomain,
|
|
|
|
void *opaque);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
int virDomainLoadAllConfigs(virCapsPtr caps,
|
2008-10-10 14:20:37 +00:00
|
|
|
virDomainObjListPtr doms,
|
2008-07-11 16:23:36 +00:00
|
|
|
const char *configDir,
|
2008-11-17 16:52:32 +00:00
|
|
|
const char *autostartDir,
|
2009-06-12 11:38:50 +00:00
|
|
|
int liveStatus,
|
2008-11-17 16:52:32 +00:00
|
|
|
virDomainLoadConfigNotify notify,
|
|
|
|
void *opaque);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
int virDomainDeleteConfig(const char *configDir,
|
2008-08-20 19:42:36 +00:00
|
|
|
const char *autostartDir,
|
2008-07-11 16:23:36 +00:00
|
|
|
virDomainObjPtr dom);
|
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
char *virDomainConfigFile(const char *dir,
|
2008-08-20 19:42:36 +00:00
|
|
|
const char *name);
|
|
|
|
|
2008-09-03 16:05:25 +00:00
|
|
|
int virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk,
|
|
|
|
int *busIdx,
|
|
|
|
int *devIdx);
|
|
|
|
|
2009-04-22 14:26:50 +00:00
|
|
|
virDomainFSDefPtr virDomainGetRootFilesystem(virDomainDefPtr def);
|
2009-07-06 13:54:44 +00:00
|
|
|
int virDomainVideoDefaultType(virDomainDefPtr def);
|
|
|
|
int virDomainVideoDefaultRAM(virDomainDefPtr def, int type);
|
2009-04-22 14:26:50 +00:00
|
|
|
|
2009-11-02 18:37:38 +00:00
|
|
|
int virDomainObjIsDuplicate(virDomainObjListPtr doms,
|
|
|
|
virDomainDefPtr def,
|
|
|
|
unsigned int check_active);
|
|
|
|
|
2008-12-04 20:53:20 +00:00
|
|
|
void virDomainObjLock(virDomainObjPtr obj);
|
|
|
|
void virDomainObjUnlock(virDomainObjPtr obj);
|
2008-09-05 11:52:12 +00:00
|
|
|
|
Convert virDomainObjListPtr to use a hash of domain objects
The current virDomainObjListPtr object stores domain objects in
an array. This means that to find a particular objects requires
O(n) time, and more critically acquiring O(n) mutex locks.
The new impl replaces the array with a virHashTable, keyed off
UUID. Finding a object based on UUID is now O(1) time, and only
requires a single mutex lock. Finding by name/id is unchanged
in complexity.
In changing this, all code which iterates over the array had
to be updated to use a hash table iterator function callback.
Several of the functions which were identically duplicating
across all drivers were pulled into domain_conf.c
* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
virDomainObjListPtr to use virHashTable. Add a initializer
method virDomainObjListInit, and rename virDomainObjListFree
to virDomainObjListDeinit, since its not actually freeing
the container, only its contents. Also add some convenient
methods virDomainObjListGetInactiveNames,
virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
which can be used to implement the correspondingly named
public API entry points in drivers
* src/libvirt_private.syms: Export new methods from domain_conf.h
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
src/qemu/qemu_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
to deal with hash tables instead of arrays for domains
2009-10-09 11:33:51 +00:00
|
|
|
int virDomainObjListNumOfDomains(virDomainObjListPtr doms, int active);
|
|
|
|
|
|
|
|
int virDomainObjListGetActiveIDs(virDomainObjListPtr doms,
|
|
|
|
int *ids,
|
|
|
|
int maxids);
|
|
|
|
int virDomainObjListGetInactiveNames(virDomainObjListPtr doms,
|
|
|
|
char **const names,
|
|
|
|
int maxnames);
|
|
|
|
|
2010-06-24 14:06:43 +00:00
|
|
|
typedef int (*virDomainChrDefIterator)(virDomainDefPtr def,
|
|
|
|
virDomainChrDefPtr dev,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainChrDefForeach(virDomainDefPtr def,
|
|
|
|
bool abortOnError,
|
|
|
|
virDomainChrDefIterator iter,
|
|
|
|
void *opaque);
|
|
|
|
|
Convert virDomainObjListPtr to use a hash of domain objects
The current virDomainObjListPtr object stores domain objects in
an array. This means that to find a particular objects requires
O(n) time, and more critically acquiring O(n) mutex locks.
The new impl replaces the array with a virHashTable, keyed off
UUID. Finding a object based on UUID is now O(1) time, and only
requires a single mutex lock. Finding by name/id is unchanged
in complexity.
In changing this, all code which iterates over the array had
to be updated to use a hash table iterator function callback.
Several of the functions which were identically duplicating
across all drivers were pulled into domain_conf.c
* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
virDomainObjListPtr to use virHashTable. Add a initializer
method virDomainObjListInit, and rename virDomainObjListFree
to virDomainObjListDeinit, since its not actually freeing
the container, only its contents. Also add some convenient
methods virDomainObjListGetInactiveNames,
virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
which can be used to implement the correspondingly named
public API entry points in drivers
* src/libvirt_private.syms: Export new methods from domain_conf.h
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
src/qemu/qemu_driver.c, src/test/test_driver.c,
src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
to deal with hash tables instead of arrays for domains
2009-10-09 11:33:51 +00:00
|
|
|
|
2010-06-14 17:09:15 +00:00
|
|
|
typedef int (*virDomainDiskDefPathIterator)(virDomainDiskDefPtr disk,
|
|
|
|
const char *path,
|
|
|
|
size_t depth,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
|
|
|
|
bool allowProbing,
|
|
|
|
bool ignoreOpenFailure,
|
|
|
|
virDomainDiskDefPathIterator iter,
|
|
|
|
void *opaque);
|
|
|
|
|
2010-08-12 17:15:44 +00:00
|
|
|
typedef const char* (*virLifecycleToStringFunc)(int type);
|
|
|
|
typedef int (*virLifecycleFromStringFunc)(const char *type);
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainVirt)
|
|
|
|
VIR_ENUM_DECL(virDomainBoot)
|
|
|
|
VIR_ENUM_DECL(virDomainFeature)
|
|
|
|
VIR_ENUM_DECL(virDomainLifecycle)
|
2010-08-12 17:15:44 +00:00
|
|
|
VIR_ENUM_DECL(virDomainLifecycleCrash)
|
2009-03-02 17:39:43 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDevice)
|
2009-11-30 18:35:58 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDeviceAddress)
|
|
|
|
VIR_ENUM_DECL(virDomainDeviceAddressMode)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDisk)
|
|
|
|
VIR_ENUM_DECL(virDomainDiskDevice)
|
|
|
|
VIR_ENUM_DECL(virDomainDiskBus)
|
2009-01-30 17:15:39 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskCache)
|
2010-03-24 15:32:10 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskErrorPolicy)
|
2009-12-02 19:15:38 +00:00
|
|
|
VIR_ENUM_DECL(virDomainController)
|
2010-06-17 14:39:50 +00:00
|
|
|
VIR_ENUM_DECL(virDomainControllerModel)
|
2008-08-01 13:31:37 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFS)
|
2010-10-14 13:08:24 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFSAccessMode)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNet)
|
2010-07-13 19:05:34 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrDevice)
|
2010-07-13 20:06:38 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrChannelTarget)
|
2010-07-22 17:56:21 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrConsoleTarget)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChr)
|
2010-09-29 21:04:19 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrTcpProtocol)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSoundModel)
|
2010-07-15 13:02:42 +00:00
|
|
|
VIR_ENUM_DECL(virDomainMemballoonModel)
|
2009-10-21 12:26:38 +00:00
|
|
|
VIR_ENUM_DECL(virDomainWatchdogModel)
|
|
|
|
VIR_ENUM_DECL(virDomainWatchdogAction)
|
2009-07-06 13:54:44 +00:00
|
|
|
VIR_ENUM_DECL(virDomainVideo)
|
2008-08-08 14:27:05 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHostdevMode)
|
|
|
|
VIR_ENUM_DECL(virDomainHostdevSubsys)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainInput)
|
|
|
|
VIR_ENUM_DECL(virDomainInputBus)
|
|
|
|
VIR_ENUM_DECL(virDomainGraphics)
|
2009-01-19 21:06:26 +00:00
|
|
|
/* from libvirt.h */
|
|
|
|
VIR_ENUM_DECL(virDomainState)
|
2009-03-03 16:53:13 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSeclabel)
|
2010-02-02 17:22:03 +00:00
|
|
|
VIR_ENUM_DECL(virDomainClockOffset)
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-02-12 17:07:06 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetdevMacvtap)
|
|
|
|
|
2010-03-30 11:44:22 +00:00
|
|
|
VIR_ENUM_DECL(virDomainTimerName)
|
2010-03-31 17:03:54 +00:00
|
|
|
VIR_ENUM_DECL(virDomainTimerTrack)
|
2010-03-30 11:44:22 +00:00
|
|
|
VIR_ENUM_DECL(virDomainTimerTickpolicy)
|
|
|
|
VIR_ENUM_DECL(virDomainTimerMode)
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
#endif /* __DOMAIN_CONF_H */
|