2008-07-11 16:23:36 +00:00
|
|
|
/*
|
|
|
|
* domain_conf.h: domain XML processing
|
|
|
|
*
|
2013-01-18 18:36:36 +00:00
|
|
|
* Copyright (C) 2006-2013 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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2008-07-11 16:23:36 +00:00
|
|
|
*
|
|
|
|
* 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"
|
2012-12-13 17:44:57 +00:00
|
|
|
# include "virutil.h"
|
2012-12-13 15:49:48 +00:00
|
|
|
# include "virthread.h"
|
2012-01-25 16:13:59 +00:00
|
|
|
# include "virhash.h"
|
Split src/util/network.{c,h} into 5 pieces
The src/util/network.c file is a dumping ground for many different
APIs. Split it up into 5 pieces, along functional lines
- src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
- src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
- src/util/virsocketaddr.c: virSocketAddr and APIs
- src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
for virNetDevBandwidth
- src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
for virNetDevVPortProfile
* src/util/network.c, src/util/network.h: Split into 5 pieces
* src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
* daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
src/conf/domain_conf.h, src/conf/network_conf.c,
src/conf/network_conf.h, src/conf/nwfilter_conf.h,
src/esx/esx_util.h, src/network/bridge_driver.c,
src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
src/util/virnetdev.h, src/util/virnetdevtap.c,
tools/virsh.c: Update include files
2011-11-02 15:40:08 +00:00
|
|
|
# include "virsocketaddr.h"
|
2010-03-25 17:46:07 +00:00
|
|
|
# include "nwfilter_params.h"
|
2011-11-02 17:11:02 +00:00
|
|
|
# include "virnetdevmacvlan.h"
|
2012-12-13 15:31:53 +00:00
|
|
|
# include "virsysinfo.h"
|
Split src/util/network.{c,h} into 5 pieces
The src/util/network.c file is a dumping ground for many different
APIs. Split it up into 5 pieces, along functional lines
- src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
- src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
- src/util/virsocketaddr.c: virSocketAddr and APIs
- src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
for virNetDevBandwidth
- src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
for virNetDevVPortProfile
* src/util/network.c, src/util/network.h: Split into 5 pieces
* src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
* daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
src/conf/domain_conf.h, src/conf/network_conf.c,
src/conf/network_conf.h, src/conf/nwfilter_conf.h,
src/esx/esx_util.h, src/network/bridge_driver.c,
src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
src/util/virnetdev.h, src/util/virnetdevtap.c,
tools/virsh.c: Update include files
2011-11-02 15:40:08 +00:00
|
|
|
# include "virnetdevvportprofile.h"
|
2012-02-10 21:09:00 +00:00
|
|
|
# include "virnetdevopenvswitch.h"
|
Split src/util/network.{c,h} into 5 pieces
The src/util/network.c file is a dumping ground for many different
APIs. Split it up into 5 pieces, along functional lines
- src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
- src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
- src/util/virsocketaddr.c: virSocketAddr and APIs
- src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
for virNetDevBandwidth
- src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
for virNetDevVPortProfile
* src/util/network.c, src/util/network.h: Split into 5 pieces
* src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
* daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
src/conf/domain_conf.h, src/conf/network_conf.c,
src/conf/network_conf.h, src/conf/nwfilter_conf.h,
src/esx/esx_util.h, src/network/bridge_driver.c,
src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
src/util/virnetdev.h, src/util/virnetdevtap.c,
tools/virsh.c: Update include files
2011-11-02 15:40:08 +00:00
|
|
|
# include "virnetdevbandwidth.h"
|
2012-08-12 07:51:30 +00:00
|
|
|
# include "virnetdevvlan.h"
|
2012-07-11 13:35:46 +00:00
|
|
|
# include "virobject.h"
|
2012-08-16 15:41:06 +00:00
|
|
|
# include "device_conf.h"
|
2012-12-04 11:56:32 +00:00
|
|
|
# include "virbitmap.h"
|
2012-12-13 15:25:48 +00:00
|
|
|
# include "virstoragefile.h"
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
/* forward declarations of all device types, required by
|
|
|
|
* virDomainDeviceDef
|
|
|
|
*/
|
|
|
|
typedef struct _virDomainDiskDef virDomainDiskDef;
|
|
|
|
typedef virDomainDiskDef *virDomainDiskDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainControllerDef virDomainControllerDef;
|
|
|
|
typedef virDomainControllerDef *virDomainControllerDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainLeaseDef virDomainLeaseDef;
|
|
|
|
typedef virDomainLeaseDef *virDomainLeaseDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainFSDef virDomainFSDef;
|
|
|
|
typedef virDomainFSDef *virDomainFSDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainNetDef virDomainNetDef;
|
|
|
|
typedef virDomainNetDef *virDomainNetDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainInputDef virDomainInputDef;
|
|
|
|
typedef virDomainInputDef *virDomainInputDefPtr;
|
|
|
|
|
2012-05-15 22:55:09 +00:00
|
|
|
typedef struct _virDomainSoundCodecDef virDomainSoundCodecDef;
|
|
|
|
typedef virDomainSoundCodecDef *virDomainSoundCodecDefPtr;
|
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
typedef struct _virDomainSoundDef virDomainSoundDef;
|
|
|
|
typedef virDomainSoundDef *virDomainSoundDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainVideoDef virDomainVideoDef;
|
|
|
|
typedef virDomainVideoDef *virDomainVideoDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainHostdevDef virDomainHostdevDef;
|
|
|
|
typedef virDomainHostdevDef *virDomainHostdevDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainWatchdogDef virDomainWatchdogDef;
|
|
|
|
typedef virDomainWatchdogDef *virDomainWatchdogDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainGraphicsDef virDomainGraphicsDef;
|
|
|
|
typedef virDomainGraphicsDef *virDomainGraphicsDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainHubDef virDomainHubDef;
|
|
|
|
typedef virDomainHubDef *virDomainHubDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainRedirdevDef virDomainRedirdevDef;
|
|
|
|
typedef virDomainRedirdevDef *virDomainRedirdevDefPtr;
|
|
|
|
|
2012-09-13 07:25:45 +00:00
|
|
|
typedef struct _virDomainRedirFilterUsbDevDef virDomainRedirFilterUsbDevDef;
|
|
|
|
typedef virDomainRedirFilterUsbDevDef *virDomainRedirFilterUsbDevDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainRedirFilterDef virDomainRedirFilterDef;
|
|
|
|
typedef virDomainRedirFilterDef *virDomainRedirFilterDefPtr;
|
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
typedef struct _virDomainSmartcardDef virDomainSmartcardDef;
|
|
|
|
typedef virDomainSmartcardDef *virDomainSmartcardDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainChrDef virDomainChrDef;
|
|
|
|
typedef virDomainChrDef *virDomainChrDefPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainMemballoonDef virDomainMemballoonDef;
|
|
|
|
typedef virDomainMemballoonDef *virDomainMemballoonDefPtr;
|
|
|
|
|
2012-08-14 00:09:12 +00:00
|
|
|
typedef struct _virDomainSnapshotObj virDomainSnapshotObj;
|
|
|
|
typedef virDomainSnapshotObj *virDomainSnapshotObjPtr;
|
|
|
|
|
|
|
|
typedef struct _virDomainSnapshotObjList virDomainSnapshotObjList;
|
|
|
|
typedef virDomainSnapshotObjList *virDomainSnapshotObjListPtr;
|
|
|
|
|
2013-01-11 16:34:37 +00:00
|
|
|
typedef struct _virDomainRNGDef virDomainRNGDef;
|
|
|
|
typedef virDomainRNGDef *virDomainRNGDefPtr;
|
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
/* Flags for the 'type' field in virDomainDeviceDef */
|
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_DEVICE_NONE = 0,
|
|
|
|
VIR_DOMAIN_DEVICE_DISK,
|
|
|
|
VIR_DOMAIN_DEVICE_LEASE,
|
|
|
|
VIR_DOMAIN_DEVICE_FS,
|
|
|
|
VIR_DOMAIN_DEVICE_NET,
|
|
|
|
VIR_DOMAIN_DEVICE_INPUT,
|
|
|
|
VIR_DOMAIN_DEVICE_SOUND,
|
|
|
|
VIR_DOMAIN_DEVICE_VIDEO,
|
|
|
|
VIR_DOMAIN_DEVICE_HOSTDEV,
|
|
|
|
VIR_DOMAIN_DEVICE_WATCHDOG,
|
|
|
|
VIR_DOMAIN_DEVICE_CONTROLLER,
|
|
|
|
VIR_DOMAIN_DEVICE_GRAPHICS,
|
|
|
|
VIR_DOMAIN_DEVICE_HUB,
|
|
|
|
VIR_DOMAIN_DEVICE_REDIRDEV,
|
|
|
|
VIR_DOMAIN_DEVICE_SMARTCARD,
|
|
|
|
VIR_DOMAIN_DEVICE_CHR,
|
|
|
|
VIR_DOMAIN_DEVICE_MEMBALLOON,
|
2013-01-11 16:34:37 +00:00
|
|
|
VIR_DOMAIN_DEVICE_RNG,
|
2012-02-16 21:41:47 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_DEVICE_LAST
|
2012-02-16 21:41:47 +00:00
|
|
|
} virDomainDeviceType;
|
|
|
|
|
|
|
|
typedef struct _virDomainDeviceDef virDomainDeviceDef;
|
|
|
|
typedef virDomainDeviceDef *virDomainDeviceDefPtr;
|
|
|
|
struct _virDomainDeviceDef {
|
|
|
|
int type; /* enum virDomainDeviceType */
|
|
|
|
union {
|
|
|
|
virDomainDiskDefPtr disk;
|
|
|
|
virDomainControllerDefPtr controller;
|
|
|
|
virDomainLeaseDefPtr lease;
|
|
|
|
virDomainFSDefPtr fs;
|
|
|
|
virDomainNetDefPtr net;
|
|
|
|
virDomainInputDefPtr input;
|
|
|
|
virDomainSoundDefPtr sound;
|
|
|
|
virDomainVideoDefPtr video;
|
|
|
|
virDomainHostdevDefPtr hostdev;
|
|
|
|
virDomainWatchdogDefPtr watchdog;
|
|
|
|
virDomainGraphicsDefPtr graphics;
|
|
|
|
virDomainHubDefPtr hub;
|
|
|
|
virDomainRedirdevDefPtr redirdev;
|
|
|
|
virDomainSmartcardDefPtr smartcard;
|
|
|
|
virDomainChrDefPtr chr;
|
|
|
|
virDomainMemballoonDefPtr memballoon;
|
2013-01-11 16:34:37 +00:00
|
|
|
virDomainRNGDefPtr rng;
|
2012-02-16 21:41:47 +00:00
|
|
|
} data;
|
|
|
|
};
|
|
|
|
|
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_TEST,
|
|
|
|
VIR_DOMAIN_VIRT_VMWARE,
|
|
|
|
VIR_DOMAIN_VIRT_HYPERV,
|
2009-04-17 16:09:07 +00:00
|
|
|
VIR_DOMAIN_VIRT_VBOX,
|
2009-07-24 14:17:06 +00:00
|
|
|
VIR_DOMAIN_VIRT_PHYP,
|
2012-07-31 18:56:05 +00:00
|
|
|
VIR_DOMAIN_VIRT_PARALLELS,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_VIRT_LAST
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
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,
|
2011-01-10 16:41:33 +00:00
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID,
|
2011-09-02 13:28:27 +00:00
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB,
|
2011-12-12 23:39:31 +00:00
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO,
|
2012-06-29 15:02:05 +00:00
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390,
|
2009-11-30 18:35:58 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2012-01-24 17:53:59 +00:00
|
|
|
enum virDomainPciRombarMode {
|
|
|
|
VIR_DOMAIN_PCI_ROMBAR_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_PCI_ROMBAR_ON,
|
|
|
|
VIR_DOMAIN_PCI_ROMBAR_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_PCI_ROMBAR_LAST
|
|
|
|
};
|
|
|
|
|
2009-12-01 16:56:24 +00:00
|
|
|
typedef struct _virDomainDeviceDriveAddress virDomainDeviceDriveAddress;
|
|
|
|
typedef virDomainDeviceDriveAddress *virDomainDeviceDriveAddressPtr;
|
|
|
|
struct _virDomainDeviceDriveAddress {
|
|
|
|
unsigned int controller;
|
|
|
|
unsigned int bus;
|
2012-02-27 10:19:54 +00:00
|
|
|
unsigned int target;
|
2009-12-01 16:56:24 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2011-01-10 16:41:33 +00:00
|
|
|
typedef struct _virDomainDeviceCcidAddress virDomainDeviceCcidAddress;
|
|
|
|
typedef virDomainDeviceCcidAddress *virDomainDeviceCcidAddressPtr;
|
|
|
|
struct _virDomainDeviceCcidAddress {
|
|
|
|
unsigned int controller;
|
|
|
|
unsigned int slot;
|
|
|
|
};
|
|
|
|
|
2011-09-02 13:28:27 +00:00
|
|
|
typedef struct _virDomainDeviceUSBAddress virDomainDeviceUSBAddress;
|
|
|
|
typedef virDomainDeviceUSBAddress *virDomainDeviceUSBAddressPtr;
|
|
|
|
struct _virDomainDeviceUSBAddress {
|
|
|
|
unsigned int bus;
|
2011-09-02 14:31:26 +00:00
|
|
|
char *port;
|
2011-09-02 13:28:27 +00:00
|
|
|
};
|
|
|
|
|
2011-12-12 23:39:31 +00:00
|
|
|
typedef struct _virDomainDeviceSpaprVioAddress virDomainDeviceSpaprVioAddress;
|
|
|
|
typedef virDomainDeviceSpaprVioAddress *virDomainDeviceSpaprVioAddressPtr;
|
|
|
|
struct _virDomainDeviceSpaprVioAddress {
|
|
|
|
unsigned long long reg;
|
|
|
|
bool has_reg;
|
|
|
|
};
|
|
|
|
|
2011-09-02 14:03:51 +00:00
|
|
|
enum virDomainControllerMaster {
|
|
|
|
VIR_DOMAIN_CONTROLLER_MASTER_NONE,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MASTER_USB,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MASTER_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainDeviceUSBMaster virDomainDeviceUSBMaster;
|
|
|
|
typedef virDomainDeviceUSBMaster *virDomainDeviceUSBMasterPtr;
|
|
|
|
struct _virDomainDeviceUSBMaster {
|
|
|
|
unsigned int startport;
|
|
|
|
};
|
|
|
|
|
2009-11-30 18:35:58 +00:00
|
|
|
typedef struct _virDomainDeviceInfo virDomainDeviceInfo;
|
|
|
|
typedef virDomainDeviceInfo *virDomainDeviceInfoPtr;
|
|
|
|
struct _virDomainDeviceInfo {
|
2012-05-15 15:16:49 +00:00
|
|
|
/* If adding to this struct, ensure that
|
|
|
|
* virDomainDeviceInfoIsSet() is updated
|
|
|
|
* to consider the new fields
|
|
|
|
*/
|
2010-01-08 15:53:53 +00:00
|
|
|
char *alias;
|
2009-11-30 18:35:58 +00:00
|
|
|
int type;
|
|
|
|
union {
|
2012-08-16 15:41:06 +00:00
|
|
|
virDevicePCIAddress pci;
|
2009-12-01 16:56:24 +00:00
|
|
|
virDomainDeviceDriveAddress drive;
|
2010-02-18 16:52:03 +00:00
|
|
|
virDomainDeviceVirtioSerialAddress vioserial;
|
2011-01-10 16:41:33 +00:00
|
|
|
virDomainDeviceCcidAddress ccid;
|
2011-09-02 13:28:27 +00:00
|
|
|
virDomainDeviceUSBAddress usb;
|
2011-12-12 23:39:31 +00:00
|
|
|
virDomainDeviceSpaprVioAddress spaprvio;
|
2009-11-30 18:35:58 +00:00
|
|
|
} addr;
|
2011-09-02 14:03:51 +00:00
|
|
|
int mastertype;
|
|
|
|
union {
|
|
|
|
virDomainDeviceUSBMaster usb;
|
|
|
|
} master;
|
2012-02-09 07:33:29 +00:00
|
|
|
/* rombar and romfile are only used for pci hostdev and network
|
|
|
|
* devices. */
|
2012-01-24 17:53:59 +00:00
|
|
|
int rombar; /* enum virDomainPciRombarMode */
|
2012-01-25 16:20:49 +00:00
|
|
|
char *romfile;
|
2012-11-14 14:51:30 +00:00
|
|
|
/* bootIndex is only used for disk, network interface, hostdev
|
|
|
|
* and redirdev devices */
|
2012-01-24 17:53:59 +00:00
|
|
|
int bootIndex;
|
2009-11-30 18:35:58 +00:00
|
|
|
};
|
|
|
|
|
2011-12-23 00:47:48 +00:00
|
|
|
enum virDomainSeclabelType {
|
Add two new security label types
Curently security labels can be of type 'dynamic' or 'static'.
If no security label is given, then 'dynamic' is assumed. The
current code takes advantage of this default, and avoids even
saving <seclabel> elements with type='dynamic' to disk. This
means if you temporarily change security driver, the guests
can all still start.
With the introduction of sVirt to LXC though, there needs to be
a new default of 'none' to allow unconfined LXC containers.
This patch introduces two new security label types
- default: the host configuration decides whether to run the
guest with type 'none' or 'dynamic' at guest start
- none: the guest will run unconfined by security policy
The 'none' label type will obviously be undesirable for some
deployments, so a new qemu.conf option allows a host admin to
mandate confined guests. It is also possible to turn off default
confinement
security_default_confined = 1|0 (default == 1)
security_require_confined = 1|0 (default == 0)
* src/conf/domain_conf.c, src/conf/domain_conf.h: Add new
seclabel types
* src/security/security_manager.c, src/security/security_manager.h:
Set default sec label types
* src/security/security_selinux.c: Handle 'none' seclabel type
* src/qemu/qemu.conf, src/qemu/qemu_conf.c, src/qemu/qemu_conf.h,
src/qemu/libvirtd_qemu.aug: New security config options
* src/qemu/qemu_driver.c: Tell security driver about default
config
2012-01-25 14:12:52 +00:00
|
|
|
VIR_DOMAIN_SECLABEL_DEFAULT,
|
|
|
|
VIR_DOMAIN_SECLABEL_NONE,
|
2011-12-23 00:47:48 +00:00
|
|
|
VIR_DOMAIN_SECLABEL_DYNAMIC,
|
|
|
|
VIR_DOMAIN_SECLABEL_STATIC,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_SECLABEL_LAST
|
2011-12-23 00:47:48 +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 */
|
|
|
|
char *baselabel; /* base name of label string */
|
|
|
|
int type; /* virDomainSeclabelType */
|
|
|
|
bool norelabel;
|
2012-08-31 11:40:41 +00:00
|
|
|
bool implicit; /* true if seclabel is auto-added */
|
2011-12-23 00:47:48 +00:00
|
|
|
};
|
|
|
|
|
2012-01-25 14:12:51 +00:00
|
|
|
|
|
|
|
/* Security configuration for domain */
|
|
|
|
typedef struct _virSecurityDeviceLabelDef virSecurityDeviceLabelDef;
|
|
|
|
typedef virSecurityDeviceLabelDef *virSecurityDeviceLabelDefPtr;
|
|
|
|
struct _virSecurityDeviceLabelDef {
|
2012-08-15 22:10:35 +00:00
|
|
|
char *model;
|
2012-01-25 14:12:51 +00:00
|
|
|
char *label; /* image label string */
|
|
|
|
bool norelabel;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-10-20 09:50:10 +00:00
|
|
|
typedef struct _virDomainHostdevOrigStates virDomainHostdevOrigStates;
|
|
|
|
typedef virDomainHostdevOrigStates *virDomainHostdevOrigStatesPtr;
|
|
|
|
struct _virDomainHostdevOrigStates {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
/* Does the device need to unbind from stub when
|
|
|
|
* reattaching to host?
|
|
|
|
*/
|
|
|
|
unsigned int unbind_from_stub : 1;
|
|
|
|
|
|
|
|
/* Does it need to use remove_slot when reattaching
|
|
|
|
* the device to host?
|
|
|
|
*/
|
|
|
|
unsigned int remove_slot : 1;
|
|
|
|
|
|
|
|
/* Does it need to reprobe driver for the device when
|
|
|
|
* reattaching to host?
|
|
|
|
*/
|
|
|
|
unsigned int reprobe :1;
|
|
|
|
} pci;
|
|
|
|
|
|
|
|
/* Perhaps 'usb' in future */
|
|
|
|
} states;
|
|
|
|
};
|
|
|
|
|
2010-12-09 18:25:11 +00:00
|
|
|
struct _virDomainLeaseDef {
|
|
|
|
char *lockspace;
|
|
|
|
char *key;
|
|
|
|
char *path;
|
|
|
|
unsigned long long offset;
|
|
|
|
};
|
|
|
|
|
2009-11-30 18:35:58 +00:00
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
enum virDomainHostdevMode {
|
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_SUBSYS,
|
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_HOSTDEV_MODE_LAST
|
2012-02-16 21:41:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainHostdevSubsysType {
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB,
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2012-02-27 06:42:22 +00:00
|
|
|
|
|
|
|
typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys;
|
|
|
|
typedef virDomainHostdevSubsys *virDomainHostdevSubsysPtr;
|
|
|
|
struct _virDomainHostdevSubsys {
|
2012-07-25 14:27:06 +00:00
|
|
|
int type; /* enum virDomainHostdevSubsysType */
|
2012-02-27 06:42:22 +00:00
|
|
|
union {
|
|
|
|
struct {
|
2012-10-09 11:15:46 +00:00
|
|
|
bool autoAddress; /* bus/device were filled automatically based
|
|
|
|
on vedor/product */
|
2012-02-27 06:42:22 +00:00
|
|
|
unsigned bus;
|
|
|
|
unsigned device;
|
|
|
|
|
|
|
|
unsigned vendor;
|
|
|
|
unsigned product;
|
|
|
|
} usb;
|
2012-08-16 15:41:06 +00:00
|
|
|
virDevicePCIAddress pci; /* host address */
|
2012-02-27 06:42:22 +00:00
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2012-11-23 13:50:29 +00:00
|
|
|
|
|
|
|
enum virDomainHostdevCapsType {
|
|
|
|
VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE,
|
|
|
|
VIR_DOMAIN_HOSTDEV_CAPS_TYPE_MISC,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HOSTDEV_CAPS_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainHostdevCaps virDomainHostdevCaps;
|
|
|
|
typedef virDomainHostdevCaps *virDomainHostdevCapsPtr;
|
|
|
|
struct _virDomainHostdevCaps {
|
|
|
|
int type; /* enum virDOmainHostdevCapsType */
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *block;
|
|
|
|
} storage;
|
|
|
|
struct {
|
|
|
|
char *chardev;
|
|
|
|
} misc;
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-02-16 21:41:47 +00:00
|
|
|
/* basic device for direct passthrough */
|
|
|
|
struct _virDomainHostdevDef {
|
conf: give each hostdevdef a parent pointer
The parent can be any type of device. It defaults to type=none, and a
NULL pointer. The intent is that if a hostdevdef is contained in the
def for a higher level device (e.g. virDomainNetDef), hostdev->parent
will point to the higher level device, and type will be set to that
type of device. This way, during attach and detach of the device,
parent can be checked, and appropriate callouts made to do higher
level device initialization (e.g. setting MAC address).
Also, although these hostdevs with parents will be added to a domain's
hostdevs list, they will be treated slightly differently when
traversing the list, e.g. virDomainHostdefDefFree for a hostdev that
has a parent doesn't need to be called (and will be a NOP); it will
simply be removed from the list (since the parent device object is in
its own type-specific list, and will be freed from there).
2012-02-03 16:13:08 +00:00
|
|
|
virDomainDeviceDef parent; /* higher level Def containing this */
|
2012-02-16 21:41:47 +00:00
|
|
|
int mode; /* enum virDomainHostdevMode */
|
2012-10-02 13:14:02 +00:00
|
|
|
int startupPolicy; /* enum virDomainStartupPolicy */
|
2012-02-16 21:41:47 +00:00
|
|
|
unsigned int managed : 1;
|
2012-10-03 14:57:28 +00:00
|
|
|
unsigned int missing : 1;
|
2012-02-16 21:41:47 +00:00
|
|
|
union {
|
2012-02-27 06:42:22 +00:00
|
|
|
virDomainHostdevSubsys subsys;
|
2012-11-23 13:50:29 +00:00
|
|
|
virDomainHostdevCaps caps;
|
2012-02-16 21:41:47 +00:00
|
|
|
} source;
|
|
|
|
virDomainHostdevOrigStates origstates;
|
2012-01-31 09:16:54 +00:00
|
|
|
virDomainDeviceInfoPtr info; /* Guest address */
|
2012-02-16 21:41:47 +00:00
|
|
|
};
|
|
|
|
|
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,
|
2010-12-06 07:24:09 +00:00
|
|
|
VIR_DOMAIN_DISK_TYPE_NETWORK,
|
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,
|
qemu: add new disk device='lun' for bus='virtio' & type='block'
In the past, generic SCSI commands issued from a guest to a virtio
disk were always passed through to the underlying disk by qemu, and
the kernel would also pass them on.
As a result of CVE-2011-4127 (see:
http://seclists.org/oss-sec/2011/q4/536), qemu now honors its
scsi=on|off device option for virtio-blk-pci (which enables/disables
passthrough of generic SCSI commands), and the kernel will only allow
the commands for physical devices (not for partitions or logical
volumes). The default behavior of qemu is still to allow sending
generic SCSI commands to physical disks that are presented to a guest
as virtio-blk-pci devices, but libvirt prefers to disable those
commands in the standard virtio block devices, enabling it only when
specifically requested (hopefully indicating that the requester
understands what they're asking for). For this purpose, a new libvirt
disk device type (device='lun') has been created.
device='lun' is identical to the default device='disk', except that:
1) It is only allowed if bus='virtio', type='block', and the qemu
version is "new enough" to support it ("new enough" == qemu 0.11 or
better), otherwise the domain will fail to start and a
CONFIG_UNSUPPORTED error will be logged).
2) The option "scsi=on" will be added to the -device arg to allow
SG_IO commands (if device !='lun', "scsi=off" will be added to the
-device arg so that SG_IO commands are specifically forbidden).
Guests which continue to use disk device='disk' (the default) will no
longer be able to use SG_IO commands on the disk; those that have
their disk device changed to device='lun' will still be able to use SG_IO
commands.
*docs/formatdomain.html.in - document the new device attribute value.
*docs/schemas/domaincommon.rng - allow it in the RNG
*tests/* - update the args of several existing tests to add scsi=off, and
add one new test that will test scsi=on.
*src/conf/domain_conf.c - update domain XML parser and formatter
*src/qemu/qemu_(command|driver|hotplug).c - treat
VIR_DOMAIN_DISK_DEVICE_LUN *almost* identically to
VIR_DOMAIN_DISK_DEVICE_DISK, except as indicated above.
Note that no support for this new device value was added to any
hypervisor drivers other than qemu, because it's unclear what it might
mean (if anything) to those drivers.
2012-01-05 03:48:38 +00:00
|
|
|
VIR_DOMAIN_DISK_DEVICE_LUN,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
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,
|
2011-09-02 13:36:58 +00:00
|
|
|
VIR_DOMAIN_DISK_CACHE_DIRECTSYNC,
|
2011-09-22 19:33:47 +00:00
|
|
|
VIR_DOMAIN_DISK_CACHE_UNSAFE,
|
2009-01-30 17:15:39 +00:00
|
|
|
|
|
|
|
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,
|
2011-10-04 18:17:06 +00:00
|
|
|
VIR_DOMAIN_DISK_ERROR_POLICY_REPORT,
|
2010-03-24 15:32:10 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2010-12-06 07:24:09 +00:00
|
|
|
enum virDomainDiskProtocol {
|
|
|
|
VIR_DOMAIN_DISK_PROTOCOL_NBD,
|
|
|
|
VIR_DOMAIN_DISK_PROTOCOL_RBD,
|
|
|
|
VIR_DOMAIN_DISK_PROTOCOL_SHEEPDOG,
|
2012-11-22 18:10:38 +00:00
|
|
|
VIR_DOMAIN_DISK_PROTOCOL_GLUSTER,
|
2010-12-06 07:24:09 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_PROTOCOL_LAST
|
|
|
|
};
|
|
|
|
|
2012-11-22 18:10:38 +00:00
|
|
|
enum virDomainDiskProtocolTransport {
|
|
|
|
VIR_DOMAIN_DISK_PROTO_TRANS_TCP,
|
|
|
|
VIR_DOMAIN_DISK_PROTO_TRANS_UNIX,
|
|
|
|
VIR_DOMAIN_DISK_PROTO_TRANS_RDMA,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_PROTO_TRANS_LAST
|
|
|
|
};
|
|
|
|
|
2012-03-23 14:21:09 +00:00
|
|
|
enum virDomainDiskTray {
|
|
|
|
VIR_DOMAIN_DISK_TRAY_CLOSED,
|
|
|
|
VIR_DOMAIN_DISK_TRAY_OPEN,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_TRAY_LAST
|
|
|
|
};
|
|
|
|
|
2012-08-20 13:58:50 +00:00
|
|
|
enum virDomainDiskGeometryTrans {
|
|
|
|
VIR_DOMAIN_DISK_TRANS_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_DISK_TRANS_NONE,
|
|
|
|
VIR_DOMAIN_DISK_TRANS_AUTO,
|
|
|
|
VIR_DOMAIN_DISK_TRANS_LBA,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_TRANS_LAST
|
|
|
|
};
|
|
|
|
|
2010-12-06 07:24:09 +00:00
|
|
|
typedef struct _virDomainDiskHostDef virDomainDiskHostDef;
|
|
|
|
typedef virDomainDiskHostDef *virDomainDiskHostDefPtr;
|
|
|
|
struct _virDomainDiskHostDef {
|
|
|
|
char *name;
|
|
|
|
char *port;
|
2012-11-22 18:10:38 +00:00
|
|
|
int transport; /* enum virDomainDiskProtocolTransport */
|
|
|
|
char *socket; /* path to unix socket */
|
2010-12-06 07:24:09 +00:00
|
|
|
};
|
|
|
|
|
2010-04-21 14:28:21 +00:00
|
|
|
enum virDomainDiskIo {
|
|
|
|
VIR_DOMAIN_DISK_IO_DEFAULT,
|
|
|
|
VIR_DOMAIN_DISK_IO_NATIVE,
|
|
|
|
VIR_DOMAIN_DISK_IO_THREADS,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_IO_LAST
|
|
|
|
};
|
|
|
|
|
2011-06-20 08:26:47 +00:00
|
|
|
enum virDomainIoEventFd {
|
|
|
|
VIR_DOMAIN_IO_EVENT_FD_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_IO_EVENT_FD_ON,
|
|
|
|
VIR_DOMAIN_IO_EVENT_FD_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_IO_EVENT_FD_LAST
|
|
|
|
};
|
|
|
|
|
2011-08-13 06:32:45 +00:00
|
|
|
enum virDomainVirtioEventIdx {
|
|
|
|
VIR_DOMAIN_VIRTIO_EVENT_IDX_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_VIRTIO_EVENT_IDX_ON,
|
|
|
|
VIR_DOMAIN_VIRTIO_EVENT_IDX_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_VIRTIO_EVENT_IDX_LAST
|
|
|
|
};
|
|
|
|
|
2012-01-12 09:31:14 +00:00
|
|
|
enum virDomainDiskCopyOnRead {
|
|
|
|
VIR_DOMAIN_DISK_COPY_ON_READ_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_DISK_COPY_ON_READ_ON,
|
|
|
|
VIR_DOMAIN_DISK_COPY_ON_READ_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_COPY_ON_READ_LAST
|
|
|
|
};
|
|
|
|
|
2011-10-17 14:54:03 +00:00
|
|
|
enum virDomainStartupPolicy {
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_MANDATORY,
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_REQUISITE,
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_OPTIONAL,
|
|
|
|
|
|
|
|
VIR_DOMAIN_STARTUP_POLICY_LAST
|
|
|
|
};
|
|
|
|
|
2011-10-28 18:29:39 +00:00
|
|
|
enum virDomainDiskSecretType {
|
|
|
|
VIR_DOMAIN_DISK_SECRET_TYPE_NONE,
|
|
|
|
VIR_DOMAIN_DISK_SECRET_TYPE_UUID,
|
|
|
|
VIR_DOMAIN_DISK_SECRET_TYPE_USAGE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_SECRET_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2013-01-02 14:37:09 +00:00
|
|
|
enum virDomainDiskSGIO {
|
|
|
|
VIR_DOMAIN_DISK_SGIO_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_DISK_SGIO_FILTERED,
|
|
|
|
VIR_DOMAIN_DISK_SGIO_UNFILTERED,
|
|
|
|
|
|
|
|
VIR_DOMAIN_DISK_SGIO_LAST
|
|
|
|
};
|
|
|
|
|
2011-11-15 09:02:46 +00:00
|
|
|
typedef struct _virDomainBlockIoTuneInfo virDomainBlockIoTuneInfo;
|
|
|
|
struct _virDomainBlockIoTuneInfo {
|
|
|
|
unsigned long long total_bytes_sec;
|
|
|
|
unsigned long long read_bytes_sec;
|
|
|
|
unsigned long long write_bytes_sec;
|
|
|
|
unsigned long long total_iops_sec;
|
|
|
|
unsigned long long read_iops_sec;
|
|
|
|
unsigned long long write_iops_sec;
|
|
|
|
};
|
|
|
|
typedef virDomainBlockIoTuneInfo *virDomainBlockIoTuneInfoPtr;
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Stores the virtual disk configuration */
|
|
|
|
struct _virDomainDiskDef {
|
|
|
|
int type;
|
|
|
|
int device;
|
|
|
|
int bus;
|
|
|
|
char *src;
|
|
|
|
char *dst;
|
2012-03-23 14:21:09 +00:00
|
|
|
int tray_status;
|
2010-12-06 07:24:09 +00:00
|
|
|
int protocol;
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nhosts;
|
2010-12-06 07:24:09 +00:00
|
|
|
virDomainDiskHostDefPtr hosts;
|
2011-10-28 18:29:39 +00:00
|
|
|
struct {
|
|
|
|
char *username;
|
|
|
|
int secretType; /* enum virDomainDiskSecretType */
|
|
|
|
union {
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
|
|
|
char *usage;
|
|
|
|
} secret;
|
|
|
|
} auth;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *driverName;
|
2012-10-15 21:47:42 +00:00
|
|
|
int format; /* enum virStorageFileFormat */
|
storage: cache backing chain while qemu domain is live
Technically, we should not be re-probing any file that qemu might
be currently writing to. As such, we should cache the backing
file chain prior to starting qemu. This patch adds the cache,
but does not use it until the next patch.
Ultimately, we want to also store the chain in domain XML, so that
it is remembered across libvirtd restarts, and so that the only
kosher way to modify the backing chain of an offline domain will be
through libvirt API calls, but we aren't there yet. So for now, we
merely invalidate the cache any time we do a live operation that
alters the chain (block-pull, block-commit, external disk snapshot),
as well as tear down the cache when the domain is not running.
* src/conf/domain_conf.h (_virDomainDiskDef): New field.
* src/conf/domain_conf.c (virDomainDiskDefFree): Clean new field.
* src/qemu/qemu_domain.h (qemuDomainDetermineDiskChain): New
prototype.
* src/qemu/qemu_domain.c (qemuDomainDetermineDiskChain): New
function.
* src/qemu/qemu_driver.c (qemuDomainAttachDeviceDiskLive)
(qemuDomainChangeDiskMediaLive): Pre-populate chain.
(qemuDomainSnapshotCreateSingleDiskActive): Uncache chain before
snapshot.
* src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Update
chain after block pull.
2012-10-09 22:08:14 +00:00
|
|
|
virStorageFileMetadataPtr backingChain;
|
2011-11-15 09:02:46 +00:00
|
|
|
|
blockjob: enhance xml to track mirrors across libvirtd restart
In order to track a block copy job across libvirtd restarts, we
need to save internal XML that tracks the name of the file
holding the mirror. Displaying this name in dumpxml might also
be useful to the user, even if we don't yet have a way to (re-)
start a domain with mirroring enabled up front. This is done
with a new <mirror> sub-element to <disk>, as in:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/original.img'/>
<mirror file='/var/lib/libvirt/images/copy.img' format='qcow2' ready='yes'/>
...
</disk>
For now, the element is output-only, in live domains; it is ignored
when defining a domain or hot-plugging a disk (since those contexts
use VIR_DOMAIN_XML_INACTIVE in parsing). The 'ready' attribute appears
when libvirt knows that the job has changed from the initial pulling
phase over to the mirroring phase, although absence of the attribute
is not a sure indicator of the current phase. If we come up with a way
to make qemu start with mirroring enabled, we can relax the xml
restriction, and allow <mirror> (but not attribute 'ready') on input.
Testing active-only XML meant tweaking the testsuite slightly, but it
was worth it.
* docs/schemas/domaincommon.rng (diskspec): Add diskMirror.
* docs/formatdomain.html.in (elementsDisks): Document it.
* src/conf/domain_conf.h (_virDomainDiskDef): New members.
* src/conf/domain_conf.c (virDomainDiskDefFree): Clean them.
(virDomainDiskDefParseXML): Parse them, but only internally.
(virDomainDiskDefFormat): Output them.
* tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: New test file.
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml: Likewise.
* tests/qemuxml2xmltest.c (testInfo): Alter members.
(testCompareXMLToXMLHelper): Allow more test control.
(mymain): Run new test.
2012-03-29 00:10:18 +00:00
|
|
|
char *mirror;
|
2012-10-15 21:47:42 +00:00
|
|
|
int mirrorFormat; /* enum virStorageFileFormat */
|
blockjob: enhance xml to track mirrors across libvirtd restart
In order to track a block copy job across libvirtd restarts, we
need to save internal XML that tracks the name of the file
holding the mirror. Displaying this name in dumpxml might also
be useful to the user, even if we don't yet have a way to (re-)
start a domain with mirroring enabled up front. This is done
with a new <mirror> sub-element to <disk>, as in:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/original.img'/>
<mirror file='/var/lib/libvirt/images/copy.img' format='qcow2' ready='yes'/>
...
</disk>
For now, the element is output-only, in live domains; it is ignored
when defining a domain or hot-plugging a disk (since those contexts
use VIR_DOMAIN_XML_INACTIVE in parsing). The 'ready' attribute appears
when libvirt knows that the job has changed from the initial pulling
phase over to the mirroring phase, although absence of the attribute
is not a sure indicator of the current phase. If we come up with a way
to make qemu start with mirroring enabled, we can relax the xml
restriction, and allow <mirror> (but not attribute 'ready') on input.
Testing active-only XML meant tweaking the testsuite slightly, but it
was worth it.
* docs/schemas/domaincommon.rng (diskspec): Add diskMirror.
* docs/formatdomain.html.in (elementsDisks): Document it.
* src/conf/domain_conf.h (_virDomainDiskDef): New members.
* src/conf/domain_conf.c (virDomainDiskDefFree): Clean them.
(virDomainDiskDefParseXML): Parse them, but only internally.
(virDomainDiskDefFormat): Output them.
* tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: New test file.
* tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror.xml: Likewise.
* tests/qemuxml2xmltest.c (testInfo): Alter members.
(testCompareXMLToXMLHelper): Allow more test control.
(mymain): Run new test.
2012-03-29 00:10:18 +00:00
|
|
|
bool mirroring;
|
|
|
|
|
2012-08-20 13:58:50 +00:00
|
|
|
struct {
|
|
|
|
unsigned int cylinders;
|
|
|
|
unsigned int heads;
|
|
|
|
unsigned int sectors;
|
|
|
|
int trans;
|
|
|
|
} geometry;
|
|
|
|
|
2012-08-29 15:48:30 +00:00
|
|
|
struct {
|
|
|
|
unsigned int logical_block_size;
|
|
|
|
unsigned int physical_block_size;
|
2012-09-04 14:30:55 +00:00
|
|
|
} blockio;
|
2012-08-29 15:48:30 +00:00
|
|
|
|
2011-11-15 09:02:46 +00:00
|
|
|
virDomainBlockIoTuneInfo blkdeviotune;
|
|
|
|
|
2009-08-14 11:22:01 +00:00
|
|
|
char *serial;
|
2012-09-11 08:57:02 +00:00
|
|
|
char *wwn;
|
2012-12-06 10:23:02 +00:00
|
|
|
char *vendor;
|
|
|
|
char *product;
|
2009-01-30 17:15:39 +00:00
|
|
|
int cachemode;
|
2011-10-04 18:17:06 +00:00
|
|
|
int error_policy; /* enum virDomainDiskErrorPolicy */
|
|
|
|
int rerror_policy; /* enum virDomainDiskErrorPolicy */
|
2010-04-21 14:28:21 +00:00
|
|
|
int iomode;
|
2011-06-20 08:26:47 +00:00
|
|
|
int ioeventfd;
|
2011-08-13 06:32:45 +00:00
|
|
|
int event_idx;
|
2012-01-12 09:31:14 +00:00
|
|
|
int copy_on_read;
|
2012-08-13 22:59:57 +00:00
|
|
|
int snapshot; /* enum virDomainSnapshotLocation, snapshot_conf.h */
|
2011-10-17 14:54:03 +00:00
|
|
|
int startupPolicy; /* enum virDomainStartupPolicy */
|
2008-07-11 16:23:36 +00:00
|
|
|
unsigned int readonly : 1;
|
|
|
|
unsigned int shared : 1;
|
2011-08-13 19:20:21 +00:00
|
|
|
unsigned int transient : 1;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDeviceInfo info;
|
2009-07-21 05:23:03 +00:00
|
|
|
virStorageEncryptionPtr encryption;
|
2012-01-31 04:49:00 +00:00
|
|
|
bool rawio_specified;
|
|
|
|
int rawio; /* no = 0, yes = 1 */
|
2013-01-02 14:37:09 +00:00
|
|
|
int sgio; /* enum virDomainDiskSGIO */
|
2012-08-15 22:10:35 +00:00
|
|
|
|
|
|
|
size_t nseclabels;
|
|
|
|
virSecurityDeviceLabelDefPtr *seclabels;
|
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,
|
2011-01-10 16:41:33 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_CCID,
|
2011-09-02 13:21:23 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_USB,
|
2009-12-02 19:15:38 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2010-06-17 14:39:50 +00:00
|
|
|
|
2011-09-02 13:06:15 +00:00
|
|
|
enum virDomainControllerModelSCSI {
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSISAS1068,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI,
|
2012-02-27 09:08:23 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI,
|
2012-02-27 09:16:20 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI,
|
2010-06-17 14:39:50 +00:00
|
|
|
|
2011-09-02 13:06:15 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST
|
2010-06-17 14:39:50 +00:00
|
|
|
};
|
|
|
|
|
2011-09-02 13:14:29 +00:00
|
|
|
enum virDomainControllerModelUSB {
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX3_UHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_PIIX4_UHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_EHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_EHCI1,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI1,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI2,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_ICH9_UHCI3,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_VT82C686B_UHCI,
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_PCI_OHCI,
|
2012-06-21 13:45:25 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_NEC_XHCI,
|
2012-07-02 15:28:43 +00:00
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE,
|
2011-09-02 13:14:29 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_CONTROLLER_MODEL_USB_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 */
|
|
|
|
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 {
|
2012-06-20 14:03:30 +00:00
|
|
|
VIR_DOMAIN_FS_TYPE_MOUNT, /* Mounts (binds) a host dir on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_BLOCK, /* Mounts a host block dev on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_FILE, /* Loopback mounts a host file on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_TEMPLATE, /* Expands a OS template to a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_RAM, /* Mount a RAM filesystem on a guest dir */
|
|
|
|
VIR_DOMAIN_FS_TYPE_BIND, /* Binds a guest dir to another guest dir */
|
2008-08-01 13:31:37 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_FS_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2011-10-11 11:30:40 +00:00
|
|
|
/* Filesystem driver type */
|
|
|
|
enum virDomainFSDriverType {
|
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_PATH,
|
|
|
|
VIR_DOMAIN_FS_DRIVER_TYPE_HANDLE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_DRIVER_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
|
|
|
|
};
|
|
|
|
|
2012-01-17 12:44:18 +00:00
|
|
|
/* Filesystem Write policy */
|
|
|
|
enum virDomainFSWrpolicy {
|
|
|
|
VIR_DOMAIN_FS_WRPOLICY_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_FS_WRPOLICY_IMMEDIATE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_FS_WRPOLICY_LAST
|
|
|
|
};
|
|
|
|
|
2012-05-08 16:50:48 +00:00
|
|
|
/* Allow 2 MB ram usage */
|
|
|
|
# define VIR_DOMAIN_FS_RAM_DEFAULT_USAGE (1024 * 2)
|
|
|
|
|
2008-08-01 13:31:37 +00:00
|
|
|
struct _virDomainFSDef {
|
|
|
|
int type;
|
2011-10-11 11:30:40 +00:00
|
|
|
int fsdriver;
|
2010-10-14 13:08:24 +00:00
|
|
|
int accessmode;
|
2012-01-17 12:44:18 +00:00
|
|
|
int wrpolicy; /* enum virDomainFSWrpolicy */
|
2012-05-08 16:50:48 +00:00
|
|
|
unsigned long long usage;
|
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;
|
2012-05-23 12:38:55 +00:00
|
|
|
unsigned long long space_hard_limit; /* in bytes */
|
|
|
|
unsigned long long space_soft_limit; /* in bytes */
|
2008-08-01 13:31:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-02-19 10:55:27 +00:00
|
|
|
/* network config types */
|
2008-07-11 16:23:36 +00:00
|
|
|
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,
|
2012-02-15 17:37:15 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_HOSTDEV,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_NET_TYPE_LAST
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2011-01-12 04:18:49 +00:00
|
|
|
/* the backend driver used for virtio interfaces */
|
|
|
|
enum virDomainNetBackendType {
|
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_DEFAULT, /* prefer kernel, fall back to user */
|
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_QEMU, /* userland */
|
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_VHOST, /* kernel */
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_NET_BACKEND_TYPE_LAST
|
2011-01-12 04:18:49 +00:00
|
|
|
};
|
2008-07-11 16:23:36 +00:00
|
|
|
|
Add txmode attribute to interface XML for virtio backend
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=629662
Explanation
qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.
'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)
'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)
The resulting difference, according to the qemu developer who added
the option is:
bh makes tx more asynchronous and reduces latency, but potentially
causes more processor bandwidth contention since the cpu doing the
tx isn't necessarily the cpu where the guest generated the
packets.
Solution
This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:
<interface ...>
...
<model type='virtio'/>
<driver txmode='iothread'/>
...
</interface>
I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)
Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of
qemu -device virtio-net-pci,?
If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.
2011-02-03 20:20:01 +00:00
|
|
|
/* the TX algorithm used for virtio interfaces */
|
|
|
|
enum virDomainNetVirtioTxModeType {
|
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_DEFAULT, /* default for this version of qemu */
|
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_IOTHREAD,
|
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_TIMER,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_NET_VIRTIO_TX_MODE_LAST
|
Add txmode attribute to interface XML for virtio backend
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=629662
Explanation
qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.
'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)
'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)
The resulting difference, according to the qemu developer who added
the option is:
bh makes tx more asynchronous and reduces latency, but potentially
causes more processor bandwidth contention since the cpu doing the
tx isn't necessarily the cpu where the guest generated the
packets.
Solution
This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:
<interface ...>
...
<model type='virtio'/>
<driver txmode='iothread'/>
...
</interface>
I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)
Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of
qemu -device virtio-net-pci,?
If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.
2011-02-03 20:20:01 +00:00
|
|
|
};
|
|
|
|
|
2011-09-06 08:08:15 +00:00
|
|
|
/* link interface states */
|
|
|
|
enum virDomainNetInterfaceLinkState {
|
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DEFAULT = 0, /* Default link state (up) */
|
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP, /* Link is up. ("cable" connected) */
|
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN , /* Link is down. ("cable" disconnected) */
|
|
|
|
|
|
|
|
VIR_DOMAIN_NET_INTERFACE_LINK_STATE_LAST
|
|
|
|
};
|
|
|
|
|
2011-06-26 08:09:00 +00:00
|
|
|
/* Config that was actually used to bring up interface, after
|
|
|
|
* resolving network reference. This is private data, only used within
|
|
|
|
* libvirt, but still must maintain backward compatibility, because
|
|
|
|
* different versions of libvirt may read the same data file.
|
|
|
|
*/
|
|
|
|
typedef struct _virDomainActualNetDef virDomainActualNetDef;
|
|
|
|
typedef virDomainActualNetDef *virDomainActualNetDefPtr;
|
|
|
|
struct _virDomainActualNetDef {
|
|
|
|
int type; /* enum virDomainNetType */
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *brname;
|
|
|
|
} bridge;
|
|
|
|
struct {
|
|
|
|
char *linkdev;
|
|
|
|
int mode; /* enum virMacvtapMode from util/macvtap.h */
|
|
|
|
} direct;
|
2012-02-15 17:37:15 +00:00
|
|
|
struct {
|
|
|
|
virDomainHostdevDef def;
|
|
|
|
} hostdev;
|
2011-06-26 08:09:00 +00:00
|
|
|
} data;
|
2012-07-30 06:03:25 +00:00
|
|
|
virNetDevVPortProfilePtr virtPortProfile;
|
Adjust naming of network device bandwidth management APIs
Rename virBandwidth to virNetDevBandwidth, and virRate to
virNetDevBandwidthRate.
* src/util/network.c, src/util/network.h: Rename bandwidth
structs and APIs
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/network_conf.c, src/conf/network_conf.h,
src/lxc/lxc_driver.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/util/macvtap.c,
src/util/macvtap.h, tools/virsh.c: Update for API changes.
2011-11-02 14:29:05 +00:00
|
|
|
virNetDevBandwidthPtr bandwidth;
|
2012-08-12 07:51:30 +00:00
|
|
|
virNetDevVlan vlan;
|
2012-11-16 13:29:01 +00:00
|
|
|
unsigned int class_id; /* class ID for bandwidth 'floor' */
|
2011-06-26 08:09:00 +00:00
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Stores the virtual network interface configuration */
|
|
|
|
struct _virDomainNetDef {
|
2010-03-26 16:01:35 +00:00
|
|
|
enum virDomainNetType type;
|
2012-07-17 12:07:59 +00:00
|
|
|
virMacAddr mac;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *model;
|
Restructure domain struct interface "driver" data for easier expansion
When the <driver> element (and its "name" attribute) was added to the
domain XML's interface element, a "backend" enum was simply added to
the toplevel of the virDomainNetDef struct.
Ignoring the naming inconsistency ("name" vs. "backend"), this is fine
when there's only a single item contained in the driver element of the
XML, but doesn't scale well as we add more attributes that apply to
the backend of the virtio-net driver, or add attributes applicable to
other drivers.
This patch changes virDomainNetDef in two ways:
1) Rename the item in the struct from "backend" to "name", so that
it's the same in the XML and in the struct, hopefully avoiding
confusion for someone unfamiliar with the function of the
attribute.
2) Create a "driver" union within virDomainNetDef, and a "virtio"
struct in that struct, which contains the "name" enum value.
3) Move around the virDomainNetParse and virDomainNetFormat functions
to allow for simple plugin of new attributes without disturbing
existing code. (you'll note that this results in a seemingly
redundant if() in the format function, but that will no longer be
the case as soon as a 2nd attribute is added).
In the future, new attributes for the virtio driver backend can be
added to the "virtio" struct, and any other network device backend that
needs an attribute will have its own struct added to the "driver"
union.
2011-02-03 18:52:08 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
enum virDomainNetBackendType name; /* which driver backend to use */
|
Add txmode attribute to interface XML for virtio backend
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=629662
Explanation
qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.
'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)
'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)
The resulting difference, according to the qemu developer who added
the option is:
bh makes tx more asynchronous and reduces latency, but potentially
causes more processor bandwidth contention since the cpu doing the
tx isn't necessarily the cpu where the guest generated the
packets.
Solution
This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:
<interface ...>
...
<model type='virtio'/>
<driver txmode='iothread'/>
...
</interface>
I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)
Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of
qemu -device virtio-net-pci,?
If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.
2011-02-03 20:20:01 +00:00
|
|
|
enum virDomainNetVirtioTxModeType txmode;
|
2011-06-20 08:26:47 +00:00
|
|
|
enum virDomainIoEventFd ioeventfd;
|
2011-08-13 06:32:45 +00:00
|
|
|
enum virDomainVirtioEventIdx event_idx;
|
Restructure domain struct interface "driver" data for easier expansion
When the <driver> element (and its "name" attribute) was added to the
domain XML's interface element, a "backend" enum was simply added to
the toplevel of the virDomainNetDef struct.
Ignoring the naming inconsistency ("name" vs. "backend"), this is fine
when there's only a single item contained in the driver element of the
XML, but doesn't scale well as we add more attributes that apply to
the backend of the virtio-net driver, or add attributes applicable to
other drivers.
This patch changes virDomainNetDef in two ways:
1) Rename the item in the struct from "backend" to "name", so that
it's the same in the XML and in the struct, hopefully avoiding
confusion for someone unfamiliar with the function of the
attribute.
2) Create a "driver" union within virDomainNetDef, and a "virtio"
struct in that struct, which contains the "name" enum value.
3) Move around the virDomainNetParse and virDomainNetFormat functions
to allow for simple plugin of new attributes without disturbing
existing code. (you'll note that this results in a seemingly
redundant if() in the format function, but that will no longer be
the case as soon as a 2nd attribute is added).
In the future, new attributes for the virtio driver backend can be
added to the "virtio" struct, and any other network device backend that
needs an attribute will have its own struct added to the "driver"
union.
2011-02-03 18:52:08 +00:00
|
|
|
} virtio;
|
|
|
|
} driver;
|
2008-07-11 16:23:36 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
char *dev;
|
|
|
|
char *ipaddr;
|
|
|
|
} ethernet;
|
|
|
|
struct {
|
|
|
|
char *address;
|
|
|
|
int port;
|
|
|
|
} socket; /* any of NET_CLIENT or NET_SERVER or NET_MCAST */
|
|
|
|
struct {
|
|
|
|
char *name;
|
2011-06-26 08:09:00 +00:00
|
|
|
char *portgroup;
|
|
|
|
/* actual has info about the currently used physical
|
|
|
|
* device (if the network is of type
|
|
|
|
* bridge/private/vepa/passthrough). This is saved in the
|
|
|
|
* domain state, but never written to persistent config,
|
|
|
|
* since it needs to be re-allocated whenever the domain
|
|
|
|
* is restarted. It is also never shown to the user, and
|
|
|
|
* the user cannot specify it in XML documents.
|
|
|
|
*/
|
|
|
|
virDomainActualNetDefPtr actual;
|
2008-07-11 16:23:36 +00:00
|
|
|
} network;
|
|
|
|
struct {
|
|
|
|
char *brname;
|
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;
|
2011-06-20 16:08:41 +00:00
|
|
|
int mode; /* enum virMacvtapMode from util/macvtap.h */
|
2010-02-12 17:07:06 +00:00
|
|
|
} direct;
|
2012-02-15 17:37:15 +00:00
|
|
|
struct {
|
|
|
|
virDomainHostdevDef def;
|
|
|
|
} hostdev;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
2012-07-30 06:03:25 +00:00
|
|
|
/* virtPortProfile is used by network/bridge/direct/hostdev */
|
|
|
|
virNetDevVPortProfilePtr virtPortProfile;
|
2011-01-12 19:38:01 +00:00
|
|
|
struct {
|
|
|
|
bool sndbuf_specified;
|
|
|
|
unsigned long sndbuf;
|
|
|
|
} tune;
|
config: report error when script given for inappropriate interface type
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=638633
Although scripts are not used by interfaces of type other than
"ethernet" in qemu, due to the fact that the parser stores the script
name in a union that is only valid when type is ethernet or bridge,
there is no way for anyone except the parser itself to catch the
problem of specifying an interface script for an inappropriate
interface type (by the time the parsed data gets back to the code that
called the parser, all evidence that a script was specified is
forgotten).
Since the parser itself should be agnostic to which type of interface
allows scripts (an example of why: a script specified for an interface
of type bridge is valid for xen domains, but not for qemu domains),
the solution here is to move the script out of the union(s) in the
DomainNetDef, always populate it when specified (regardless of
interface type), and let the driver decide whether or not it is
appropriate.
Currently the qemu, xen, libxml, and uml drivers recognize the script
parameter and do something with it (the uml driver only to report that
it isn't supported). Those drivers have been updated to log a
CONFIG_UNSUPPORTED error when a script is specified for an interface
type that's inappropriate for that particular hypervisor.
(NB: There was earlier discussion of solving this problem by adding a
VALIDATE flag to all libvirt APIs that accept XML, which would cause
the XML to be validated against the RNG files. One statement during
that discussion was that the RNG shouldn't contain hypervisor-specific
things, though, and a proper solution to this problem would require
that (again, because a script for an interface of type "bridge" is
accepted by xen, but not by qemu).
2012-01-06 17:59:47 +00:00
|
|
|
char *script;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *ifname;
|
2009-11-30 18:35:58 +00:00
|
|
|
virDomainDeviceInfo info;
|
2010-03-25 17:46:07 +00:00
|
|
|
char *filter;
|
|
|
|
virNWFilterHashTablePtr filterparams;
|
Adjust naming of network device bandwidth management APIs
Rename virBandwidth to virNetDevBandwidth, and virRate to
virNetDevBandwidthRate.
* src/util/network.c, src/util/network.h: Rename bandwidth
structs and APIs
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/network_conf.c, src/conf/network_conf.h,
src/lxc/lxc_driver.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/util/macvtap.c,
src/util/macvtap.h, tools/virsh.c: Update for API changes.
2011-11-02 14:29:05 +00:00
|
|
|
virNetDevBandwidthPtr bandwidth;
|
2012-08-12 07:51:30 +00:00
|
|
|
virNetDevVlan vlan;
|
2011-09-06 08:08:15 +00:00
|
|
|
int linkstate;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2011-07-29 15:36:17 +00:00
|
|
|
/* Used for prefix of ifname of any network name generated dynamically
|
|
|
|
* by libvirt, and cannot be used for a persistent network name. */
|
|
|
|
# define VIR_NET_GENERATED_PREFIX "vnet"
|
|
|
|
|
2010-07-13 19:05:34 +00:00
|
|
|
enum virDomainChrDeviceType {
|
2011-01-07 23:36:25 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL = 0,
|
2010-07-13 19:05:34 +00:00
|
|
|
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
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_DEVICE_TYPE_LAST
|
2010-07-13 20:06:38 +00:00
|
|
|
};
|
|
|
|
|
2013-01-05 05:25:36 +00:00
|
|
|
enum virDomainChrSerialTargetType {
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_ISA = 0,
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB,
|
|
|
|
|
|
|
|
VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
2010-07-13 20:06:38 +00:00
|
|
|
enum virDomainChrChannelTargetType {
|
2012-06-19 10:08:49 +00:00
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_NONE = 0,
|
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD,
|
2010-07-13 20:06:38 +00:00
|
|
|
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
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,
|
Fix default console type setting
The default console type may vary based on the OS type. ie a Xen
paravirt guests wants a 'xen' console, while a fullvirt guests
wants a 'serial' console.
A plain integer default console type in the capabilities does
not suffice. Instead introduce a callback that is passed the
OS type.
* src/conf/capabilities.h: Use a callback for default console
type
* src/conf/domain_conf.c, src/conf/domain_conf.h: Use callback
for default console type. Add missing LXC/OpenVZ console types.
* src/esx/esx_driver.c, src/libxl/libxl_conf.c,
src/lxc/lxc_conf.c, src/openvz/openvz_conf.c,
src/phyp/phyp_driver.c, src/qemu/qemu_capabilities.c,
src/uml/uml_conf.c, src/vbox/vbox_tmpl.c,
src/vmware/vmware_conf.c, src/xen/xen_hypervisor.c,
src/xenapi/xenapi_driver.c: Set default console type callback
2011-10-20 13:56:20 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LXC,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ,
|
2013-01-07 17:17:14 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP,
|
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLPLM,
|
2010-07-22 17:56:21 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST
|
2010-07-22 17:56:21 +00:00
|
|
|
};
|
|
|
|
|
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,
|
2011-02-03 04:09:44 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_SPICEVMC,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_TYPE_LAST
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_TCP_PROTOCOL_LAST
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2011-02-04 02:23:31 +00:00
|
|
|
enum virDomainChrSpicevmcName {
|
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_VDAGENT,
|
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_SMARTCARD,
|
2011-09-02 15:19:11 +00:00
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_USBREDIR,
|
2011-02-04 02:23:31 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CHR_SPICEVMC_LAST
|
2011-02-04 02:23:31 +00:00
|
|
|
};
|
|
|
|
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
/* The host side information for a character device. */
|
|
|
|
typedef struct _virDomainChrSourceDef virDomainChrSourceDef;
|
|
|
|
typedef virDomainChrSourceDef *virDomainChrSourceDefPtr;
|
|
|
|
struct _virDomainChrSourceDef {
|
|
|
|
int type; /* virDomainChrType */
|
2008-07-11 16:23:36 +00:00
|
|
|
union {
|
2011-02-04 02:23:31 +00:00
|
|
|
/* no <source> for null, vc, stdio */
|
2008-07-11 16:23:36 +00:00
|
|
|
struct {
|
|
|
|
char *path;
|
|
|
|
} file; /* pty, file, pipe, or device */
|
|
|
|
struct {
|
|
|
|
char *host;
|
|
|
|
char *service;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
bool listen;
|
2008-07-11 16:23:36 +00:00
|
|
|
int protocol;
|
|
|
|
} tcp;
|
|
|
|
struct {
|
|
|
|
char *bindHost;
|
|
|
|
char *bindService;
|
|
|
|
char *connectHost;
|
|
|
|
char *connectService;
|
|
|
|
} udp;
|
|
|
|
struct {
|
|
|
|
char *path;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
bool listen;
|
2008-07-11 16:23:36 +00:00
|
|
|
} nix;
|
2011-02-04 02:23:31 +00:00
|
|
|
int spicevmc;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* A complete character device, both host and domain views. */
|
|
|
|
struct _virDomainChrDef {
|
|
|
|
int deviceType;
|
2013-01-05 05:25:36 +00:00
|
|
|
|
|
|
|
bool targetTypeAttr;
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
int targetType;
|
|
|
|
union {
|
|
|
|
int port; /* parallel, serial, console */
|
|
|
|
virSocketAddrPtr addr; /* guestfwd */
|
|
|
|
char *name; /* virtio */
|
|
|
|
} target;
|
|
|
|
|
|
|
|
virDomainChrSourceDef source;
|
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;
|
2012-09-20 13:16:17 +00:00
|
|
|
|
|
|
|
size_t nseclabels;
|
|
|
|
virSecurityDeviceLabelDefPtr *seclabels;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2011-01-10 16:41:33 +00:00
|
|
|
enum virDomainSmartcardType {
|
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_HOST,
|
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_HOST_CERTIFICATES,
|
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_SMARTCARD_TYPE_LAST
|
2011-01-10 16:41:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# define VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES 3
|
|
|
|
# define VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE "/etc/pki/nssdb"
|
|
|
|
|
|
|
|
struct _virDomainSmartcardDef {
|
|
|
|
int type; /* virDomainSmartcardType */
|
|
|
|
union {
|
|
|
|
/* no extra data for 'host' */
|
|
|
|
struct {
|
|
|
|
char *file[VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES];
|
|
|
|
char *database;
|
|
|
|
} cert; /* 'host-certificates' */
|
|
|
|
virDomainChrSourceDef passthru; /* 'passthrough' */
|
|
|
|
} data;
|
|
|
|
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
2011-09-02 14:20:40 +00:00
|
|
|
struct _virDomainHubDef {
|
|
|
|
int type;
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
enum virDomainInputType {
|
|
|
|
VIR_DOMAIN_INPUT_TYPE_MOUSE,
|
|
|
|
VIR_DOMAIN_INPUT_TYPE_TABLET,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_INPUT_TYPE_LAST
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainInputBus {
|
|
|
|
VIR_DOMAIN_INPUT_BUS_PS2,
|
|
|
|
VIR_DOMAIN_INPUT_BUS_USB,
|
|
|
|
VIR_DOMAIN_INPUT_BUS_XEN,
|
|
|
|
|
|
|
|
VIR_DOMAIN_INPUT_BUS_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2012-05-15 22:55:09 +00:00
|
|
|
enum virDomainSoundCodecType {
|
|
|
|
VIR_DOMAIN_SOUND_CODEC_TYPE_DUPLEX,
|
|
|
|
VIR_DOMAIN_SOUND_CODEC_TYPE_MICRO,
|
|
|
|
|
|
|
|
VIR_DOMAIN_SOUND_CODEC_TYPE_LAST
|
|
|
|
};
|
|
|
|
|
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,
|
2011-01-13 14:15:11 +00:00
|
|
|
VIR_DOMAIN_SOUND_MODEL_ICH6,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_SOUND_MODEL_LAST
|
|
|
|
};
|
|
|
|
|
2012-05-15 22:55:09 +00:00
|
|
|
struct _virDomainSoundCodecDef {
|
|
|
|
int type;
|
|
|
|
int cad;
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainSoundDef {
|
|
|
|
int model;
|
2009-12-10 19:19:08 +00:00
|
|
|
virDomainDeviceInfo info;
|
2012-05-15 22:55:09 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ncodecs;
|
2012-05-15 22:55:09 +00:00
|
|
|
virDomainSoundCodecDefPtr *codecs;
|
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,
|
2010-12-08 06:19:17 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_DUMP,
|
2009-10-21 12:26:38 +00:00
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_NONE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_WATCHDOG_ACTION_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
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,
|
2009-07-08 13:47:14 +00:00
|
|
|
VIR_DOMAIN_VIDEO_TYPE_QXL,
|
2009-07-06 13:54:44 +00:00
|
|
|
|
|
|
|
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
|
|
|
struct _virDomainVideoDef {
|
|
|
|
int type;
|
2013-01-18 18:36:36 +00:00
|
|
|
unsigned int ram; /* kibibytes (multiples of 1024) */
|
|
|
|
unsigned int vram; /* kibibytes (multiples of 1024) */
|
2009-07-06 13:54:44 +00:00
|
|
|
unsigned int heads;
|
2012-12-17 06:01:20 +00:00
|
|
|
bool primary;
|
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,
|
2009-08-14 09:54:14 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_TYPE_LAST
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2011-05-26 14:15:54 +00:00
|
|
|
enum virDomainGraphicsAuthConnectedType {
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_FAIL,
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_DISCONNECT,
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_KEEP,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_AUTH_CONNECTED_LAST
|
|
|
|
};
|
|
|
|
|
2010-04-08 12:43:23 +00:00
|
|
|
typedef struct _virDomainGraphicsAuthDef virDomainGraphicsAuthDef;
|
|
|
|
typedef virDomainGraphicsAuthDef *virDomainGraphicsAuthDefPtr;
|
|
|
|
struct _virDomainGraphicsAuthDef {
|
|
|
|
char *passwd;
|
|
|
|
unsigned int expires: 1; /* Whether there is an expiry time set */
|
|
|
|
time_t validTo; /* seconds since epoch */
|
2011-05-26 14:15:54 +00:00
|
|
|
int connected; /* action if connected */
|
2010-04-08 12:43:23 +00:00
|
|
|
};
|
|
|
|
|
2010-04-09 16:56:00 +00:00
|
|
|
enum virDomainGraphicsSpiceChannelName {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MAIN,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_DISPLAY,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_INPUT,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_CURSOR,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_PLAYBACK,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_RECORD,
|
2011-02-04 02:23:31 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_SMARTCARD,
|
2012-05-08 13:00:28 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_USBREDIR,
|
2010-04-09 16:56:00 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainGraphicsSpiceChannelMode {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_LAST
|
|
|
|
};
|
2010-04-08 12:43:23 +00:00
|
|
|
|
2011-04-14 08:44:20 +00:00
|
|
|
enum virDomainGraphicsSpiceImageCompression {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_AUTO_GLZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_AUTO_LZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_QUIC,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_GLZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_LZ,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_IMAGE_COMPRESSION_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainGraphicsSpiceJpegCompression {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_AUTO,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_NEVER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_ALWAYS,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_JPEG_COMPRESSION_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainGraphicsSpiceZlibCompression {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_AUTO,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_NEVER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_ALWAYS,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_ZLIB_COMPRESSION_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainGraphicsSpicePlaybackCompression {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_PLAYBACK_COMPRESSION_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_PLAYBACK_COMPRESSION_ON,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_PLAYBACK_COMPRESSION_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_PLAYBACK_COMPRESSION_LAST
|
|
|
|
};
|
|
|
|
|
2012-03-09 07:26:24 +00:00
|
|
|
enum virDomainGraphicsSpiceMouseMode {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_CLIENT,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_LAST
|
|
|
|
};
|
|
|
|
|
2011-05-23 15:16:42 +00:00
|
|
|
enum virDomainGraphicsSpiceStreamingMode {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_FILTER,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_ALL,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_STREAMING_MODE_LAST
|
|
|
|
};
|
|
|
|
|
2011-06-14 11:35:48 +00:00
|
|
|
enum virDomainGraphicsSpiceClipboardCopypaste {
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CLIPBOARD_COPYPASTE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CLIPBOARD_COPYPASTE_YES,
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CLIPBOARD_COPYPASTE_NO,
|
|
|
|
|
|
|
|
VIR_DOMAIN_GRAPHICS_SPICE_CLIPBOARD_COPYPASTE_LAST
|
|
|
|
};
|
|
|
|
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
enum virDomainGraphicsListenType {
|
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NONE = 0,
|
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS,
|
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_LAST
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
};
|
|
|
|
|
2011-09-02 14:20:40 +00:00
|
|
|
enum virDomainHubType {
|
|
|
|
VIR_DOMAIN_HUB_TYPE_USB,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_HUB_TYPE_LAST
|
2011-09-02 14:20:40 +00:00
|
|
|
};
|
|
|
|
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
typedef struct _virDomainGraphicsListenDef virDomainGraphicsListenDef;
|
|
|
|
typedef virDomainGraphicsListenDef *virDomainGraphicsListenDefPtr;
|
|
|
|
struct _virDomainGraphicsListenDef {
|
|
|
|
int type; /* enum virDomainGraphicsListenType */
|
|
|
|
char *address;
|
|
|
|
char *network;
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
struct _virDomainGraphicsDef {
|
2012-03-12 15:50:39 +00:00
|
|
|
/* Port value discipline:
|
|
|
|
* Value -1 is legacy syntax indicating that it should be auto-allocated.
|
|
|
|
* Value 0 means port wasn't specified in XML at all.
|
|
|
|
* Positive value is actual port number given in XML.
|
|
|
|
*/
|
2008-07-11 16:23:36 +00:00
|
|
|
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 *keymap;
|
2011-01-07 21:03:07 +00:00
|
|
|
char *socket;
|
2010-04-08 12:43:23 +00:00
|
|
|
virDomainGraphicsAuthDef auth;
|
2008-07-11 16:23:36 +00:00
|
|
|
} 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;
|
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;
|
2009-08-14 09:54:14 +00:00
|
|
|
struct {
|
|
|
|
int port;
|
|
|
|
int tlsPort;
|
2012-03-09 07:26:24 +00:00
|
|
|
int mousemode;
|
2009-08-14 09:54:14 +00:00
|
|
|
char *keymap;
|
2010-04-08 12:43:23 +00:00
|
|
|
virDomainGraphicsAuthDef auth;
|
2009-08-14 09:54:14 +00:00
|
|
|
unsigned int autoport :1;
|
2010-04-09 16:56:00 +00:00
|
|
|
int channels[VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST];
|
2012-05-08 17:42:44 +00:00
|
|
|
int defaultMode; /* enum virDomainGraphicsSpiceChannelMode */
|
2011-04-14 08:44:20 +00:00
|
|
|
int image;
|
|
|
|
int jpeg;
|
|
|
|
int zlib;
|
|
|
|
int playback;
|
2011-05-23 15:16:42 +00:00
|
|
|
int streaming;
|
2011-06-14 11:35:48 +00:00
|
|
|
int copypaste;
|
2009-08-14 09:54:14 +00:00
|
|
|
} spice;
|
2008-07-11 16:23:36 +00:00
|
|
|
} data;
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
/* nListens, listens, and *port are only useful if type is vnc,
|
|
|
|
* rdp, or spice. They've been extracted from the union only to
|
|
|
|
* simplify parsing code.*/
|
|
|
|
size_t nListens;
|
|
|
|
virDomainGraphicsListenDefPtr listens;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2011-09-02 15:09:14 +00:00
|
|
|
enum virDomainRedirdevBus {
|
|
|
|
VIR_DOMAIN_REDIRDEV_BUS_USB,
|
|
|
|
|
|
|
|
VIR_DOMAIN_REDIRDEV_BUS_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainRedirdevDef {
|
|
|
|
int bus; /* enum virDomainRedirdevBus */
|
|
|
|
|
|
|
|
union {
|
|
|
|
virDomainChrSourceDef chr;
|
|
|
|
} source;
|
|
|
|
|
|
|
|
virDomainDeviceInfo info; /* Guest address */
|
|
|
|
};
|
2010-07-15 13:02:42 +00:00
|
|
|
|
2012-09-13 07:25:45 +00:00
|
|
|
struct _virDomainRedirFilterUsbDevDef {
|
|
|
|
int usbClass;
|
|
|
|
int vendor;
|
|
|
|
int product;
|
|
|
|
int version;
|
|
|
|
unsigned int allow :1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainRedirFilterDef {
|
|
|
|
size_t nusbdevs;
|
|
|
|
virDomainRedirFilterUsbDevDefPtr *usbdevs;
|
|
|
|
};
|
|
|
|
|
2012-08-15 07:51:58 +00:00
|
|
|
enum virDomainMemDump {
|
|
|
|
VIR_DOMAIN_MEM_DUMP_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_MEM_DUMP_ON,
|
|
|
|
VIR_DOMAIN_MEM_DUMP_OFF,
|
|
|
|
|
|
|
|
VIR_DOMAIN_MEM_DUMP_LAST,
|
|
|
|
};
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainMemballoonDef {
|
|
|
|
int model;
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-11-05 13:10:34 +00:00
|
|
|
enum virDomainSmbiosMode {
|
2013-02-19 10:55:27 +00:00
|
|
|
VIR_DOMAIN_SMBIOS_NONE = 0,
|
2010-11-05 13:10:34 +00:00
|
|
|
VIR_DOMAIN_SMBIOS_EMULATE,
|
|
|
|
VIR_DOMAIN_SMBIOS_HOST,
|
|
|
|
VIR_DOMAIN_SMBIOS_SYSINFO,
|
|
|
|
|
|
|
|
VIR_DOMAIN_SMBIOS_LAST
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
|
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,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_BOOT_LAST
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
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,
|
2012-09-18 09:38:18 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_BOOT_MENU_LAST
|
2010-07-26 14:28:58 +00:00
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
enum virDomainFeature {
|
|
|
|
VIR_DOMAIN_FEATURE_ACPI,
|
|
|
|
VIR_DOMAIN_FEATURE_APIC,
|
|
|
|
VIR_DOMAIN_FEATURE_PAE,
|
2011-01-05 21:56:48 +00:00
|
|
|
VIR_DOMAIN_FEATURE_HAP,
|
2011-06-15 13:27:43 +00:00
|
|
|
VIR_DOMAIN_FEATURE_VIRIDIAN,
|
2012-01-18 11:38:49 +00:00
|
|
|
VIR_DOMAIN_FEATURE_PRIVNET,
|
2012-10-16 16:25:56 +00:00
|
|
|
VIR_DOMAIN_FEATURE_HYPERV,
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_FEATURE_LAST
|
|
|
|
};
|
|
|
|
|
2012-10-16 14:28:22 +00:00
|
|
|
enum virDomainFeatureState {
|
|
|
|
VIR_DOMAIN_FEATURE_STATE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_FEATURE_STATE_ON,
|
|
|
|
VIR_DOMAIN_FEATURE_STATE_OFF,
|
2012-09-12 22:10:56 +00:00
|
|
|
|
2012-10-16 14:28:22 +00:00
|
|
|
VIR_DOMAIN_FEATURE_STATE_LAST
|
2012-09-12 22:10:56 +00:00
|
|
|
};
|
|
|
|
|
2012-10-16 16:25:56 +00:00
|
|
|
enum virDomainHyperv {
|
|
|
|
VIR_DOMAIN_HYPERV_RELAXED = 0,
|
|
|
|
|
|
|
|
VIR_DOMAIN_HYPERV_LAST
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2012-09-06 20:17:01 +00:00
|
|
|
typedef enum {
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_DEFAULT,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_POWEROFF,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_RESTART,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_PAUSE,
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_IGNORE,
|
|
|
|
|
|
|
|
VIR_DOMAIN_LOCK_FAILURE_LAST
|
|
|
|
} virDomainLockFailureAction;
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virDomainLockFailure)
|
|
|
|
|
2012-08-02 10:12:50 +00:00
|
|
|
enum virDomainPMState {
|
|
|
|
VIR_DOMAIN_PM_STATE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_PM_STATE_ENABLED,
|
|
|
|
VIR_DOMAIN_PM_STATE_DISABLED,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_PM_STATE_LAST
|
2012-08-02 10:12:50 +00:00
|
|
|
};
|
|
|
|
|
2011-07-08 07:56:17 +00:00
|
|
|
enum virDomainBIOSUseserial {
|
|
|
|
VIR_DOMAIN_BIOS_USESERIAL_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_BIOS_USESERIAL_YES,
|
|
|
|
VIR_DOMAIN_BIOS_USESERIAL_NO
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _virDomainBIOSDef virDomainBIOSDef;
|
|
|
|
typedef virDomainBIOSDef *virDomainBIOSDefPtr;
|
|
|
|
struct _virDomainBIOSDef {
|
|
|
|
int useserial;
|
2012-09-18 10:30:52 +00:00
|
|
|
/* reboot-timeout parameters */
|
|
|
|
bool rt_set;
|
|
|
|
int rt_delay;
|
2011-07-08 07:56:17 +00:00
|
|
|
};
|
|
|
|
|
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;
|
2012-12-10 22:28:09 +00:00
|
|
|
virArch arch;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *machine;
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nBootDevs;
|
2008-07-11 16:23:36 +00:00
|
|
|
int bootDevs[VIR_DOMAIN_BOOT_LAST];
|
2012-09-18 09:38:18 +00:00
|
|
|
/* enum virDomainBootMenu */
|
2010-07-26 14:28:58 +00:00
|
|
|
int bootmenu;
|
2008-08-01 13:31:37 +00:00
|
|
|
char *init;
|
2012-03-26 17:09:31 +00:00
|
|
|
char **initargv;
|
2008-07-11 16:23:36 +00:00
|
|
|
char *kernel;
|
|
|
|
char *initrd;
|
|
|
|
char *cmdline;
|
|
|
|
char *root;
|
|
|
|
char *loader;
|
|
|
|
char *bootloader;
|
|
|
|
char *bootloaderArgs;
|
2010-11-05 13:10:34 +00:00
|
|
|
int smbios_mode;
|
2012-09-18 09:38:18 +00:00
|
|
|
|
2011-07-08 07:56:17 +00:00
|
|
|
virDomainBIOSDef bios;
|
2008-07-11 16:23:36 +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,
|
2012-01-27 13:49:51 +00:00
|
|
|
VIR_DOMAIN_TIMER_NAME_KVMCLOCK,
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_TIMER_NAME_LAST
|
2010-03-30 11:44:22 +00:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2012-09-19 07:16:58 +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,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_TIMER_TICKPOLICY_LAST
|
2010-03-30 11:44:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_TIMER_MODE_LAST
|
2010-03-30 11:44:22 +00:00
|
|
|
};
|
|
|
|
|
2012-03-08 13:36:26 +00:00
|
|
|
enum virDomainCpuPlacementMode {
|
2012-05-08 16:04:36 +00:00
|
|
|
VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC = 0,
|
2012-03-08 13:36:26 +00:00
|
|
|
VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CPU_PLACEMENT_MODE_LAST
|
2012-03-08 13:36:26 +00:00
|
|
|
};
|
|
|
|
|
numad: Set memory policy from numad advisory nodeset
Though numad will manage the memory allocation of task dynamically,
it wants management application (libvirt) to pre-set the memory
policy according to the advisory nodeset returned from querying numad,
(just like pre-bind CPU nodeset for domain process), and thus the
performance could benefit much more from it.
This patch introduces new XML tag 'placement', value 'auto' indicates
whether to set the memory policy with the advisory nodeset from numad,
and its value defaults to the value of <vcpu> placement, or 'static'
if 'nodeset' is specified. Example of the new XML tag's usage:
<numatune>
<memory placement='auto' mode='interleave'/>
</numatune>
Just like what current "numatune" does, the 'auto' numa memory policy
setting uses libnuma's API too.
If <vcpu> "placement" is "auto", and <numatune> is not specified
explicitly, a default <numatume> will be added with "placement"
set as "auto", and "mode" set as "strict".
The following XML can now fully drive numad:
1) <vcpu> placement is 'auto', no <numatune> is specified.
<vcpu placement='auto'>10</vcpu>
2) <vcpu> placement is 'auto', no 'placement' is specified for
<numatune>.
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='interleave'/>
</numatune>
And it's also able to control the CPU placement and memory policy
independently. e.g.
1) <vcpu> placement is 'auto', and <numatune> placement is 'static'
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='strict' nodeset='0-10,^7'/>
</numatune>
2) <vcpu> placement is 'static', and <numatune> placement is 'auto'
<vcpu placement='static' cpuset='0-24,^12'>10</vcpu>
<numatune>
<memory mode='interleave' placement='auto'/>
</numatume>
A follow up patch will change the XML formatting codes to always output
'placement' for <vcpu>, even it's 'static'.
2012-05-08 16:04:34 +00:00
|
|
|
enum virDomainNumatuneMemPlacementMode {
|
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_DEFAULT = 0,
|
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_STATIC,
|
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_LAST
|
numad: Set memory policy from numad advisory nodeset
Though numad will manage the memory allocation of task dynamically,
it wants management application (libvirt) to pre-set the memory
policy according to the advisory nodeset returned from querying numad,
(just like pre-bind CPU nodeset for domain process), and thus the
performance could benefit much more from it.
This patch introduces new XML tag 'placement', value 'auto' indicates
whether to set the memory policy with the advisory nodeset from numad,
and its value defaults to the value of <vcpu> placement, or 'static'
if 'nodeset' is specified. Example of the new XML tag's usage:
<numatune>
<memory placement='auto' mode='interleave'/>
</numatune>
Just like what current "numatune" does, the 'auto' numa memory policy
setting uses libnuma's API too.
If <vcpu> "placement" is "auto", and <numatune> is not specified
explicitly, a default <numatume> will be added with "placement"
set as "auto", and "mode" set as "strict".
The following XML can now fully drive numad:
1) <vcpu> placement is 'auto', no <numatune> is specified.
<vcpu placement='auto'>10</vcpu>
2) <vcpu> placement is 'auto', no 'placement' is specified for
<numatune>.
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='interleave'/>
</numatune>
And it's also able to control the CPU placement and memory policy
independently. e.g.
1) <vcpu> placement is 'auto', and <numatune> placement is 'static'
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='strict' nodeset='0-10,^7'/>
</numatune>
2) <vcpu> placement is 'static', and <numatune> placement is 'auto'
<vcpu placement='static' cpuset='0-24,^12'>10</vcpu>
<numatune>
<memory mode='interleave' placement='auto'/>
</numatume>
A follow up patch will change the XML formatting codes to always output
'placement' for <vcpu>, even it's 'static'.
2012-05-08 16:04:34 +00:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CLOCK_OFFSET_LAST
|
2010-02-02 17:22:03 +00:00
|
|
|
};
|
|
|
|
|
2012-02-06 13:59:16 +00:00
|
|
|
enum virDomainClockBasis {
|
|
|
|
VIR_DOMAIN_CLOCK_BASIS_UTC = 0,
|
|
|
|
VIR_DOMAIN_CLOCK_BASIS_LOCALTIME = 1,
|
|
|
|
|
2012-09-19 07:16:58 +00:00
|
|
|
VIR_DOMAIN_CLOCK_BASIS_LAST
|
2012-02-06 13:59:16 +00:00
|
|
|
};
|
|
|
|
|
2010-02-02 17:22:03 +00:00
|
|
|
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 {
|
2012-02-06 13:59:16 +00:00
|
|
|
/* Bug-compatibility-mode for Xen utc|localtime */
|
|
|
|
int utc_reset;
|
|
|
|
/* Adjustment in seconds, relative to UTC or LOCALTIME, when
|
2010-02-02 18:28:44 +00:00
|
|
|
* offset == VIR_DOMAIN_CLOCK_OFFSET_VARIABLE */
|
2012-02-06 13:59:16 +00:00
|
|
|
struct {
|
|
|
|
long long adjustment;
|
|
|
|
int basis;
|
|
|
|
} variable;
|
2010-02-02 18:28:44 +00:00
|
|
|
|
|
|
|
/* Timezone name, when
|
|
|
|
* offset == VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME */
|
|
|
|
char *timezone;
|
|
|
|
} data;
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ntimers;
|
2010-03-30 11:44:22 +00:00
|
|
|
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
|
|
|
|
2011-06-24 23:09:46 +00:00
|
|
|
typedef struct _virDomainVcpuPinDef virDomainVcpuPinDef;
|
|
|
|
typedef virDomainVcpuPinDef *virDomainVcpuPinDefPtr;
|
|
|
|
struct _virDomainVcpuPinDef {
|
2011-03-29 13:33:36 +00:00
|
|
|
int vcpuid;
|
2012-09-14 07:46:58 +00:00
|
|
|
virBitmapPtr cpumask;
|
2011-03-29 13:33:36 +00:00
|
|
|
};
|
|
|
|
|
2012-09-14 07:46:58 +00:00
|
|
|
void virDomainVcpuPinDefFree(virDomainVcpuPinDefPtr def);
|
|
|
|
void virDomainVcpuPinDefArrayFree(virDomainVcpuPinDefPtr *def, int nvcpupin);
|
2012-08-21 09:18:29 +00:00
|
|
|
|
|
|
|
virDomainVcpuPinDefPtr *virDomainVcpuPinDefCopy(virDomainVcpuPinDefPtr *src,
|
|
|
|
int nvcpupin);
|
|
|
|
|
2011-06-24 23:09:46 +00:00
|
|
|
int virDomainVcpuPinIsDuplicate(virDomainVcpuPinDefPtr *def,
|
2011-03-29 13:33:36 +00:00
|
|
|
int nvcpupin,
|
|
|
|
int vcpu);
|
|
|
|
|
2011-06-24 23:09:46 +00:00
|
|
|
virDomainVcpuPinDefPtr virDomainVcpuPinFindByVcpu(virDomainVcpuPinDefPtr *def,
|
2011-03-29 13:33:36 +00:00
|
|
|
int nvcpupin,
|
|
|
|
int vcpu);
|
|
|
|
|
2011-06-20 07:15:44 +00:00
|
|
|
typedef struct _virDomainNumatuneDef virDomainNumatuneDef;
|
|
|
|
typedef virDomainNumatuneDef *virDomainNumatuneDefPtr;
|
|
|
|
struct _virDomainNumatuneDef {
|
|
|
|
struct {
|
2012-09-14 07:47:00 +00:00
|
|
|
virBitmapPtr nodemask;
|
2011-06-20 07:15:44 +00:00
|
|
|
int mode;
|
numad: Set memory policy from numad advisory nodeset
Though numad will manage the memory allocation of task dynamically,
it wants management application (libvirt) to pre-set the memory
policy according to the advisory nodeset returned from querying numad,
(just like pre-bind CPU nodeset for domain process), and thus the
performance could benefit much more from it.
This patch introduces new XML tag 'placement', value 'auto' indicates
whether to set the memory policy with the advisory nodeset from numad,
and its value defaults to the value of <vcpu> placement, or 'static'
if 'nodeset' is specified. Example of the new XML tag's usage:
<numatune>
<memory placement='auto' mode='interleave'/>
</numatune>
Just like what current "numatune" does, the 'auto' numa memory policy
setting uses libnuma's API too.
If <vcpu> "placement" is "auto", and <numatune> is not specified
explicitly, a default <numatume> will be added with "placement"
set as "auto", and "mode" set as "strict".
The following XML can now fully drive numad:
1) <vcpu> placement is 'auto', no <numatune> is specified.
<vcpu placement='auto'>10</vcpu>
2) <vcpu> placement is 'auto', no 'placement' is specified for
<numatune>.
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='interleave'/>
</numatune>
And it's also able to control the CPU placement and memory policy
independently. e.g.
1) <vcpu> placement is 'auto', and <numatune> placement is 'static'
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='strict' nodeset='0-10,^7'/>
</numatune>
2) <vcpu> placement is 'static', and <numatune> placement is 'auto'
<vcpu placement='static' cpuset='0-24,^12'>10</vcpu>
<numatune>
<memory mode='interleave' placement='auto'/>
</numatume>
A follow up patch will change the XML formatting codes to always output
'placement' for <vcpu>, even it's 'static'.
2012-05-08 16:04:34 +00:00
|
|
|
int placement_mode; /* enum virDomainNumatuneMemPlacementMode */
|
2011-06-20 07:15:44 +00:00
|
|
|
} memory;
|
|
|
|
|
|
|
|
/* Future NUMA tuning related stuff should go here. */
|
|
|
|
};
|
|
|
|
|
2011-11-08 11:00:33 +00:00
|
|
|
typedef struct _virBlkioDeviceWeight virBlkioDeviceWeight;
|
|
|
|
typedef virBlkioDeviceWeight *virBlkioDeviceWeightPtr;
|
|
|
|
struct _virBlkioDeviceWeight {
|
|
|
|
char *path;
|
|
|
|
unsigned int weight;
|
|
|
|
};
|
|
|
|
|
2013-01-11 16:34:37 +00:00
|
|
|
enum virDomainRNGModel {
|
|
|
|
VIR_DOMAIN_RNG_MODEL_VIRTIO,
|
|
|
|
|
|
|
|
VIR_DOMAIN_RNG_MODEL_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
enum virDomainRNGBackend {
|
|
|
|
VIR_DOMAIN_RNG_BACKEND_RANDOM,
|
|
|
|
VIR_DOMAIN_RNG_BACKEND_EGD,
|
|
|
|
/* VIR_DOMAIN_RNG_BACKEND_POOL, */
|
|
|
|
|
|
|
|
VIR_DOMAIN_RNG_BACKEND_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _virDomainRNGDef {
|
|
|
|
int model;
|
|
|
|
int backend;
|
|
|
|
|
|
|
|
union {
|
|
|
|
char *file; /* file name for 'random' source */
|
|
|
|
virDomainChrSourceDefPtr chardev; /* a char backend for
|
|
|
|
the EGD source */
|
|
|
|
} source;
|
|
|
|
|
|
|
|
virDomainDeviceInfo info;
|
|
|
|
};
|
|
|
|
|
2011-11-08 11:00:33 +00:00
|
|
|
void virBlkioDeviceWeightArrayClear(virBlkioDeviceWeightPtr deviceWeights,
|
|
|
|
int ndevices);
|
|
|
|
|
|
|
|
|
2011-05-27 09:47:30 +00:00
|
|
|
/*
|
|
|
|
* Guest VM main configuration
|
|
|
|
*
|
|
|
|
* NB: if adding to this struct, virDomainDefCheckABIStability
|
|
|
|
* may well need an update
|
|
|
|
*/
|
2008-07-11 16:23:36 +00:00
|
|
|
typedef struct _virDomainDef virDomainDef;
|
|
|
|
typedef virDomainDef *virDomainDefPtr;
|
|
|
|
struct _virDomainDef {
|
|
|
|
int virtType;
|
|
|
|
int id;
|
|
|
|
unsigned char uuid[VIR_UUID_BUFLEN];
|
|
|
|
char *name;
|
2012-02-01 13:03:49 +00:00
|
|
|
char *title;
|
2009-09-30 14:07:24 +00:00
|
|
|
char *description;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2011-02-08 06:59:38 +00:00
|
|
|
struct {
|
|
|
|
unsigned int weight;
|
2011-11-08 11:00:33 +00:00
|
|
|
|
|
|
|
size_t ndevices;
|
|
|
|
virBlkioDeviceWeightPtr devices;
|
2011-02-08 06:59:38 +00:00
|
|
|
} blkio;
|
|
|
|
|
2010-10-12 14:43:39 +00:00
|
|
|
struct {
|
2012-03-02 20:27:39 +00:00
|
|
|
unsigned long long max_balloon; /* in kibibytes */
|
|
|
|
unsigned long long cur_balloon; /* in kibibytes */
|
|
|
|
bool hugepage_backed;
|
2012-08-15 07:51:58 +00:00
|
|
|
int dump_core; /* enum virDomainMemDump */
|
2012-03-02 20:27:39 +00:00
|
|
|
unsigned long long hard_limit; /* in kibibytes */
|
|
|
|
unsigned long long soft_limit; /* in kibibytes */
|
|
|
|
unsigned long long min_guarantee; /* in kibibytes */
|
|
|
|
unsigned long long swap_hard_limit; /* in kibibytes */
|
2010-10-12 14:43:39 +00:00
|
|
|
} mem;
|
2010-09-29 16:20:07 +00:00
|
|
|
unsigned short vcpus;
|
|
|
|
unsigned short maxvcpus;
|
2012-03-08 13:36:26 +00:00
|
|
|
int placement_mode;
|
2012-09-14 07:47:01 +00:00
|
|
|
virBitmapPtr cpumask;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2011-03-29 13:33:36 +00:00
|
|
|
struct {
|
|
|
|
unsigned long shares;
|
2011-07-21 02:10:31 +00:00
|
|
|
unsigned long long period;
|
|
|
|
long long quota;
|
2012-08-21 09:18:42 +00:00
|
|
|
unsigned long long emulator_period;
|
|
|
|
long long emulator_quota;
|
2011-03-29 13:33:36 +00:00
|
|
|
int nvcpupin;
|
2011-06-24 23:09:46 +00:00
|
|
|
virDomainVcpuPinDefPtr *vcpupin;
|
2012-08-21 09:18:32 +00:00
|
|
|
virDomainVcpuPinDefPtr emulatorpin;
|
2011-03-29 13:33:36 +00:00
|
|
|
} cputune;
|
|
|
|
|
2011-06-20 07:15:44 +00:00
|
|
|
virDomainNumatuneDef numatune;
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* These 3 are based on virDomainLifeCycleAction enum flags */
|
|
|
|
int onReboot;
|
|
|
|
int onPoweroff;
|
|
|
|
int onCrash;
|
|
|
|
|
2012-09-06 20:17:01 +00:00
|
|
|
int onLockFailure; /* enum virDomainLockFailureAction */
|
|
|
|
|
2012-08-02 10:12:50 +00:00
|
|
|
struct {
|
|
|
|
/* These options are actually type of enum virDomainPMState */
|
|
|
|
int s3;
|
|
|
|
int s4;
|
|
|
|
} pm;
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
virDomainOSDef os;
|
|
|
|
char *emulator;
|
|
|
|
int features;
|
2012-10-16 14:28:22 +00:00
|
|
|
/* enum virDomainFeatureState */
|
2012-09-12 22:10:56 +00:00
|
|
|
int apic_eoi;
|
2012-10-16 16:25:56 +00:00
|
|
|
/* These options are of type virDomainFeatureState */
|
|
|
|
int hyperv_features[VIR_DOMAIN_HYPERV_LAST];
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-02-02 17:22:03 +00:00
|
|
|
virDomainClockDef clock;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ngraphics;
|
2009-05-07 07:27:49 +00:00
|
|
|
virDomainGraphicsDefPtr *graphics;
|
2008-10-10 16:08:01 +00:00
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ndisks;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainDiskDefPtr *disks;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ncontrollers;
|
2009-12-02 19:15:38 +00:00
|
|
|
virDomainControllerDefPtr *controllers;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nfss;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainFSDefPtr *fss;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nnets;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainNetDefPtr *nets;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t ninputs;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainInputDefPtr *inputs;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nsounds;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainSoundDefPtr *sounds;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nvideos;
|
2009-07-06 13:54:44 +00:00
|
|
|
virDomainVideoDefPtr *videos;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nhostdevs;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainHostdevDefPtr *hostdevs;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nredirdevs;
|
2011-09-02 15:09:14 +00:00
|
|
|
virDomainRedirdevDefPtr *redirdevs;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nsmartcards;
|
2011-01-10 16:41:33 +00:00
|
|
|
virDomainSmartcardDefPtr *smartcards;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nserials;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainChrDefPtr *serials;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nparallels;
|
2008-10-10 16:08:01 +00:00
|
|
|
virDomainChrDefPtr *parallels;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nchannels;
|
2009-11-05 14:31:03 +00:00
|
|
|
virDomainChrDefPtr *channels;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nconsoles;
|
Allow multiple consoles per virtual guest
While Xen only has a single paravirt console, UML, and
QEMU both support multiple paravirt consoles. The LXC
driver can also be trivially made to support multiple
consoles. This patch extends the XML to allow multiple
<console> elements in the XML. It also makes the UML
and QEMU drivers support this config.
* src/conf/domain_conf.c, src/conf/domain_conf.h: Allow
multiple <console> devices
* src/lxc/lxc_driver.c, src/xen/xen_driver.c,
src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c: Update for
internal API changes
* src/security/security_selinux.c, src/security/virt-aa-helper.c:
Only label consoles that aren't a copy of the serial device
* src/qemu/qemu_command.c, src/qemu/qemu_driver.c,
src/qemu/qemu_process.c, src/uml/uml_conf.c,
src/uml/uml_driver.c: Support multiple console devices
* tests/qemuxml2xmltest.c, tests/qemuxml2argvtest.c: Extra
tests for multiple virtio consoles. Set QEMU_CAPS_CHARDEV
for all console /channel tests
* tests/qemuxml2argvdata/qemuxml2argv-channel-virtio-auto.args,
tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args
tests/qemuxml2argvdata/qemuxml2argv-console-virtio.args: Update
for correct chardev syntax
* tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.args,
tests/qemuxml2argvdata/qemuxml2argv-console-virtio-many.xml: New
test file
2011-02-23 18:27:23 +00:00
|
|
|
virDomainChrDefPtr *consoles;
|
|
|
|
|
2011-05-18 16:20:53 +00:00
|
|
|
size_t nleases;
|
2010-12-09 18:25:11 +00:00
|
|
|
virDomainLeaseDefPtr *leases;
|
|
|
|
|
2012-09-26 15:12:28 +00:00
|
|
|
size_t nhubs;
|
2011-09-02 14:20:40 +00:00
|
|
|
virDomainHubDefPtr *hubs;
|
|
|
|
|
2012-08-15 22:10:35 +00:00
|
|
|
size_t nseclabels;
|
|
|
|
virSecurityLabelDefPtr *seclabels;
|
|
|
|
|
2008-10-10 16:08:01 +00:00
|
|
|
/* Only 1 */
|
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-11-05 10:45:44 +00:00
|
|
|
virSysinfoDefPtr sysinfo;
|
2012-09-13 07:25:45 +00:00
|
|
|
virDomainRedirFilterDefPtr redirfilter;
|
2013-01-11 16:34:37 +00:00
|
|
|
virDomainRNGDefPtr rng;
|
2010-04-17 03:08:29 +00:00
|
|
|
|
|
|
|
void *namespaceData;
|
|
|
|
virDomainXMLNamespace ns;
|
2012-01-24 02:26:18 +00:00
|
|
|
|
|
|
|
/* Application-specific custom metadata */
|
|
|
|
xmlNodePtr metadata;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2011-05-04 10:40:59 +00:00
|
|
|
enum virDomainTaintFlags {
|
|
|
|
VIR_DOMAIN_TAINT_CUSTOM_ARGV, /* Custom ARGV passthrough from XML */
|
|
|
|
VIR_DOMAIN_TAINT_CUSTOM_MONITOR, /* Custom monitor commands issued */
|
|
|
|
VIR_DOMAIN_TAINT_HIGH_PRIVILEGES, /* Running with undesirably high privileges */
|
|
|
|
VIR_DOMAIN_TAINT_SHELL_SCRIPTS, /* Network configuration using opaque shell scripts */
|
|
|
|
VIR_DOMAIN_TAINT_DISK_PROBING, /* Relying on potentially unsafe disk format probing */
|
2011-05-05 16:32:21 +00:00
|
|
|
VIR_DOMAIN_TAINT_EXTERNAL_LAUNCH, /* Externally launched guest domain */
|
2011-08-18 10:56:56 +00:00
|
|
|
VIR_DOMAIN_TAINT_HOST_CPU, /* Host CPU passthrough in use */
|
2011-05-04 10:40:59 +00:00
|
|
|
|
|
|
|
VIR_DOMAIN_TAINT_LAST
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
/* Guest VM runtime state */
|
2011-05-04 09:07:01 +00:00
|
|
|
typedef struct _virDomainStateReason virDomainStateReason;
|
|
|
|
struct _virDomainStateReason {
|
|
|
|
int state;
|
|
|
|
int reason;
|
|
|
|
};
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
typedef struct _virDomainObj virDomainObj;
|
|
|
|
typedef virDomainObj *virDomainObjPtr;
|
|
|
|
struct _virDomainObj {
|
2013-01-09 21:00:32 +00:00
|
|
|
virObjectLockable parent;
|
2008-12-04 22:00:14 +00:00
|
|
|
|
build: use correct type for pid and similar types
No thanks to 64-bit windows, with 64-bit pid_t, we have to avoid
constructs like 'int pid'. Our API in libvirt-qemu cannot be
changed without breaking ABI; but then again, libvirt-qemu can
only be used on systems that support UNIX sockets, which rules
out Windows (even if qemu could be compiled there) - so for all
points on the call chain that interact with this API decision,
we require a different variable name to make it clear that we
audited the use for safety.
Adding a syntax-check rule only solves half the battle; anywhere
that uses printf on a pid_t still needs to be converted, but that
will be a separate patch.
* cfg.mk (sc_correct_id_types): New syntax check.
* src/libvirt-qemu.c (virDomainQemuAttach): Document why we didn't
use pid_t for pid, and validate for overflow.
* include/libvirt/libvirt-qemu.h (virDomainQemuAttach): Tweak name
for syntax check.
* src/vmware/vmware_conf.c (vmwareExtractPid): Likewise.
* src/driver.h (virDrvDomainQemuAttach): Likewise.
* tools/virsh.c (cmdQemuAttach): Likewise.
* src/remote/qemu_protocol.x (qemu_domain_attach_args): Likewise.
* src/qemu_protocol-structs (qemu_domain_attach_args): Likewise.
* src/util/cgroup.c (virCgroupPidCode, virCgroupKillInternal):
Likewise.
* src/qemu/qemu_command.c(qemuParseProcFileStrings): Likewise.
(qemuParseCommandLinePid): Use pid_t for pid.
* daemon/libvirtd.c (daemonForkIntoBackground): Likewise.
* src/conf/domain_conf.h (_virDomainObj): Likewise.
* src/probes.d (rpc_socket_new): Likewise.
* src/qemu/qemu_command.h (qemuParseCommandLinePid): Likewise.
* src/qemu/qemu_driver.c (qemudGetProcessInfo, qemuDomainAttach):
Likewise.
* src/qemu/qemu_process.c (qemuProcessAttach): Likewise.
* src/qemu/qemu_process.h (qemuProcessAttach): Likewise.
* src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
* src/util/virnetdev.h (virNetDevSetNamespace): Likewise.
* src/util/virnetdev.c (virNetDevSetNamespace): Likewise.
* tests/testutils.c (virtTestCaptureProgramOutput): Likewise.
* src/conf/storage_conf.h (_virStoragePerms): Use mode_t, uid_t,
and gid_t rather than int.
* src/security/security_dac.c (virSecurityDACSetOwnership): Likewise.
* src/conf/storage_conf.c (virStorageDefParsePerms): Avoid
compiler warning.
2012-02-10 23:08:11 +00:00
|
|
|
pid_t pid;
|
2011-05-04 09:07:01 +00:00
|
|
|
virDomainStateReason state;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
unsigned int autostart : 1;
|
|
|
|
unsigned int persistent : 1;
|
2010-11-15 03:23:32 +00:00
|
|
|
unsigned int updated : 1;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
virDomainDefPtr def; /* The current definition */
|
|
|
|
virDomainDefPtr newDef; /* New definition to activate at shutdown */
|
2009-10-06 11:50:58 +00:00
|
|
|
|
snapshot: make virDomainSnapshotObjList opaque
We were failing to react to allocation failure when initializing
a snapshot object list. Changing things to store a pointer
instead of a complete object adds one more possible point of
allocation failure, but at the same time, will make it easier to
react to failure now, as well as making it easier for a future
patch to split all virDomainSnapshotPtr handling into a separate
file, as I continue to add even more snapshot code.
Luckily, there was only one client outside of domain_conf.c that
was actually peeking inside the object, and a new wrapper function
was easy.
* src/conf/domain_conf.h (_virDomainObj): Use a pointer.
(virDomainSnapshotObjListInit): Rename.
(virDomainSnapshotObjListFree, virDomainSnapshotForEach): New
declarations.
(_virDomainSnapshotObjList): Move definitions...
* src/conf/domain_conf.c: ...here.
(virDomainSnapshotObjListInit, virDomainSnapshotObjListDeinit):
Rename...
(virDomainSnapshotObjListNew, virDomainSnapshotObjListFree): ...to
these.
(virDomainSnapshotForEach): New function.
(virDomainObjDispose, virDomainListPopulate): Adjust callers.
* src/qemu/qemu_domain.c (qemuDomainSnapshotDiscard)
(qemuDomainSnapshotDiscardAllMetadata): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad)
(qemuDomainUndefineFlags, qemuDomainSnapshotCreateXML)
(qemuDomainSnapshotListNames, qemuDomainSnapshotNum)
(qemuDomainListAllSnapshots)
(qemuDomainSnapshotListChildrenNames)
(qemuDomainSnapshotNumChildren)
(qemuDomainSnapshotListAllChildren)
(qemuDomainSnapshotLookupByName, qemuDomainSnapshotGetParent)
(qemuDomainSnapshotGetXMLDesc, qemuDomainSnapshotIsCurrent)
(qemuDomainSnapshotHasMetadata, qemuDomainRevertToSnapshot)
(qemuDomainSnapshotDelete): Likewise.
* src/libvirt_private.syms (domain_conf.h): Export new function.
2012-08-14 06:22:39 +00:00
|
|
|
virDomainSnapshotObjListPtr snapshots;
|
2010-04-02 14:41:30 +00:00
|
|
|
virDomainSnapshotObjPtr current_snapshot;
|
|
|
|
|
2012-06-11 09:03:27 +00:00
|
|
|
bool hasManagedSave;
|
|
|
|
|
2009-10-06 11:50:58 +00:00
|
|
|
void *privateData;
|
|
|
|
void (*privateDataFreeFunc)(void *);
|
2011-05-04 10:40:59 +00:00
|
|
|
|
|
|
|
int taint;
|
2008-07-11 16:23:36 +00:00
|
|
|
};
|
|
|
|
|
2008-10-10 14:20:37 +00:00
|
|
|
typedef struct _virDomainObjList virDomainObjList;
|
|
|
|
typedef virDomainObjList *virDomainObjListPtr;
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2011-03-23 05:48:24 +00:00
|
|
|
static inline bool
|
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;
|
|
|
|
}
|
|
|
|
|
2012-07-11 13:35:46 +00:00
|
|
|
virDomainObjPtr virDomainObjNew(virCapsPtr caps);
|
2009-11-30 18:35:58 +00:00
|
|
|
|
2013-01-11 16:04:47 +00:00
|
|
|
virDomainObjListPtr virDomainObjListNew(void);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2013-01-11 16:04:47 +00:00
|
|
|
virDomainObjPtr virDomainObjListFindByID(const virDomainObjListPtr doms,
|
|
|
|
int id);
|
|
|
|
virDomainObjPtr virDomainObjListFindByUUID(const virDomainObjListPtr doms,
|
|
|
|
const unsigned char *uuid);
|
|
|
|
virDomainObjPtr virDomainObjListFindByName(const virDomainObjListPtr doms,
|
|
|
|
const char *name);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2011-05-04 10:40:59 +00:00
|
|
|
bool virDomainObjTaint(virDomainObjPtr obj,
|
|
|
|
enum virDomainTaintFlags taint);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
|
|
|
void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def);
|
|
|
|
void virDomainInputDefFree(virDomainInputDefPtr def);
|
|
|
|
void virDomainDiskDefFree(virDomainDiskDefPtr def);
|
2012-03-07 02:06:30 +00:00
|
|
|
void virDomainLeaseDefFree(virDomainLeaseDefPtr def);
|
2010-12-07 19:56:34 +00:00
|
|
|
void virDomainDiskHostDefFree(virDomainDiskHostDefPtr def);
|
2012-02-27 09:20:11 +00:00
|
|
|
int virDomainDiskFindControllerModel(virDomainDefPtr def,
|
|
|
|
virDomainDiskDefPtr disk,
|
|
|
|
int controllerType);
|
2013-02-19 12:27:45 +00:00
|
|
|
virDomainDiskDefPtr virDomainDiskFindByBusAndDst(virDomainDefPtr def,
|
|
|
|
int bus,
|
|
|
|
char *dst);
|
2009-12-02 19:15:38 +00:00
|
|
|
void virDomainControllerDefFree(virDomainControllerDefPtr def);
|
2008-08-01 13:31:37 +00:00
|
|
|
void virDomainFSDefFree(virDomainFSDefPtr def);
|
2011-06-26 08:09:00 +00:00
|
|
|
void virDomainActualNetDefFree(virDomainActualNetDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainNetDefFree(virDomainNetDefPtr def);
|
2011-01-10 16:41:33 +00:00
|
|
|
void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainChrDefFree(virDomainChrDefPtr def);
|
domain_conf: split source data out from ChrDef
This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.
* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.
2011-01-07 22:45:01 +00:00
|
|
|
void virDomainChrSourceDefFree(virDomainChrSourceDefPtr def);
|
2011-11-15 08:01:31 +00:00
|
|
|
int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr src,
|
|
|
|
virDomainChrSourceDefPtr dest);
|
2012-05-15 22:55:09 +00:00
|
|
|
void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
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);
|
2012-01-31 09:16:54 +00:00
|
|
|
virDomainHostdevDefPtr virDomainHostdevDefAlloc(void);
|
|
|
|
void virDomainHostdevDefClear(virDomainHostdevDefPtr def);
|
2008-08-08 14:27:05 +00:00
|
|
|
void virDomainHostdevDefFree(virDomainHostdevDefPtr def);
|
2011-09-02 14:20:40 +00:00
|
|
|
void virDomainHubDefFree(virDomainHubDefPtr def);
|
2011-09-02 15:09:14 +00:00
|
|
|
void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def);
|
2012-09-13 07:25:45 +00:00
|
|
|
void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def);
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainDeviceDefFree(virDomainDeviceDefPtr def);
|
2012-03-01 18:47:34 +00:00
|
|
|
virDomainDeviceDefPtr virDomainDeviceDefCopy(virCapsPtr caps,
|
|
|
|
const virDomainDefPtr def,
|
|
|
|
virDomainDeviceDefPtr src);
|
2009-11-30 18:35:58 +00:00
|
|
|
int virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info,
|
|
|
|
int type);
|
2012-10-11 05:09:00 +00:00
|
|
|
int virDomainDeviceInfoCopy(virDomainDeviceInfoPtr dst,
|
|
|
|
virDomainDeviceInfoPtr src);
|
2009-11-30 18:35:58 +00:00
|
|
|
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,
|
2012-02-22 21:06:10 +00:00
|
|
|
virDomainDeviceDefPtr dev,
|
|
|
|
virDomainDeviceInfoPtr info,
|
2010-01-27 15:10:34 +00:00
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainDeviceInfoIterate(virDomainDefPtr def,
|
|
|
|
virDomainDeviceInfoCallback cb,
|
|
|
|
void *opaque);
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
void virDomainDefFree(virDomainDefPtr vm);
|
|
|
|
|
2011-04-14 16:05:14 +00:00
|
|
|
virDomainChrDefPtr virDomainChrDefNew(void);
|
|
|
|
|
Merge virDomainObjListIsDuplicate into virDomainObjListAdd
The duplicate VM checking should be done atomically with
virDomainObjListAdd, so shoud not be a separate function.
Instead just use flags to indicate what kind of checks are
required.
This pair, used in virDomainCreateXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainRestoreFlags:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, true)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainDefineXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 0) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
0, NULL)))
goto cleanup;
2013-01-14 14:46:58 +00:00
|
|
|
enum {
|
|
|
|
VIR_DOMAIN_OBJ_LIST_ADD_LIVE = (1 << 0),
|
|
|
|
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1),
|
|
|
|
};
|
2013-01-11 16:04:47 +00:00
|
|
|
virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms,
|
|
|
|
virCapsPtr caps,
|
|
|
|
const virDomainDefPtr def,
|
Merge virDomainObjListIsDuplicate into virDomainObjListAdd
The duplicate VM checking should be done atomically with
virDomainObjListAdd, so shoud not be a separate function.
Instead just use flags to indicate what kind of checks are
required.
This pair, used in virDomainCreateXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainRestoreFlags:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, true)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainDefineXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 0) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
0, NULL)))
goto cleanup;
2013-01-14 14:46:58 +00:00
|
|
|
unsigned int flags,
|
|
|
|
virDomainDefPtr *oldDef);
|
2010-05-20 09:36:24 +00:00
|
|
|
void virDomainObjAssignDef(virDomainObjPtr domain,
|
|
|
|
const virDomainDefPtr def,
|
Merge virDomainObjListIsDuplicate into virDomainObjListAdd
The duplicate VM checking should be done atomically with
virDomainObjListAdd, so shoud not be a separate function.
Instead just use flags to indicate what kind of checks are
required.
This pair, used in virDomainCreateXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainRestoreFlags:
if (virDomainObjListIsDuplicate(privconn->domains, def, 1) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, true)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
VIR_DOMAIN_OBJ_LIST_ADD_LIVE |
VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE,
NULL)))
goto cleanup;
This pair, used in virDomainDefineXML:
if (virDomainObjListIsDuplicate(privconn->domains, def, 0) < 0)
goto cleanup;
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def, false)))
goto cleanup;
Changes to
if (!(dom = virDomainObjListAdd(privconn->domains,
privconn->caps,
def,
0, NULL)))
goto cleanup;
2013-01-14 14:46:58 +00:00
|
|
|
bool live,
|
|
|
|
virDomainDefPtr *oldDef);
|
2010-11-19 18:34:19 +00:00
|
|
|
int virDomainObjSetDefTransient(virCapsPtr caps,
|
2011-01-12 06:04:33 +00:00
|
|
|
virDomainObjPtr domain,
|
|
|
|
bool live);
|
2010-11-19 19:51:46 +00:00
|
|
|
virDomainDefPtr
|
|
|
|
virDomainObjGetPersistentDef(virCapsPtr caps,
|
|
|
|
virDomainObjPtr domain);
|
2011-12-12 05:16:49 +00:00
|
|
|
|
|
|
|
int
|
|
|
|
virDomainLiveConfigHelperMethod(virCapsPtr caps,
|
|
|
|
virDomainObjPtr dom,
|
|
|
|
unsigned int *flags,
|
|
|
|
virDomainDefPtr *persistentDef);
|
|
|
|
|
2012-11-15 20:40:25 +00:00
|
|
|
virDomainDefPtr virDomainDefCopy(virCapsPtr caps, virDomainDefPtr src,
|
|
|
|
bool migratable);
|
2011-04-22 03:07:56 +00:00
|
|
|
virDomainDefPtr
|
|
|
|
virDomainObjCopyPersistentDef(virCapsPtr caps, virDomainObjPtr dom);
|
|
|
|
|
2013-01-11 16:04:47 +00:00
|
|
|
void virDomainObjListRemove(virDomainObjListPtr doms,
|
|
|
|
virDomainObjPtr dom);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
virDomainDeviceDefPtr virDomainDeviceDefParse(virCapsPtr caps,
|
2012-08-15 22:10:35 +00:00
|
|
|
virDomainDefPtr def,
|
2009-01-08 13:54:20 +00:00
|
|
|
const char *xmlStr,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned 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,
|
2011-07-11 17:29:09 +00:00
|
|
|
unsigned int expectedVirtTypes,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned 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,
|
2011-07-11 17:29:09 +00:00
|
|
|
unsigned int expectedVirtTypes,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned 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,
|
2011-07-11 17:29:09 +00:00
|
|
|
unsigned int expectedVirtTypes,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned int flags);
|
2009-06-12 11:38:50 +00:00
|
|
|
|
2011-05-27 09:47:30 +00:00
|
|
|
bool virDomainDefCheckABIStability(virDomainDefPtr src,
|
|
|
|
virDomainDefPtr dst);
|
|
|
|
|
2010-02-18 16:52:03 +00:00
|
|
|
int virDomainDefAddImplicitControllers(virDomainDefPtr def);
|
2010-01-05 13:31:20 +00:00
|
|
|
|
2010-02-09 18:58:01 +00:00
|
|
|
char *virDomainDefFormat(virDomainDefPtr def,
|
2011-07-04 19:06:07 +00:00
|
|
|
unsigned int flags);
|
2011-09-17 12:57:30 +00:00
|
|
|
int virDomainDefFormatInternal(virDomainDefPtr def,
|
|
|
|
unsigned int flags,
|
|
|
|
virBufferPtr buf);
|
2008-07-11 16:23:36 +00:00
|
|
|
|
2012-07-03 13:30:25 +00:00
|
|
|
int virDomainDefCompatibleDevice(virDomainDefPtr def,
|
|
|
|
virDomainDeviceDefPtr dev);
|
|
|
|
|
2012-08-30 13:38:37 +00:00
|
|
|
int virDomainVcpuPinAdd(virDomainVcpuPinDefPtr **vcpupin_list,
|
2012-08-21 09:18:28 +00:00
|
|
|
int *nvcpupin,
|
2011-03-29 13:33:36 +00:00
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen,
|
|
|
|
int vcpu);
|
|
|
|
|
2011-06-24 23:09:46 +00:00
|
|
|
int virDomainVcpuPinDel(virDomainDefPtr def, int vcpu);
|
2011-06-10 06:40:36 +00:00
|
|
|
|
2012-08-21 09:18:36 +00:00
|
|
|
int virDomainEmulatorPinAdd(virDomainDefPtr def,
|
|
|
|
unsigned char *cpumap,
|
|
|
|
int maplen);
|
|
|
|
|
|
|
|
int virDomainEmulatorPinDel(virDomainDefPtr def);
|
|
|
|
|
2013-01-11 16:34:37 +00:00
|
|
|
void virDomainRNGDefFree(virDomainRNGDefPtr def);
|
|
|
|
|
snapshot: also support disks by path
I got confused when 'virsh domblkinfo dom disk' required the
path to a disk (which can be ambiguous, since a single file
can back multiple disks), rather than the unambiguous target
device name that I was using in disk snapshots. So, in true
developer fashion, I went for the best of both worlds - all
interfaces that operate on a disk (aka block) now accept
either the target name or the unambiguous path to the backing
file used by the disk.
* src/conf/domain_conf.h (virDomainDiskIndexByName): Add
parameter.
(virDomainDiskPathByName): New prototype.
* src/libvirt_private.syms (domain_conf.h): Export it.
* src/conf/domain_conf.c (virDomainDiskIndexByName): Also allow
searching by path, and decide whether ambiguity is okay.
(virDomainDiskPathByName): New function.
(virDomainDiskRemoveByName, virDomainSnapshotAlignDisks): Update
callers.
* src/qemu/qemu_driver.c (qemudDomainBlockPeek)
(qemuDomainAttachDeviceConfig, qemuDomainUpdateDeviceConfig)
(qemuDomainGetBlockInfo, qemuDiskPathToAlias): Likewise.
* src/qemu/qemu_process.c (qemuProcessFindDomainDiskByPath):
Likewise.
* src/libxl/libxl_driver.c (libxlDomainAttachDeviceDiskLive)
(libxlDomainDetachDeviceDiskLive, libxlDomainAttachDeviceConfig)
(libxlDomainUpdateDeviceConfig): Likewise.
* src/uml/uml_driver.c (umlDomainBlockPeek): Likewise.
* src/xen/xend_internal.c (xenDaemonDomainBlockPeek): Likewise.
* docs/formatsnapshot.html.in: Update documentation.
* tools/virsh.pod (domblkstat, domblkinfo): Likewise.
* docs/schemas/domaincommon.rng (diskTarget): Tighten pattern on
disk targets.
* docs/schemas/domainsnapshot.rng (disksnapshot): Update to match.
* tests/domainsnapshotxml2xmlin/disk_snapshot.xml: Update test.
2011-08-20 02:38:36 +00:00
|
|
|
int virDomainDiskIndexByName(virDomainDefPtr def, const char *name,
|
|
|
|
bool allow_ambiguous);
|
|
|
|
const char *virDomainDiskPathByName(virDomainDefPtr, const char *name);
|
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
|
|
|
|
util: eliminate device object leaks related to virDomain*Remove*()
There are several functions in domain_conf.c that remove a device
object from the domain's list of that object type, but don't free the
object or return it to the caller to free. In many cases this isn't a
problem because the caller already had a pointer to the object and
frees it afterward, but in several cases the removed object was just
left floating around with no references to it.
In particular, the function qemuDomainDetachDeviceConfig() calls
functions to locate and remove net (virDomainNetRemoveByMac), disk
(virDomainDiskRemoveByName()), and lease (virDomainLeaseRemove())
devices, but neither it nor its caller qemuDomainModifyDeviceConfig()
ever obtain a pointer to the device being removed, much less free it.
This patch modifies the following "remove" functions to return a
pointer to the device object being removed from the domain device
arrays, to give the caller the option of freeing the device object
using that pointer if needed. In places where the object was
previously leaked, it is now freed:
virDomainDiskRemove
virDomainDiskRemoveByName
virDomainNetRemove
virDomainNetRemoveByMac
virDomainHostdevRemove
virDomainLeaseRemove
virDomainLeaseRemoveAt
The functions that had been leaking:
libxlDomainDetachConfig - leaked a virDomainDiskDef
qemuDomainDetachDeviceConfig - could leak a virDomainDiskDef,
a virDomainNetDef, or a
virDomainLeaseDef
qemuDomainDetachLease - leaked a virDomainLeaseDef
2012-03-06 23:06:14 +00:00
|
|
|
virDomainDiskDefPtr
|
|
|
|
virDomainDiskRemove(virDomainDefPtr def, size_t i);
|
|
|
|
virDomainDiskDefPtr
|
|
|
|
virDomainDiskRemoveByName(virDomainDefPtr def, const char *name);
|
blockjob: react to active block copy
For now, disk migration via block copy job is not implemented in
libvirt. But when we do implement it, we have to deal with the
fact that qemu does not yet provide an easy way to re-start a qemu
process with mirroring still intact. Paolo has proposed an idea
for a persistent dirty bitmap that might make this possible, but
until that design is complete, it's hard to say what changes
libvirt would need. Even something like 'virDomainSave' becomes
hairy, if you realize the implications that 'virDomainRestore'
would be stuck with recreating the same mirror layout.
But if we step back and look at the bigger picture, we realize that
the initial client of live storage migration via disk mirroring is
oVirt, which always uses transient domains, and that if a transient
domain is destroyed while a mirror exists, oVirt can easily restart
the storage migration by creating a new domain that visits just the
source storage, with no loss in data.
We can make life a lot easier by being cowards for now, forbidding
certain operations on a domain. This patch guarantees that we
never get in a state where we would have to restart a domain with
a mirroring block copy, by preventing saves, snapshots, migration,
hot unplug of a disk in use, and conversion to a persistent domain
(thankfully, it is still relatively easy to 'virsh undefine' a
running domain to temporarily make it transient, run tests on
'virsh blockcopy', then 'virsh define' to restore the persistence).
Later, if the qemu design is enhanced, we can relax our code.
The change to qemudDomainDefine looks a bit odd for undoing an
assignment, rather than probing up front to avoid the assignment,
but this is because of how virDomainAssignDef combines both a
lookup and assignment into a single function call.
* src/conf/domain_conf.h (virDomainHasDiskMirror): New prototype.
* src/conf/domain_conf.c (virDomainHasDiskMirror): New function.
* src/libvirt_private.syms (domain_conf.h): Export it.
* src/qemu/qemu_driver.c (qemuDomainSaveInternal)
(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
(qemuDomainBlockJobImpl, qemudDomainDefine): Prevent dangerous
actions while block copy is already in action.
* src/qemu/qemu_hotplug.c (qemuDomainDetachDiskDevice): Likewise.
* src/qemu/qemu_migration.c (qemuMigrationIsAllowed): Likewise.
2012-04-10 02:39:47 +00:00
|
|
|
bool virDomainHasDiskMirror(virDomainObjPtr vm);
|
2010-08-23 09:31:26 +00:00
|
|
|
|
qemu: fix attach/detach of netdevs with matching mac addrs
This resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=862515
which describes inconsistencies in dealing with duplicate mac
addresses on network devices in a domain.
(at any rate, it resolves *almost* everything, and prints out an
informative error message for the one problem that isn't solved, but
has a workaround.)
A synopsis of the problems:
1) you can't do a persistent attach-interface of a device with a mac
address that matches an existing device.
2) you *can* do a live attach-interface of such a device.
3) you *can* directly edit a domain and put in two devices with
matching mac addresses.
4) When running virsh detach-device (live or config), only MAC address
is checked when matching the device to remove, so the first device
with the desired mac address will be removed. This isn't always the
one that's wanted.
5) when running virsh detach-interface (live or config), the only two
items that can be specified to match against are mac address and model
type (virtio, etc) - if multiple netdevs match both of those
attributes, it again just finds the first one added and assumes that
is the only match.
Since it is completely valid to have multiple network devices with the
same MAC address (although it can cause problems in many cases, there
*are* valid use cases), what is needed is:
1) remove the restriction that prohibits doing a persistent add of a
netdev with a duplicate mac address.
2) enhance the backend of virDomainDetachDeviceFlags to check for
something that *is* guaranteed unique (but still work with just mac
address, as long as it yields only a single results.
This patch does three things:
1) removes the check for duplicate mac address during a persistent
netdev attach.
2) unifies the searching for both live and config detach of netdevices
in the subordinate functions of qemuDomainModifyDeviceFlags() to use the
new function virDomainNetFindIdx (which matches mac address and PCI
address if available, checking for duplicates if only mac address was
specified). This function returns -2 if multiple matches are found,
allowing the callers to print out an appropriate message.
Steps 1 & 2 are enough to fully fix the problem when using virsh
attach-device and detach-device (which require an XML description of
the device rather than a bunch of commandline args)
3) modifies the virsh detach-interface command to check for multiple
matches of mac address and show an error message suggesting use of the
detach-device command in cases where there are multiple matching mac
addresses.
Later we should decide how we want to input a PCI address on the virsh
commandline, and enhance detach-interface to take a --address option,
eliminating the need to use detach-device
* src/conf/domain_conf.c
* src/conf/domain_conf.h
* src/libvirt_private.syms
* added new virDomainNetFindIdx function
* removed now unused virDomainNetIndexByMac and
virDomainNetRemoveByMac
* src/qemu/qemu_driver.c
* remove check for duplicate max from qemuDomainAttachDeviceConfig
* use virDomainNetFindIdx/virDomainNetRemove instead
of virDomainNetRemoveByMac in qemuDomainDetachDeviceConfig
* use virDomainNetFindIdx instead of virDomainIndexByMac
in qemuDomainUpdateDeviceConfig
* src/qemu/qemu_hotplug.c
* use virDomainNetFindIdx instead of a homespun loop in
qemuDomainDetachNetDevice.
* tools/virsh-domain.c: modified detach-interface command as described
above
2012-10-25 20:03:35 +00:00
|
|
|
int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net);
|
|
|
|
virDomainNetDefPtr virDomainNetFind(virDomainDefPtr def, const char *device);
|
2011-05-27 07:01:47 +00:00
|
|
|
int virDomainNetInsert(virDomainDefPtr def, virDomainNetDefPtr net);
|
qemu: fix attach/detach of netdevs with matching mac addrs
This resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=862515
which describes inconsistencies in dealing with duplicate mac
addresses on network devices in a domain.
(at any rate, it resolves *almost* everything, and prints out an
informative error message for the one problem that isn't solved, but
has a workaround.)
A synopsis of the problems:
1) you can't do a persistent attach-interface of a device with a mac
address that matches an existing device.
2) you *can* do a live attach-interface of such a device.
3) you *can* directly edit a domain and put in two devices with
matching mac addresses.
4) When running virsh detach-device (live or config), only MAC address
is checked when matching the device to remove, so the first device
with the desired mac address will be removed. This isn't always the
one that's wanted.
5) when running virsh detach-interface (live or config), the only two
items that can be specified to match against are mac address and model
type (virtio, etc) - if multiple netdevs match both of those
attributes, it again just finds the first one added and assumes that
is the only match.
Since it is completely valid to have multiple network devices with the
same MAC address (although it can cause problems in many cases, there
*are* valid use cases), what is needed is:
1) remove the restriction that prohibits doing a persistent add of a
netdev with a duplicate mac address.
2) enhance the backend of virDomainDetachDeviceFlags to check for
something that *is* guaranteed unique (but still work with just mac
address, as long as it yields only a single results.
This patch does three things:
1) removes the check for duplicate mac address during a persistent
netdev attach.
2) unifies the searching for both live and config detach of netdevices
in the subordinate functions of qemuDomainModifyDeviceFlags() to use the
new function virDomainNetFindIdx (which matches mac address and PCI
address if available, checking for duplicates if only mac address was
specified). This function returns -2 if multiple matches are found,
allowing the callers to print out an appropriate message.
Steps 1 & 2 are enough to fully fix the problem when using virsh
attach-device and detach-device (which require an XML description of
the device rather than a bunch of commandline args)
3) modifies the virsh detach-interface command to check for multiple
matches of mac address and show an error message suggesting use of the
detach-device command in cases where there are multiple matching mac
addresses.
Later we should decide how we want to input a PCI address on the virsh
commandline, and enhance detach-interface to take a --address option,
eliminating the need to use detach-device
* src/conf/domain_conf.c
* src/conf/domain_conf.h
* src/libvirt_private.syms
* added new virDomainNetFindIdx function
* removed now unused virDomainNetIndexByMac and
virDomainNetRemoveByMac
* src/qemu/qemu_driver.c
* remove check for duplicate max from qemuDomainAttachDeviceConfig
* use virDomainNetFindIdx/virDomainNetRemove instead
of virDomainNetRemoveByMac in qemuDomainDetachDeviceConfig
* use virDomainNetFindIdx instead of virDomainIndexByMac
in qemuDomainUpdateDeviceConfig
* src/qemu/qemu_hotplug.c
* use virDomainNetFindIdx instead of a homespun loop in
qemuDomainDetachNetDevice.
* tools/virsh-domain.c: modified detach-interface command as described
above
2012-10-25 20:03:35 +00:00
|
|
|
virDomainNetDefPtr virDomainNetRemove(virDomainDefPtr def, size_t i);
|
2011-05-27 07:01:47 +00:00
|
|
|
|
2012-02-27 06:46:47 +00:00
|
|
|
int virDomainHostdevInsert(virDomainDefPtr def, virDomainHostdevDefPtr hostdev);
|
util: eliminate device object leaks related to virDomain*Remove*()
There are several functions in domain_conf.c that remove a device
object from the domain's list of that object type, but don't free the
object or return it to the caller to free. In many cases this isn't a
problem because the caller already had a pointer to the object and
frees it afterward, but in several cases the removed object was just
left floating around with no references to it.
In particular, the function qemuDomainDetachDeviceConfig() calls
functions to locate and remove net (virDomainNetRemoveByMac), disk
(virDomainDiskRemoveByName()), and lease (virDomainLeaseRemove())
devices, but neither it nor its caller qemuDomainModifyDeviceConfig()
ever obtain a pointer to the device being removed, much less free it.
This patch modifies the following "remove" functions to return a
pointer to the device object being removed from the domain device
arrays, to give the caller the option of freeing the device object
using that pointer if needed. In places where the object was
previously leaked, it is now freed:
virDomainDiskRemove
virDomainDiskRemoveByName
virDomainNetRemove
virDomainNetRemoveByMac
virDomainHostdevRemove
virDomainLeaseRemove
virDomainLeaseRemoveAt
The functions that had been leaking:
libxlDomainDetachConfig - leaked a virDomainDiskDef
qemuDomainDetachDeviceConfig - could leak a virDomainDiskDef,
a virDomainNetDef, or a
virDomainLeaseDef
qemuDomainDetachLease - leaked a virDomainLeaseDef
2012-03-06 23:06:14 +00:00
|
|
|
virDomainHostdevDefPtr
|
|
|
|
virDomainHostdevRemove(virDomainDefPtr def, size_t i);
|
2012-02-27 06:46:47 +00:00
|
|
|
int virDomainHostdevFind(virDomainDefPtr def, virDomainHostdevDefPtr match,
|
|
|
|
virDomainHostdevDefPtr *found);
|
|
|
|
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
int virDomainGraphicsListenGetType(virDomainGraphicsDefPtr def, size_t ii)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
int virDomainGraphicsListenSetType(virDomainGraphicsDefPtr def, size_t ii, int val)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
const char *virDomainGraphicsListenGetAddress(virDomainGraphicsDefPtr def,
|
|
|
|
size_t ii)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
int virDomainGraphicsListenSetAddress(virDomainGraphicsDefPtr def,
|
|
|
|
size_t ii, const char *address,
|
|
|
|
int len, bool setType)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
const char *virDomainGraphicsListenGetNetwork(virDomainGraphicsDefPtr def,
|
|
|
|
size_t ii)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
int virDomainGraphicsListenSetNetwork(virDomainGraphicsDefPtr def,
|
|
|
|
size_t ii, const char *network, int len)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2011-06-26 08:09:00 +00:00
|
|
|
int virDomainNetGetActualType(virDomainNetDefPtr iface);
|
2011-11-10 11:18:57 +00:00
|
|
|
const char *virDomainNetGetActualBridgeName(virDomainNetDefPtr iface);
|
|
|
|
const char *virDomainNetGetActualDirectDev(virDomainNetDefPtr iface);
|
2011-06-26 08:09:00 +00:00
|
|
|
int virDomainNetGetActualDirectMode(virDomainNetDefPtr iface);
|
2012-02-15 17:37:15 +00:00
|
|
|
virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr iface);
|
2011-11-02 14:43:16 +00:00
|
|
|
virNetDevVPortProfilePtr
|
2012-02-15 19:19:32 +00:00
|
|
|
virDomainNetGetActualVirtPortProfile(virDomainNetDefPtr iface);
|
Adjust naming of network device bandwidth management APIs
Rename virBandwidth to virNetDevBandwidth, and virRate to
virNetDevBandwidthRate.
* src/util/network.c, src/util/network.h: Rename bandwidth
structs and APIs
* src/conf/domain_conf.c, src/conf/domain_conf.h,
src/conf/network_conf.c, src/conf/network_conf.h,
src/lxc/lxc_driver.c, src/network/bridge_driver.c,
src/qemu/qemu_command.c, src/util/macvtap.c,
src/util/macvtap.h, tools/virsh.c: Update for API changes.
2011-11-02 14:29:05 +00:00
|
|
|
virNetDevBandwidthPtr
|
2011-07-26 12:42:37 +00:00
|
|
|
virDomainNetGetActualBandwidth(virDomainNetDefPtr iface);
|
2012-08-12 07:51:30 +00:00
|
|
|
virNetDevVlanPtr virDomainNetGetActualVlan(virDomainNetDefPtr iface);
|
2011-06-26 08:09:00 +00:00
|
|
|
|
2009-12-02 19:15:38 +00:00
|
|
|
int virDomainControllerInsert(virDomainDefPtr def,
|
|
|
|
virDomainControllerDefPtr controller);
|
|
|
|
void virDomainControllerInsertPreAlloced(virDomainDefPtr def,
|
|
|
|
virDomainControllerDefPtr controller);
|
2012-07-23 08:18:57 +00:00
|
|
|
int virDomainControllerFind(virDomainDefPtr def, int type, int idx);
|
|
|
|
virDomainControllerDefPtr virDomainControllerRemove(virDomainDefPtr def, size_t i);
|
2011-05-18 16:20:53 +00:00
|
|
|
|
|
|
|
int virDomainLeaseIndex(virDomainDefPtr def,
|
|
|
|
virDomainLeaseDefPtr lease);
|
|
|
|
int virDomainLeaseInsert(virDomainDefPtr def,
|
|
|
|
virDomainLeaseDefPtr lease);
|
|
|
|
int virDomainLeaseInsertPreAlloc(virDomainDefPtr def);
|
|
|
|
void virDomainLeaseInsertPreAlloced(virDomainDefPtr def,
|
|
|
|
virDomainLeaseDefPtr lease);
|
util: eliminate device object leaks related to virDomain*Remove*()
There are several functions in domain_conf.c that remove a device
object from the domain's list of that object type, but don't free the
object or return it to the caller to free. In many cases this isn't a
problem because the caller already had a pointer to the object and
frees it afterward, but in several cases the removed object was just
left floating around with no references to it.
In particular, the function qemuDomainDetachDeviceConfig() calls
functions to locate and remove net (virDomainNetRemoveByMac), disk
(virDomainDiskRemoveByName()), and lease (virDomainLeaseRemove())
devices, but neither it nor its caller qemuDomainModifyDeviceConfig()
ever obtain a pointer to the device being removed, much less free it.
This patch modifies the following "remove" functions to return a
pointer to the device object being removed from the domain device
arrays, to give the caller the option of freeing the device object
using that pointer if needed. In places where the object was
previously leaked, it is now freed:
virDomainDiskRemove
virDomainDiskRemoveByName
virDomainNetRemove
virDomainNetRemoveByMac
virDomainHostdevRemove
virDomainLeaseRemove
virDomainLeaseRemoveAt
The functions that had been leaking:
libxlDomainDetachConfig - leaked a virDomainDiskDef
qemuDomainDetachDeviceConfig - could leak a virDomainDiskDef,
a virDomainNetDef, or a
virDomainLeaseDef
qemuDomainDetachLease - leaked a virDomainLeaseDef
2012-03-06 23:06:14 +00:00
|
|
|
virDomainLeaseDefPtr
|
|
|
|
virDomainLeaseRemoveAt(virDomainDefPtr def, size_t i);
|
|
|
|
virDomainLeaseDefPtr
|
|
|
|
virDomainLeaseRemove(virDomainDefPtr def,
|
|
|
|
virDomainLeaseDefPtr lease);
|
2011-05-18 16:20:53 +00:00
|
|
|
|
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);
|
|
|
|
|
2013-01-11 16:04:47 +00:00
|
|
|
int virDomainObjListLoadAllConfigs(virDomainObjListPtr doms,
|
|
|
|
virCapsPtr caps,
|
|
|
|
const char *configDir,
|
|
|
|
const char *autostartDir,
|
|
|
|
int liveStatus,
|
|
|
|
unsigned int expectedVirtTypes,
|
|
|
|
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);
|
2012-05-29 18:46:38 +00:00
|
|
|
int virDomainFSIndexByName(virDomainDefPtr def, const char *name);
|
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
|
|
|
|
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);
|
|
|
|
|
2013-01-11 13:54:15 +00:00
|
|
|
typedef int (*virDomainObjListIterator)(virDomainObjPtr dom,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainObjListForEach(virDomainObjListPtr doms,
|
|
|
|
virDomainObjListIterator callback,
|
|
|
|
void *opaque);
|
|
|
|
|
2011-01-10 16:41:33 +00:00
|
|
|
typedef int (*virDomainSmartcardDefIterator)(virDomainDefPtr def,
|
|
|
|
virDomainSmartcardDefPtr dev,
|
|
|
|
void *opaque);
|
|
|
|
|
|
|
|
int virDomainSmartcardDefForeach(virDomainDefPtr def,
|
|
|
|
bool abortOnError,
|
|
|
|
virDomainSmartcardDefIterator iter,
|
|
|
|
void *opaque);
|
|
|
|
|
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);
|
|
|
|
|
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 ignoreOpenFailure,
|
|
|
|
virDomainDiskDefPathIterator iter,
|
|
|
|
void *opaque);
|
|
|
|
|
2011-05-04 09:07:01 +00:00
|
|
|
void
|
|
|
|
virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
virDomainState
|
|
|
|
virDomainObjGetState(virDomainObjPtr obj, int *reason)
|
|
|
|
ATTRIBUTE_NONNULL(1);
|
|
|
|
|
2012-08-15 22:10:36 +00:00
|
|
|
virSecurityLabelDefPtr
|
|
|
|
virDomainDefGetSecurityLabelDef(virDomainDefPtr def, const char *model);
|
|
|
|
|
|
|
|
virSecurityDeviceLabelDefPtr
|
|
|
|
virDomainDiskDefGetSecurityLabelDef(virDomainDiskDefPtr def, const char *model);
|
|
|
|
|
2012-09-20 13:16:17 +00:00
|
|
|
virSecurityDeviceLabelDefPtr
|
|
|
|
virDomainChrDefGetSecurityLabelDef(virDomainChrDefPtr def, const char *model);
|
|
|
|
|
2012-08-15 22:10:36 +00:00
|
|
|
virSecurityLabelDefPtr
|
|
|
|
virDomainDefAddSecurityLabelDef(virDomainDefPtr def, const char *model);
|
|
|
|
|
2013-01-18 14:34:13 +00:00
|
|
|
virSecurityDeviceLabelDefPtr
|
|
|
|
virDomainDiskDefAddSecurityLabelDef(virDomainDiskDefPtr def, const char *model);
|
|
|
|
|
2012-09-06 19:56:49 +00:00
|
|
|
typedef const char* (*virEventActionToStringFunc)(int type);
|
|
|
|
typedef int (*virEventActionFromStringFunc)(const char *type);
|
2010-08-12 17:15:44 +00:00
|
|
|
|
2011-05-04 10:40:59 +00:00
|
|
|
VIR_ENUM_DECL(virDomainTaint)
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainVirt)
|
|
|
|
VIR_ENUM_DECL(virDomainBoot)
|
2012-09-18 09:38:18 +00:00
|
|
|
VIR_ENUM_DECL(virDomainBootMenu)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFeature)
|
2012-10-16 14:28:22 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFeatureState)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainLifecycle)
|
2010-08-12 17:15:44 +00:00
|
|
|
VIR_ENUM_DECL(virDomainLifecycleCrash)
|
2012-08-02 10:12:50 +00:00
|
|
|
VIR_ENUM_DECL(virDomainPMState)
|
2009-03-02 17:39:43 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDevice)
|
2009-11-30 18:35:58 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDeviceAddress)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDisk)
|
|
|
|
VIR_ENUM_DECL(virDomainDiskDevice)
|
2012-08-20 13:58:50 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskGeometryTrans)
|
2008-07-11 16:23:36 +00:00
|
|
|
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)
|
2010-12-06 07:24:09 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskProtocol)
|
2012-11-22 18:10:38 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskProtocolTransport)
|
2010-04-21 14:28:21 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskIo)
|
2011-10-28 18:29:39 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskSecretType)
|
2013-01-02 14:37:09 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskSGIO)
|
2012-03-23 14:21:09 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskTray)
|
2011-06-20 08:26:47 +00:00
|
|
|
VIR_ENUM_DECL(virDomainIoEventFd)
|
2011-08-13 06:32:45 +00:00
|
|
|
VIR_ENUM_DECL(virDomainVirtioEventIdx)
|
2012-01-12 09:31:14 +00:00
|
|
|
VIR_ENUM_DECL(virDomainDiskCopyOnRead)
|
2009-12-02 19:15:38 +00:00
|
|
|
VIR_ENUM_DECL(virDomainController)
|
2011-09-02 13:06:15 +00:00
|
|
|
VIR_ENUM_DECL(virDomainControllerModelSCSI)
|
2011-09-02 13:14:29 +00:00
|
|
|
VIR_ENUM_DECL(virDomainControllerModelUSB)
|
2008-08-01 13:31:37 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFS)
|
2011-10-11 11:30:40 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFSDriverType)
|
2010-10-14 13:08:24 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFSAccessMode)
|
2012-01-17 12:44:18 +00:00
|
|
|
VIR_ENUM_DECL(virDomainFSWrpolicy)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNet)
|
2011-01-12 04:18:49 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetBackend)
|
Add txmode attribute to interface XML for virtio backend
This is in response to:
https://bugzilla.redhat.com/show_bug.cgi?id=629662
Explanation
qemu's virtio-net-pci driver allows setting the algorithm used for tx
packets to either "bh" or "timer". This is done by adding ",tx=bh" or
",tx=timer" to the "-device virtio-net-pci" commandline option.
'bh' stands for 'bottom half'; when this is set, packet tx is all done
in an iothread in the bottom half of the driver. (In libvirt, this
option is called the more descriptive "iothread".)
'timer' means that tx work is done in qemu, and if there is more tx
data than can be sent at the present time, a timer is set before qemu
moves on to do other things; when the timer fires, another attempt is
made to send more data. (libvirt retains the name "timer" for this
option.)
The resulting difference, according to the qemu developer who added
the option is:
bh makes tx more asynchronous and reduces latency, but potentially
causes more processor bandwidth contention since the cpu doing the
tx isn't necessarily the cpu where the guest generated the
packets.
Solution
This patch provides a libvirt domain xml knob to change the option on
the qemu commandline, by adding a new attribute "txmode" to the
<driver> element that can be placed inside any <interface> element in
a domain definition. It's use would be something like this:
<interface ...>
...
<model type='virtio'/>
<driver txmode='iothread'/>
...
</interface>
I chose to put this setting as an attribute to <driver> rather than as
a sub-element to <tune> because it is specific to the virtio-net
driver, not something that is generally usable by all network drivers.
(note that this is the same placement as the "driver name=..."
attribute used to choose kernel vs. userland backend for the
virtio-net driver.)
Actually adding the tx=xxx option to the qemu commandline is only done
if the version of qemu being used advertises it in the output of
qemu -device virtio-net-pci,?
If a particular txmode is requested in the XML, and the option isn't
listed in that help output, an UNSUPPORTED_CONFIG error is logged, and
the domain fails to start.
2011-02-03 20:20:01 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetVirtioTxMode)
|
2011-09-06 08:08:15 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNetInterfaceLinkState)
|
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)
|
2013-01-05 05:25:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrSerialTarget)
|
2011-01-10 16:41:33 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSmartcard)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChr)
|
2010-09-29 21:04:19 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrTcpProtocol)
|
2011-02-04 02:23:31 +00:00
|
|
|
VIR_ENUM_DECL(virDomainChrSpicevmc)
|
2012-05-15 22:55:09 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSoundCodec)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSoundModel)
|
2012-08-15 07:51:58 +00:00
|
|
|
VIR_ENUM_DECL(virDomainMemDump)
|
2010-07-15 13:02:42 +00:00
|
|
|
VIR_ENUM_DECL(virDomainMemballoonModel)
|
2010-11-05 13:10:34 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSmbiosMode)
|
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)
|
2012-11-23 13:50:29 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHostdevCaps)
|
2011-09-20 17:31:52 +00:00
|
|
|
VIR_ENUM_DECL(virDomainPciRombarMode)
|
2011-09-02 14:20:40 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHub)
|
2011-09-02 15:09:14 +00:00
|
|
|
VIR_ENUM_DECL(virDomainRedirdevBus)
|
2008-07-11 16:23:36 +00:00
|
|
|
VIR_ENUM_DECL(virDomainInput)
|
|
|
|
VIR_ENUM_DECL(virDomainInputBus)
|
|
|
|
VIR_ENUM_DECL(virDomainGraphics)
|
conf: add <listen> subelement to domain <graphics> element
Once it's plugged in, the <listen> element will be an optional
replacement for the "listen" attribute that graphics elements already
have. If the <listen> element is type='address', it will have an
attribute called 'address' which will contain an IP address or dns
name that the guest's display server should listen on. If, however,
type='network', the <listen> element should have an attribute called
'network' that will be set to the name of a network configuration to
get the IP address from.
* docs/schemas/domain.rng: updated to allow the <listen> element
* docs/formatdomain.html.in: document the <listen> element and its
attributes.
* src/conf/domain_conf.[hc]:
1) The domain parser, formatter, and data structure are modified to
support 0 or more <listen> subelements to each <graphics>
element. The old style "legacy" listen attribute is also still
accepted, and will be stored internally just as if it were a
separate <listen> element. On output (i.e. format), the address
attribute of the first <listen> element of type 'address' will be
duplicated in the legacy "listen" attribute of the <graphic>
element.
2) The "listenAddr" attribute has been removed from the unions in
virDomainGRaphicsDef for graphics types vnc, rdp, and spice.
This attribute is now in the <listen> subelement (aka
virDomainGraphicsListenDef)
3) Helper functions were written to provide simple access
(both Get and Set) to the listen elements and their attributes.
* src/libvirt_private.syms: export the listen helper functions
* src/qemu/qemu_command.c, src/qemu/qemu_hotplug.c,
src/qemu/qemu_migration.c, src/vbox/vbox_tmpl.c,
src/vmx/vmx.c, src/xenxs/xen_sxpr.c, src/xenxs/xen_xm.c
Modify all these files to use the listen helper functions rather
than directly referencing the (now missing) listenAddr
attribute. There can be multiple <listen> elements to a single
<graphics>, but the drivers all currently only support one, so all
replacements of direct access with a helper function indicate index
"0".
* tests/* - only 3 of these are new files added explicitly to test the
new <listen> element. All the others have been modified to reflect
the fact that any legacy "listen" attributes passed in to the domain
parse will be saved in a <listen> element (i.e. one of the
virDomainGraphicsListenDefs), and during the domain format function,
both the <listen> element as well as the legacy attributes will be
output.
2011-07-07 04:20:28 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphicsListen)
|
2011-05-26 14:15:54 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphicsAuthConnected)
|
2010-04-09 16:56:00 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceChannelName)
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceChannelMode)
|
2011-04-14 08:44:20 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceImageCompression)
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceJpegCompression)
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceZlibCompression)
|
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpicePlaybackCompression)
|
2011-05-23 15:16:42 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceStreamingMode)
|
2011-06-14 11:35:48 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceClipboardCopypaste)
|
2012-03-09 07:26:24 +00:00
|
|
|
VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode)
|
2011-06-20 07:15:44 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNumatuneMemMode)
|
numad: Set memory policy from numad advisory nodeset
Though numad will manage the memory allocation of task dynamically,
it wants management application (libvirt) to pre-set the memory
policy according to the advisory nodeset returned from querying numad,
(just like pre-bind CPU nodeset for domain process), and thus the
performance could benefit much more from it.
This patch introduces new XML tag 'placement', value 'auto' indicates
whether to set the memory policy with the advisory nodeset from numad,
and its value defaults to the value of <vcpu> placement, or 'static'
if 'nodeset' is specified. Example of the new XML tag's usage:
<numatune>
<memory placement='auto' mode='interleave'/>
</numatune>
Just like what current "numatune" does, the 'auto' numa memory policy
setting uses libnuma's API too.
If <vcpu> "placement" is "auto", and <numatune> is not specified
explicitly, a default <numatume> will be added with "placement"
set as "auto", and "mode" set as "strict".
The following XML can now fully drive numad:
1) <vcpu> placement is 'auto', no <numatune> is specified.
<vcpu placement='auto'>10</vcpu>
2) <vcpu> placement is 'auto', no 'placement' is specified for
<numatune>.
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='interleave'/>
</numatune>
And it's also able to control the CPU placement and memory policy
independently. e.g.
1) <vcpu> placement is 'auto', and <numatune> placement is 'static'
<vcpu placement='auto'>10</vcpu>
<numatune>
<memory mode='strict' nodeset='0-10,^7'/>
</numatune>
2) <vcpu> placement is 'static', and <numatune> placement is 'auto'
<vcpu placement='static' cpuset='0-24,^12'>10</vcpu>
<numatune>
<memory mode='interleave' placement='auto'/>
</numatume>
A follow up patch will change the XML formatting codes to always output
'placement' for <vcpu>, even it's 'static'.
2012-05-08 16:04:34 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNumatuneMemPlacementMode)
|
2012-10-16 16:25:56 +00:00
|
|
|
VIR_ENUM_DECL(virDomainHyperv)
|
2013-01-11 16:34:37 +00:00
|
|
|
VIR_ENUM_DECL(virDomainRNGModel)
|
|
|
|
VIR_ENUM_DECL(virDomainRNGBackend)
|
2009-01-19 21:06:26 +00:00
|
|
|
/* from libvirt.h */
|
|
|
|
VIR_ENUM_DECL(virDomainState)
|
2011-05-04 09:07:01 +00:00
|
|
|
VIR_ENUM_DECL(virDomainNostateReason)
|
|
|
|
VIR_ENUM_DECL(virDomainRunningReason)
|
|
|
|
VIR_ENUM_DECL(virDomainBlockedReason)
|
|
|
|
VIR_ENUM_DECL(virDomainPausedReason)
|
|
|
|
VIR_ENUM_DECL(virDomainShutdownReason)
|
|
|
|
VIR_ENUM_DECL(virDomainShutoffReason)
|
|
|
|
VIR_ENUM_DECL(virDomainCrashedReason)
|
conf: avoid NULL deref for pmsuspended domain state
While working with a pmsuspend vs. snapshot issue, I noticed that
the state file in /var/run/libvirt/qemu/dom.xml contained a rather
suspicious "(null)" string, which does not round-trip well through
a libvirtd restart. Had I been on a platform other than glibc
where printf("%s",NULL) crashes instead of printing (null), we might
have noticed the problem much sooner.
And in fixing that problem, I also noticed that we had several
missing states, because we were #defining several *_LAST names
to a value _different_ than what they were already given as enums
in libvirt.h. Yuck. I got rid of default: labels in the case
statements, because they get in the way of gcc's -Wswitch helping
us ensure we cover all enum values.
* src/conf/domain_conf.c (virDomainStateReasonToString)
(virDomainStateReasonFromString): Fill in missing domain states;
rewrite case statement to let compiler enforce checking.
(VIR_DOMAIN_NOSTATE_LAST, VIR_DOMAIN_RUNNING_LAST)
(VIR_DOMAIN_BLOCKED_LAST, VIR_DOMAIN_PAUSED_LAST)
(VIR_DOMAIN_SHUTDOWN_LAST, VIR_DOMAIN_SHUTOFF_LAST)
(VIR_DOMAIN_CRASHED_LAST): Drop dead defines.
(VIR_DOMAIN_PMSUSPENDED_LAST): Drop dead define.
(virDomainPMSuspendedReason): Add missing enum function.
(virDomainRunningReason, virDomainPausedReason): Add missing enum
value.
* src/conf/domain_conf.h (virDomainPMSuspendedReason): Declare
missing functions.
* src/libvirt_private.syms (domain_conf.h): Export them.
2013-01-24 00:06:06 +00:00
|
|
|
VIR_ENUM_DECL(virDomainPMSuspendedReason)
|
2011-05-04 09:07:01 +00:00
|
|
|
|
|
|
|
const char *virDomainStateReasonToString(virDomainState state, int reason);
|
|
|
|
int virDomainStateReasonFromString(virDomainState state, const char *reason);
|
|
|
|
|
2009-03-03 16:53:13 +00:00
|
|
|
VIR_ENUM_DECL(virDomainSeclabel)
|
2010-02-02 17:22:03 +00:00
|
|
|
VIR_ENUM_DECL(virDomainClockOffset)
|
2012-02-06 13:59:16 +00:00
|
|
|
VIR_ENUM_DECL(virDomainClockBasis)
|
2008-07-11 16:23:36 +00:00
|
|
|
|
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)
|
2012-03-08 13:36:26 +00:00
|
|
|
VIR_ENUM_DECL(virDomainCpuPlacementMode)
|
2010-03-30 11:44:22 +00:00
|
|
|
|
2011-10-17 14:54:03 +00:00
|
|
|
VIR_ENUM_DECL(virDomainStartupPolicy)
|
2011-12-29 10:27:35 +00:00
|
|
|
|
2012-08-03 15:48:05 +00:00
|
|
|
# define VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE \
|
|
|
|
(VIR_CONNECT_LIST_DOMAINS_ACTIVE | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_INACTIVE)
|
|
|
|
|
|
|
|
# define VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT \
|
|
|
|
(VIR_CONNECT_LIST_DOMAINS_PERSISTENT | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_TRANSIENT)
|
|
|
|
|
|
|
|
# define VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE \
|
|
|
|
(VIR_CONNECT_LIST_DOMAINS_RUNNING | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_PAUSED | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_SHUTOFF | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_OTHER)
|
|
|
|
|
|
|
|
# define VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE \
|
|
|
|
(VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE)
|
|
|
|
|
|
|
|
# define VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART \
|
|
|
|
(VIR_CONNECT_LIST_DOMAINS_AUTOSTART | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART)
|
|
|
|
|
|
|
|
# define VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT \
|
|
|
|
(VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT)
|
|
|
|
|
|
|
|
# define VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL \
|
|
|
|
(VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_FILTERS_MANAGEDSAVE | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_FILTERS_AUTOSTART | \
|
|
|
|
VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT)
|
|
|
|
|
2013-01-11 16:04:47 +00:00
|
|
|
int virDomainObjListExport(virDomainObjListPtr doms,
|
|
|
|
virConnectPtr conn,
|
|
|
|
virDomainPtr **domains,
|
|
|
|
unsigned int flags);
|
2012-08-03 15:48:05 +00:00
|
|
|
|
2012-10-12 09:50:47 +00:00
|
|
|
virDomainVcpuPinDefPtr virDomainLookupVcpuPin(virDomainDefPtr def,
|
|
|
|
int vcpuid);
|
|
|
|
|
2008-07-11 16:23:36 +00:00
|
|
|
#endif /* __DOMAIN_CONF_H */
|