# Module libvirt-domain from libvirt

Provides APIs for the management of domains

## Table of Contents

### Macros

    #define VIR_COPY_CPUMAP
    #define VIR_CPU_MAPLEN
    #define VIR_CPU_USABLE
    #define VIR_CPU_USED
    #define VIR_DOMAIN_BANDWIDTH_IN_AVERAGE
    #define VIR_DOMAIN_BANDWIDTH_IN_BURST
    #define VIR_DOMAIN_BANDWIDTH_IN_FLOOR
    #define VIR_DOMAIN_BANDWIDTH_IN_PEAK
    #define VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE
    #define VIR_DOMAIN_BANDWIDTH_OUT_BURST
    #define VIR_DOMAIN_BANDWIDTH_OUT_PEAK
    #define VIR_DOMAIN_BLKIO_DEVICE_READ_BPS
    #define VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS
    #define VIR_DOMAIN_BLKIO_DEVICE_WEIGHT
    #define VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS
    #define VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS
    #define VIR_DOMAIN_BLKIO_FIELD_LENGTH
    #define VIR_DOMAIN_BLKIO_WEIGHT
    #define VIR_DOMAIN_BLOCK_COPY_BANDWIDTH
    #define VIR_DOMAIN_BLOCK_COPY_BUF_SIZE
    #define VIR_DOMAIN_BLOCK_COPY_GRANULARITY
    #define VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME
    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC
    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX
    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH
    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC
    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX
    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH
    #define VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC
    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC
    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX
    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH
    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC
    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX
    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH
    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC
    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX
    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH
    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC
    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX
    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH
    #define VIR_DOMAIN_BLOCK_STATS_ERRS
    #define VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH
    #define VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ
    #define VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES
    #define VIR_DOMAIN_BLOCK_STATS_READ_BYTES
    #define VIR_DOMAIN_BLOCK_STATS_READ_REQ
    #define VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES
    #define VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES
    #define VIR_DOMAIN_BLOCK_STATS_WRITE_REQ
    #define VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES
    #define VIR_DOMAIN_CPU_STATS_CPUTIME
    #define VIR_DOMAIN_CPU_STATS_SYSTEMTIME
    #define VIR_DOMAIN_CPU_STATS_USERTIME
    #define VIR_DOMAIN_CPU_STATS_VCPUTIME
    #define VIR_DOMAIN_EVENT_CALLBACK
    #define VIR_DOMAIN_IOTHREAD_POLL_GROW
    #define VIR_DOMAIN_IOTHREAD_POLL_MAX_NS
    #define VIR_DOMAIN_IOTHREAD_POLL_SHRINK
    #define VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX
    #define VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN
    #define VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE
    #define VIR_DOMAIN_JOB_COMPRESSION_BYTES
    #define VIR_DOMAIN_JOB_COMPRESSION_CACHE
    #define VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES
    #define VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW
    #define VIR_DOMAIN_JOB_COMPRESSION_PAGES
    #define VIR_DOMAIN_JOB_DATA_PROCESSED
    #define VIR_DOMAIN_JOB_DATA_REMAINING
    #define VIR_DOMAIN_JOB_DATA_TOTAL
    #define VIR_DOMAIN_JOB_DISK_BPS
    #define VIR_DOMAIN_JOB_DISK_PROCESSED
    #define VIR_DOMAIN_JOB_DISK_REMAINING
    #define VIR_DOMAIN_JOB_DISK_TEMP_TOTAL
    #define VIR_DOMAIN_JOB_DISK_TEMP_USED
    #define VIR_DOMAIN_JOB_DISK_TOTAL
    #define VIR_DOMAIN_JOB_DOWNTIME
    #define VIR_DOMAIN_JOB_DOWNTIME_NET
    #define VIR_DOMAIN_JOB_ERRMSG
    #define VIR_DOMAIN_JOB_MEMORY_BPS
    #define VIR_DOMAIN_JOB_MEMORY_CONSTANT
    #define VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE
    #define VIR_DOMAIN_JOB_MEMORY_ITERATION
    #define VIR_DOMAIN_JOB_MEMORY_NORMAL
    #define VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES
    #define VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE
    #define VIR_DOMAIN_JOB_MEMORY_POSTCOPY_REQS
    #define VIR_DOMAIN_JOB_MEMORY_PROCESSED
    #define VIR_DOMAIN_JOB_MEMORY_REMAINING
    #define VIR_DOMAIN_JOB_MEMORY_TOTAL
    #define VIR_DOMAIN_JOB_OPERATION
    #define VIR_DOMAIN_JOB_SETUP_TIME
    #define VIR_DOMAIN_JOB_SUCCESS
    #define VIR_DOMAIN_JOB_TIME_ELAPSED
    #define VIR_DOMAIN_JOB_TIME_ELAPSED_NET
    #define VIR_DOMAIN_JOB_TIME_REMAINING
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MAJOR
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MINOR
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_BUILD_ID
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_POLICY
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_HEADER
    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS
    #define VIR_DOMAIN_MEMORY_FIELD_LENGTH
    #define VIR_DOMAIN_MEMORY_HARD_LIMIT
    #define VIR_DOMAIN_MEMORY_MIN_GUARANTEE
    #define VIR_DOMAIN_MEMORY_PARAM_UNLIMITED
    #define VIR_DOMAIN_MEMORY_SOFT_LIMIT
    #define VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT
    #define VIR_DOMAIN_NUMA_MODE
    #define VIR_DOMAIN_NUMA_NODESET
    #define VIR_DOMAIN_SAVE_PARAM_DXML
    #define VIR_DOMAIN_SAVE_PARAM_FILE
    #define VIR_DOMAIN_SCHEDULER_CAP
    #define VIR_DOMAIN_SCHEDULER_CPU_SHARES
    #define VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD
    #define VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA
    #define VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD
    #define VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA
    #define VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD
    #define VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA
    #define VIR_DOMAIN_SCHEDULER_LIMIT
    #define VIR_DOMAIN_SCHEDULER_RESERVATION
    #define VIR_DOMAIN_SCHEDULER_SHARES
    #define VIR_DOMAIN_SCHEDULER_VCPU_PERIOD
    #define VIR_DOMAIN_SCHEDULER_VCPU_QUOTA
    #define VIR_DOMAIN_SCHEDULER_WEIGHT
    #define VIR_DOMAIN_SCHED_FIELD_LENGTH
    #define VIR_DOMAIN_SEND_KEY_MAX_KEYS
    #define VIR_DOMAIN_TUNABLE_BLKDEV_DISK
    #define VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME
    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC
    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX
    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH
    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC
    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX
    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH
    #define VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC
    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC
    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX
    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH
    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC
    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX
    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH
    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC
    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX
    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH
    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC
    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX
    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH
    #define VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES
    #define VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN
    #define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD
    #define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA
    #define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD
    #define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA
    #define VIR_DOMAIN_TUNABLE_CPU_IOTHREADSPIN
    #define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD
    #define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA
    #define VIR_DOMAIN_TUNABLE_CPU_VCPUPIN
    #define VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD
    #define VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA
    #define VIR_GET_CPUMAP
    #define VIR_KEYCODE_SET_RFB
    #define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT
    #define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL
    #define VIR_MIGRATE_PARAM_BANDWIDTH
    #define VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY
    #define VIR_MIGRATE_PARAM_COMPRESSION
    #define VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS
    #define VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL
    #define VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS
    #define VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE
    #define VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL
    #define VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL
    #define VIR_MIGRATE_PARAM_DEST_NAME
    #define VIR_MIGRATE_PARAM_DEST_XML
    #define VIR_MIGRATE_PARAM_DISKS_PORT
    #define VIR_MIGRATE_PARAM_DISKS_URI
    #define VIR_MIGRATE_PARAM_GRAPHICS_URI
    #define VIR_MIGRATE_PARAM_LISTEN_ADDRESS
    #define VIR_MIGRATE_PARAM_MIGRATE_DISKS
    #define VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS
    #define VIR_MIGRATE_PARAM_PERSIST_XML
    #define VIR_MIGRATE_PARAM_TLS_DESTINATION
    #define VIR_MIGRATE_PARAM_URI
    #define VIR_PERF_PARAM_ALIGNMENT_FAULTS
    #define VIR_PERF_PARAM_BRANCH_INSTRUCTIONS
    #define VIR_PERF_PARAM_BRANCH_MISSES
    #define VIR_PERF_PARAM_BUS_CYCLES
    #define VIR_PERF_PARAM_CACHE_MISSES
    #define VIR_PERF_PARAM_CACHE_REFERENCES
    #define VIR_PERF_PARAM_CMT
    #define VIR_PERF_PARAM_CONTEXT_SWITCHES
    #define VIR_PERF_PARAM_CPU_CLOCK
    #define VIR_PERF_PARAM_CPU_CYCLES
    #define VIR_PERF_PARAM_CPU_MIGRATIONS
    #define VIR_PERF_PARAM_EMULATION_FAULTS
    #define VIR_PERF_PARAM_INSTRUCTIONS
    #define VIR_PERF_PARAM_MBML
    #define VIR_PERF_PARAM_MBMT
    #define VIR_PERF_PARAM_PAGE_FAULTS
    #define VIR_PERF_PARAM_PAGE_FAULTS_MAJ
    #define VIR_PERF_PARAM_PAGE_FAULTS_MIN
    #define VIR_PERF_PARAM_REF_CPU_CYCLES
    #define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND
    #define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND
    #define VIR_PERF_PARAM_TASK_CLOCK
    #define VIR_UNUSE_CPU
    #define VIR_USE_CPU
    #define _virBlkioParameter
    #define _virMemoryParameter
    #define _virSchedParameter

### Types

    typedef struct _virTypedParameter virBlkioParameter
    typedef virBlkioParameter * virBlkioParameterPtr
    typedef enum virBlkioParameterType
    typedef enum virConnectDomainEventAgentLifecycleReason
    typedef enum virConnectDomainEventAgentLifecycleState
    typedef enum virConnectDomainEventBlockJobStatus
    typedef enum virConnectDomainEventDiskChangeReason
    typedef enum virConnectGetAllDomainStatsFlags
    typedef enum virConnectListAllDomainsFlags
    typedef struct _virDomain virDomain
    typedef enum virDomainAbortJobFlagsValues
    typedef enum virDomainAgentResponseTimeoutValues
    typedef enum virDomainAuthorizedSSHKeysSetFlags
    typedef enum virDomainBackupBeginFlags
    typedef enum virDomainBlockCommitFlags
    typedef enum virDomainBlockCopyFlags
    typedef struct _virDomainBlockInfo virDomainBlockInfo
    typedef virDomainBlockInfo * virDomainBlockInfoPtr
    typedef enum virDomainBlockJobAbortFlags
    typedef unsigned long long virDomainBlockJobCursor
    typedef struct _virDomainBlockJobInfo virDomainBlockJobInfo
    typedef enum virDomainBlockJobInfoFlags
    typedef virDomainBlockJobInfo * virDomainBlockJobInfoPtr
    typedef enum virDomainBlockJobSetSpeedFlags
    typedef enum virDomainBlockJobType
    typedef enum virDomainBlockPullFlags
    typedef enum virDomainBlockRebaseFlags
    typedef enum virDomainBlockResizeFlags
    typedef virDomainBlockStatsStruct * virDomainBlockStatsPtr
    typedef struct _virDomainBlockStats virDomainBlockStatsStruct
    typedef enum virDomainBlockedReason
    typedef enum virDomainChannelFlags
    typedef enum virDomainConsoleFlags
    typedef enum virDomainControlErrorReason
    typedef struct _virDomainControlInfo virDomainControlInfo
    typedef virDomainControlInfo * virDomainControlInfoPtr
    typedef enum virDomainControlState
    typedef enum virDomainCoreDumpFlags
    typedef enum virDomainCoreDumpFormat
    typedef enum virDomainCrashedReason
    typedef enum virDomainCreateFlags
    typedef enum virDomainDefineFlags
    typedef enum virDomainDestroyFlagsValues
    typedef enum virDomainDeviceModifyFlags
    typedef enum virDomainDirtyRateCalcFlags
    typedef enum virDomainDirtyRateStatus
    typedef struct _virDomainDiskError virDomainDiskError
    typedef enum virDomainDiskErrorCode
    typedef virDomainDiskError * virDomainDiskErrorPtr
    typedef enum virDomainEventCrashedDetailType
    typedef enum virDomainEventDefinedDetailType
    typedef struct _virDomainEventGraphicsAddress virDomainEventGraphicsAddress
    typedef virDomainEventGraphicsAddress * virDomainEventGraphicsAddressPtr
    typedef enum virDomainEventGraphicsAddressType
    typedef enum virDomainEventGraphicsPhase
    typedef struct _virDomainEventGraphicsSubject virDomainEventGraphicsSubject
    typedef struct _virDomainEventGraphicsSubjectIdentity virDomainEventGraphicsSubjectIdentity
    typedef virDomainEventGraphicsSubjectIdentity * virDomainEventGraphicsSubjectIdentityPtr
    typedef virDomainEventGraphicsSubject * virDomainEventGraphicsSubjectPtr
    typedef enum virDomainEventID
    typedef enum virDomainEventIOErrorAction
    typedef enum virDomainEventPMSuspendedDetailType
    typedef enum virDomainEventResumedDetailType
    typedef enum virDomainEventShutdownDetailType
    typedef enum virDomainEventStartedDetailType
    typedef enum virDomainEventStoppedDetailType
    typedef enum virDomainEventSuspendedDetailType
    typedef enum virDomainEventTrayChangeReason
    typedef enum virDomainEventType
    typedef enum virDomainEventUndefinedDetailType
    typedef enum virDomainEventWatchdogAction
    typedef enum virDomainFDAssociateFlags
    typedef struct _virDomainFSInfo virDomainFSInfo
    typedef virDomainFSInfo * virDomainFSInfoPtr
    typedef enum virDomainGetHostnameFlags
    typedef enum virDomainGetJobStatsFlags
    typedef enum virDomainGuestInfoTypes
    typedef struct _virDomainIOThreadInfo virDomainIOThreadInfo
    typedef virDomainIOThreadInfo * virDomainIOThreadInfoPtr
    typedef struct _virDomainInterfaceIPAddress virDomainIPAddress
    typedef virDomainIPAddress * virDomainIPAddressPtr
    typedef struct _virDomainInfo virDomainInfo
    typedef virDomainInfo * virDomainInfoPtr
    typedef struct _virDomainInterface virDomainInterface
    typedef enum virDomainInterfaceAddressesSource
    typedef virDomainInterface * virDomainInterfacePtr
    typedef virDomainInterfaceStatsStruct * virDomainInterfaceStatsPtr
    typedef struct _virDomainInterfaceStats virDomainInterfaceStatsStruct
    typedef struct _virDomainJobInfo virDomainJobInfo
    typedef virDomainJobInfo * virDomainJobInfoPtr
    typedef enum virDomainJobOperation
    typedef enum virDomainJobType
    typedef enum virDomainLifecycle
    typedef enum virDomainLifecycleAction
    typedef enum virDomainMemoryFailureActionType
    typedef enum virDomainMemoryFailureFlags
    typedef enum virDomainMemoryFailureRecipientType
    typedef enum virDomainMemoryFlags
    typedef enum virDomainMemoryModFlags
    typedef virDomainMemoryStatStruct * virDomainMemoryStatPtr
    typedef struct _virDomainMemoryStat virDomainMemoryStatStruct
    typedef enum virDomainMemoryStatTags
    typedef enum virDomainMessageType
    typedef enum virDomainMetadataType
    typedef enum virDomainMigrateFlags
    typedef enum virDomainMigrateMaxSpeedFlags
    typedef enum virDomainModificationImpact
    typedef enum virDomainNostateReason
    typedef enum virDomainNumatuneMemMode
    typedef enum virDomainOpenGraphicsFlags
    typedef enum virDomainPMSuspendedDiskReason
    typedef enum virDomainPMSuspendedReason
    typedef enum virDomainPausedReason
    typedef enum virDomainProcessSignal
    typedef virDomain * virDomainPtr
    typedef enum virDomainRebootFlagValues
    typedef enum virDomainRunningReason
    typedef enum virDomainSaveImageXMLFlags
    typedef enum virDomainSaveRestoreFlags
    typedef enum virDomainSetTimeFlags
    typedef enum virDomainSetUserPasswordFlags
    typedef enum virDomainShutdownFlagValues
    typedef enum virDomainShutdownReason
    typedef enum virDomainShutoffReason
    typedef enum virDomainState
    typedef struct _virDomainStatsRecord virDomainStatsRecord
    typedef virDomainStatsRecord * virDomainStatsRecordPtr
    typedef enum virDomainStatsTypes
    typedef enum virDomainUndefineFlagsValues
    typedef enum virDomainVcpuFlags
    typedef enum virDomainXMLFlags
    typedef enum virKeycodeSet
    typedef struct _virTypedParameter virMemoryParameter
    typedef virMemoryParameter * virMemoryParameterPtr
    typedef enum virMemoryParameterType
    typedef struct _virTypedParameter virSchedParameter
    typedef virSchedParameter * virSchedParameterPtr
    typedef enum virSchedParameterType
    typedef enum virVcpuHostCpuState
    typedef struct _virVcpuInfo virVcpuInfo
    typedef virVcpuInfo * virVcpuInfoPtr
    typedef enum virVcpuState

### Functions

    typedef virConnectDomainEventAgentLifecycleCallback
    void	virConnectDomainEventAgentLifecycleCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int state,
    							 int reason,
    							 void * opaque)

    typedef virConnectDomainEventBalloonChangeCallback
    void	virConnectDomainEventBalloonChangeCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 unsigned long long actual,
    							 void * opaque)

    typedef virConnectDomainEventBlockJobCallback
    void	virConnectDomainEventBlockJobCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * disk,
    						 int type,
    						 int status,
    						 void * opaque)

    typedef virConnectDomainEventBlockThresholdCallback
    void	virConnectDomainEventBlockThresholdCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * dev,
    							 const char * path,
    							 unsigned long long threshold,
    							 unsigned long long excess,
    							 void * opaque)

    typedef virConnectDomainEventCallback
    int	virConnectDomainEventCallback	(virConnectPtr conn,
    					 virDomainPtr dom,
    					 int event,
    					 int detail,
    					 void * opaque)

    int	virConnectDomainEventDeregister	(virConnectPtr conn,
    					 virConnectDomainEventCallback cb)
    int	virConnectDomainEventDeregisterAny	(virConnectPtr conn,
    						 int callbackID)
    typedef virConnectDomainEventDeviceAddedCallback
    void	virConnectDomainEventDeviceAddedCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * devAlias,
    							 void * opaque)

    typedef virConnectDomainEventDeviceRemovalFailedCallback
    void	virConnectDomainEventDeviceRemovalFailedCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * devAlias,
    							 void * opaque)

    typedef virConnectDomainEventDeviceRemovedCallback
    void	virConnectDomainEventDeviceRemovedCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * devAlias,
    							 void * opaque)

    typedef virConnectDomainEventDiskChangeCallback
    void	virConnectDomainEventDiskChangeCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * oldSrcPath,
    						 const char * newSrcPath,
    						 const char * devAlias,
    						 int reason,
    						 void * opaque)

    typedef virConnectDomainEventGenericCallback
    void	virConnectDomainEventGenericCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 void * opaque)

    typedef virConnectDomainEventGraphicsCallback
    void	virConnectDomainEventGraphicsCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int phase,
    						 const virDomainEventGraphicsAddress * local,
    						 const virDomainEventGraphicsAddress * remote,
    						 const char * authScheme,
    						 const virDomainEventGraphicsSubject * subject,
    						 void * opaque)

    typedef virConnectDomainEventIOErrorCallback
    void	virConnectDomainEventIOErrorCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * srcPath,
    						 const char * devAlias,
    						 int action,
    						 void * opaque)

    typedef virConnectDomainEventIOErrorReasonCallback
    void	virConnectDomainEventIOErrorReasonCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * srcPath,
    							 const char * devAlias,
    							 int action,
    							 const char * reason,
    							 void * opaque)

    typedef virConnectDomainEventJobCompletedCallback
    void	virConnectDomainEventJobCompletedCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 virTypedParameterPtr params,
    							 int nparams,
    							 void * opaque)

    typedef virConnectDomainEventMemoryDeviceSizeChangeCallback
    void	virConnectDomainEventMemoryDeviceSizeChangeCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * alias,
    							 unsigned long long size,
    							 void * opaque)

    typedef virConnectDomainEventMemoryFailureCallback
    void	virConnectDomainEventMemoryFailureCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int recipient,
    							 int action,
    							 unsigned int flags,
    							 void * opaque)

    typedef virConnectDomainEventMetadataChangeCallback
    void	virConnectDomainEventMetadataChangeCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int type,
    							 const char * nsuri,
    							 void * opaque)

    typedef virConnectDomainEventMigrationIterationCallback
    void	virConnectDomainEventMigrationIterationCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int iteration,
    							 void * opaque)

    typedef virConnectDomainEventPMSuspendCallback
    void	virConnectDomainEventPMSuspendCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int reason,
    						 void * opaque)

    typedef virConnectDomainEventPMSuspendDiskCallback
    void	virConnectDomainEventPMSuspendDiskCallback	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int reason,
    							 void * opaque)

    typedef virConnectDomainEventPMWakeupCallback
    void	virConnectDomainEventPMWakeupCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int reason,
    						 void * opaque)

    typedef virConnectDomainEventRTCChangeCallback
    void	virConnectDomainEventRTCChangeCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 long long utcoffset,
    						 void * opaque)

    int	virConnectDomainEventRegister	(virConnectPtr conn,
    					 virConnectDomainEventCallback cb,
    					 void * opaque,
    					 virFreeCallback freecb)
    int	virConnectDomainEventRegisterAny	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int eventID,
    						 virConnectDomainEventGenericCallback cb,
    						 void * opaque,
    						 virFreeCallback freecb)
    typedef virConnectDomainEventTrayChangeCallback
    void	virConnectDomainEventTrayChangeCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * devAlias,
    						 int reason,
    						 void * opaque)

    typedef virConnectDomainEventTunableCallback
    void	virConnectDomainEventTunableCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 virTypedParameterPtr params,
    						 int nparams,
    						 void * opaque)

    typedef virConnectDomainEventWatchdogCallback
    void	virConnectDomainEventWatchdogCallback	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int action,
    						 void * opaque)

    char *	virConnectDomainXMLFromNative	(virConnectPtr conn,
    					 const char * nativeFormat,
    					 const char * nativeConfig,
    					 unsigned int flags)
    char *	virConnectDomainXMLToNative	(virConnectPtr conn,
    					 const char * nativeFormat,
    					 const char * domainXml,
    					 unsigned int flags)
    int	virConnectGetAllDomainStats	(virConnectPtr conn,
    					 unsigned int stats,
    					 virDomainStatsRecordPtr ** retStats,
    					 unsigned int flags)
    char *	virConnectGetDomainCapabilities	(virConnectPtr conn,
    					 const char * emulatorbin,
    					 const char * arch,
    					 const char * machine,
    					 const char * virttype,
    					 unsigned int flags)
    int	virConnectListAllDomains	(virConnectPtr conn,
    					 virDomainPtr ** domains,
    					 unsigned int flags)
    int	virConnectListDefinedDomains	(virConnectPtr conn,
    					 char ** const names,
    					 int maxnames)
    int	virConnectListDomains		(virConnectPtr conn,
    					 int * ids,
    					 int maxids)
    int	virConnectNumOfDefinedDomains	(virConnectPtr conn)
    int	virConnectNumOfDomains		(virConnectPtr conn)
    int	virDomainAbortJob		(virDomainPtr domain)
    int	virDomainAbortJobFlags		(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainAddIOThread		(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 unsigned int flags)
    int	virDomainAgentSetResponseTimeout	(virDomainPtr domain,
    						 int timeout,
    						 unsigned int flags)
    int	virDomainAttachDevice		(virDomainPtr domain,
    					 const char * xml)
    int	virDomainAttachDeviceFlags	(virDomainPtr domain,
    					 const char * xml,
    					 unsigned int flags)
    int	virDomainAuthorizedSSHKeysGet	(virDomainPtr domain,
    					 const char * user,
    					 char *** keys,
    					 unsigned int flags)
    int	virDomainAuthorizedSSHKeysSet	(virDomainPtr domain,
    					 const char * user,
    					 const char ** keys,
    					 unsigned int nkeys,
    					 unsigned int flags)
    int	virDomainBackupBegin		(virDomainPtr domain,
    					 const char * backupXML,
    					 const char * checkpointXML,
    					 unsigned int flags)
    char *	virDomainBackupGetXMLDesc	(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainBlockCommit		(virDomainPtr dom,
    					 const char * disk,
    					 const char * base,
    					 const char * top,
    					 unsigned long bandwidth,
    					 unsigned int flags)
    int	virDomainBlockCopy		(virDomainPtr dom,
    					 const char * disk,
    					 const char * destxml,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainBlockJobAbort		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned int flags)
    int	virDomainBlockJobSetSpeed	(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long bandwidth,
    					 unsigned int flags)
    int	virDomainBlockPeek		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long long offset,
    					 size_t size,
    					 void * buffer,
    					 unsigned int flags)
    int	virDomainBlockPull		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long bandwidth,
    					 unsigned int flags)
    int	virDomainBlockRebase		(virDomainPtr dom,
    					 const char * disk,
    					 const char * base,
    					 unsigned long bandwidth,
    					 unsigned int flags)
    int	virDomainBlockResize		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long long size,
    					 unsigned int flags)
    int	virDomainBlockStats		(virDomainPtr dom,
    					 const char * disk,
    					 virDomainBlockStatsPtr stats,
    					 size_t size)
    int	virDomainBlockStatsFlags	(virDomainPtr dom,
    					 const char * disk,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainCoreDump		(virDomainPtr domain,
    					 const char * to,
    					 unsigned int flags)
    int	virDomainCoreDumpWithFormat	(virDomainPtr domain,
    					 const char * to,
    					 unsigned int dumpformat,
    					 unsigned int flags)
    int	virDomainCreate			(virDomainPtr domain)
    virDomainPtr	virDomainCreateLinux	(virConnectPtr conn,
    					 const char * xmlDesc,
    					 unsigned int flags)
    int	virDomainCreateWithFiles	(virDomainPtr domain,
    					 unsigned int nfiles,
    					 int * files,
    					 unsigned int flags)
    int	virDomainCreateWithFlags	(virDomainPtr domain,
    					 unsigned int flags)
    virDomainPtr	virDomainCreateXML	(virConnectPtr conn,
    					 const char * xmlDesc,
    					 unsigned int flags)
    virDomainPtr	virDomainCreateXMLWithFiles	(virConnectPtr conn,
    						 const char * xmlDesc,
    						 unsigned int nfiles,
    						 int * files,
    						 unsigned int flags)
    virDomainPtr	virDomainDefineXML	(virConnectPtr conn,
    					 const char * xml)
    virDomainPtr	virDomainDefineXMLFlags	(virConnectPtr conn,
    					 const char * xml,
    					 unsigned int flags)
    int	virDomainDelIOThread		(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 unsigned int flags)
    int	virDomainDestroy		(virDomainPtr domain)
    int	virDomainDestroyFlags		(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainDetachDevice		(virDomainPtr domain,
    					 const char * xml)
    int	virDomainDetachDeviceAlias	(virDomainPtr domain,
    					 const char * alias,
    					 unsigned int flags)
    int	virDomainDetachDeviceFlags	(virDomainPtr domain,
    					 const char * xml,
    					 unsigned int flags)
    int	virDomainFDAssociate		(virDomainPtr domain,
    					 const char * name,
    					 unsigned int nfds,
    					 int * fds,
    					 unsigned int flags)
    int	virDomainFSFreeze		(virDomainPtr dom,
    					 const char ** mountpoints,
    					 unsigned int nmountpoints,
    					 unsigned int flags)
    void	virDomainFSInfoFree		(virDomainFSInfoPtr info)
    int	virDomainFSThaw			(virDomainPtr dom,
    					 const char ** mountpoints,
    					 unsigned int nmountpoints,
    					 unsigned int flags)
    int	virDomainFSTrim			(virDomainPtr dom,
    					 const char * mountPoint,
    					 unsigned long long minimum,
    					 unsigned int flags)
    int	virDomainFree			(virDomainPtr domain)
    int	virDomainGetAutostart		(virDomainPtr domain,
    					 int * autostart)
    int	virDomainGetBlkioParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainGetBlockInfo		(virDomainPtr domain,
    					 const char * disk,
    					 virDomainBlockInfoPtr info,
    					 unsigned int flags)
    int	virDomainGetBlockIoTune		(virDomainPtr dom,
    					 const char * disk,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainGetBlockJobInfo	(virDomainPtr dom,
    					 const char * disk,
    					 virDomainBlockJobInfoPtr info,
    					 unsigned int flags)
    int	virDomainGetCPUStats		(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 unsigned int nparams,
    					 int start_cpu,
    					 unsigned int ncpus,
    					 unsigned int flags)
    virConnectPtr	virDomainGetConnect	(virDomainPtr dom)
    int	virDomainGetControlInfo		(virDomainPtr domain,
    					 virDomainControlInfoPtr info,
    					 unsigned int flags)
    int	virDomainGetDiskErrors		(virDomainPtr dom,
    					 virDomainDiskErrorPtr errors,
    					 unsigned int maxerrors,
    					 unsigned int flags)
    int	virDomainGetEmulatorPinInfo	(virDomainPtr domain,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)
    int	virDomainGetFSInfo		(virDomainPtr dom,
    					 virDomainFSInfoPtr ** info,
    					 unsigned int flags)
    int	virDomainGetGuestInfo		(virDomainPtr domain,
    					 unsigned int types,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainGetGuestVcpus		(virDomainPtr domain,
    					 virTypedParameterPtr * params,
    					 unsigned int * nparams,
    					 unsigned int flags)
    char *	virDomainGetHostname		(virDomainPtr domain,
    					 unsigned int flags)
    unsigned int	virDomainGetID		(virDomainPtr domain)
    int	virDomainGetIOThreadInfo	(virDomainPtr dom,
    					 virDomainIOThreadInfoPtr ** info,
    					 unsigned int flags)
    int	virDomainGetInfo		(virDomainPtr domain,
    					 virDomainInfoPtr info)
    int	virDomainGetInterfaceParameters	(virDomainPtr domain,
    					 const char * device,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainGetJobInfo		(virDomainPtr domain,
    					 virDomainJobInfoPtr info)
    int	virDomainGetJobStats		(virDomainPtr domain,
    					 int * type,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainGetLaunchSecurityInfo	(virDomainPtr domain,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)
    unsigned long	virDomainGetMaxMemory	(virDomainPtr domain)
    int	virDomainGetMaxVcpus		(virDomainPtr domain)
    int	virDomainGetMemoryParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainGetMessages		(virDomainPtr domain,
    					 char *** msgs,
    					 unsigned int flags)
    char *	virDomainGetMetadata		(virDomainPtr domain,
    					 int type,
    					 const char * uri,
    					 unsigned int flags)
    const char *	virDomainGetName	(virDomainPtr domain)
    int	virDomainGetNumaParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)
    char *	virDomainGetOSType		(virDomainPtr domain)
    int	virDomainGetPerfEvents		(virDomainPtr domain,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)
    int	virDomainGetSchedulerParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams)
    int	virDomainGetSchedulerParametersFlags	(virDomainPtr domain,
    						 virTypedParameterPtr params,
    						 int * nparams,
    						 unsigned int flags)
    char *	virDomainGetSchedulerType	(virDomainPtr domain,
    					 int * nparams)
    int	virDomainGetSecurityLabel	(virDomainPtr domain,
    					 virSecurityLabelPtr seclabel)
    int	virDomainGetSecurityLabelList	(virDomainPtr domain,
    					 virSecurityLabelPtr * seclabels)
    int	virDomainGetState		(virDomainPtr domain,
    					 int * state,
    					 int * reason,
    					 unsigned int flags)
    int	virDomainGetTime		(virDomainPtr dom,
    					 long long * seconds,
    					 unsigned int * nseconds,
    					 unsigned int flags)
    int	virDomainGetUUID		(virDomainPtr domain,
    					 unsigned char * uuid)
    int	virDomainGetUUIDString		(virDomainPtr domain,
    					 char * buf)
    int	virDomainGetVcpuPinInfo		(virDomainPtr domain,
    					 int ncpumaps,
    					 unsigned char * cpumaps,
    					 int maplen,
    					 unsigned int flags)
    int	virDomainGetVcpus		(virDomainPtr domain,
    					 virVcpuInfoPtr info,
    					 int maxinfo,
    					 unsigned char * cpumaps,
    					 int maplen)
    int	virDomainGetVcpusFlags		(virDomainPtr domain,
    					 unsigned int flags)
    char *	virDomainGetXMLDesc		(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainHasManagedSaveImage	(virDomainPtr dom,
    					 unsigned int flags)
    void	virDomainIOThreadInfoFree	(virDomainIOThreadInfoPtr info)
    int	virDomainInjectNMI		(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainInterfaceAddresses	(virDomainPtr dom,
    					 virDomainInterfacePtr ** ifaces,
    					 unsigned int source,
    					 unsigned int flags)
    void	virDomainInterfaceFree		(virDomainInterfacePtr iface)
    int	virDomainInterfaceStats		(virDomainPtr dom,
    					 const char * device,
    					 virDomainInterfaceStatsPtr stats,
    					 size_t size)
    int	virDomainIsActive		(virDomainPtr dom)
    int	virDomainIsPersistent		(virDomainPtr dom)
    int	virDomainIsUpdated		(virDomainPtr dom)
    int	virDomainListGetStats		(virDomainPtr * doms,
    					 unsigned int stats,
    					 virDomainStatsRecordPtr ** retStats,
    					 unsigned int flags)
    virDomainPtr	virDomainLookupByID	(virConnectPtr conn,
    					 int id)
    virDomainPtr	virDomainLookupByName	(virConnectPtr conn,
    					 const char * name)
    virDomainPtr	virDomainLookupByUUID	(virConnectPtr conn,
    					 const unsigned char * uuid)
    virDomainPtr	virDomainLookupByUUIDString	(virConnectPtr conn,
    						 const char * uuidstr)
    int	virDomainManagedSave		(virDomainPtr dom,
    					 unsigned int flags)
    int	virDomainManagedSaveDefineXML	(virDomainPtr domain,
    					 const char * dxml,
    					 unsigned int flags)
    char *	virDomainManagedSaveGetXMLDesc	(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainManagedSaveRemove	(virDomainPtr dom,
    					 unsigned int flags)
    int	virDomainMemoryPeek		(virDomainPtr dom,
    					 unsigned long long start,
    					 size_t size,
    					 void * buffer,
    					 unsigned int flags)
    int	virDomainMemoryStats		(virDomainPtr dom,
    					 virDomainMemoryStatPtr stats,
    					 unsigned int nr_stats,
    					 unsigned int flags)
    virDomainPtr	virDomainMigrate	(virDomainPtr domain,
    					 virConnectPtr dconn,
    					 unsigned long flags,
    					 const char * dname,
    					 const char * uri,
    					 unsigned long bandwidth)
    virDomainPtr	virDomainMigrate2	(virDomainPtr domain,
    					 virConnectPtr dconn,
    					 const char * dxml,
    					 unsigned long flags,
    					 const char * dname,
    					 const char * uri,
    					 unsigned long bandwidth)
    virDomainPtr	virDomainMigrate3	(virDomainPtr domain,
    					 virConnectPtr dconn,
    					 virTypedParameterPtr params,
    					 unsigned int nparams,
    					 unsigned int flags)
    int	virDomainMigrateGetCompressionCache	(virDomainPtr domain,
    						 unsigned long long * cacheSize,
    						 unsigned int flags)
    int	virDomainMigrateGetMaxDowntime	(virDomainPtr domain,
    					 unsigned long long * downtime,
    					 unsigned int flags)
    int	virDomainMigrateGetMaxSpeed	(virDomainPtr domain,
    					 unsigned long * bandwidth,
    					 unsigned int flags)
    int	virDomainMigrateSetCompressionCache	(virDomainPtr domain,
    						 unsigned long long cacheSize,
    						 unsigned int flags)
    int	virDomainMigrateSetMaxDowntime	(virDomainPtr domain,
    					 unsigned long long downtime,
    					 unsigned int flags)
    int	virDomainMigrateSetMaxSpeed	(virDomainPtr domain,
    					 unsigned long bandwidth,
    					 unsigned int flags)
    int	virDomainMigrateStartPostCopy	(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainMigrateToURI		(virDomainPtr domain,
    					 const char * duri,
    					 unsigned long flags,
    					 const char * dname,
    					 unsigned long bandwidth)
    int	virDomainMigrateToURI2		(virDomainPtr domain,
    					 const char * dconnuri,
    					 const char * miguri,
    					 const char * dxml,
    					 unsigned long flags,
    					 const char * dname,
    					 unsigned long bandwidth)
    int	virDomainMigrateToURI3		(virDomainPtr domain,
    					 const char * dconnuri,
    					 virTypedParameterPtr params,
    					 unsigned int nparams,
    					 unsigned int flags)
    int	virDomainOpenChannel		(virDomainPtr dom,
    					 const char * name,
    					 virStreamPtr st,
    					 unsigned int flags)
    int	virDomainOpenConsole		(virDomainPtr dom,
    					 const char * dev_name,
    					 virStreamPtr st,
    					 unsigned int flags)
    int	virDomainOpenGraphics		(virDomainPtr dom,
    					 unsigned int idx,
    					 int fd,
    					 unsigned int flags)
    int	virDomainOpenGraphicsFD		(virDomainPtr dom,
    					 unsigned int idx,
    					 unsigned int flags)
    int	virDomainPMSuspendForDuration	(virDomainPtr dom,
    					 unsigned int target,
    					 unsigned long long duration,
    					 unsigned int flags)
    int	virDomainPMWakeup		(virDomainPtr dom,
    					 unsigned int flags)
    int	virDomainPinEmulator		(virDomainPtr domain,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)
    int	virDomainPinIOThread		(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)
    int	virDomainPinVcpu		(virDomainPtr domain,
    					 unsigned int vcpu,
    					 unsigned char * cpumap,
    					 int maplen)
    int	virDomainPinVcpuFlags		(virDomainPtr domain,
    					 unsigned int vcpu,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)
    int	virDomainReboot			(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainRef			(virDomainPtr domain)
    int	virDomainRename			(virDomainPtr dom,
    					 const char * new_name,
    					 unsigned int flags)
    int	virDomainReset			(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainRestore		(virConnectPtr conn,
    					 const char * from)
    int	virDomainRestoreFlags		(virConnectPtr conn,
    					 const char * from,
    					 const char * dxml,
    					 unsigned int flags)
    int	virDomainRestoreParams		(virConnectPtr conn,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainResume			(virDomainPtr domain)
    int	virDomainSave			(virDomainPtr domain,
    					 const char * to)
    int	virDomainSaveFlags		(virDomainPtr domain,
    					 const char * to,
    					 const char * dxml,
    					 unsigned int flags)
    int	virDomainSaveImageDefineXML	(virConnectPtr conn,
    					 const char * file,
    					 const char * dxml,
    					 unsigned int flags)
    char *	virDomainSaveImageGetXMLDesc	(virConnectPtr conn,
    					 const char * file,
    					 unsigned int flags)
    int	virDomainSaveParams		(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    char *	virDomainScreenshot		(virDomainPtr domain,
    					 virStreamPtr stream,
    					 unsigned int screen,
    					 unsigned int flags)
    int	virDomainSendKey		(virDomainPtr domain,
    					 unsigned int codeset,
    					 unsigned int holdtime,
    					 unsigned int * keycodes,
    					 int nkeycodes,
    					 unsigned int flags)
    int	virDomainSendProcessSignal	(virDomainPtr domain,
    					 long long pid_value,
    					 unsigned int signum,
    					 unsigned int flags)
    int	virDomainSetAutostart		(virDomainPtr domain,
    					 int autostart)
    int	virDomainSetBlkioParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetBlockIoTune		(virDomainPtr dom,
    					 const char * disk,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetBlockThreshold	(virDomainPtr domain,
    					 const char * dev,
    					 unsigned long long threshold,
    					 unsigned int flags)
    int	virDomainSetGuestVcpus		(virDomainPtr domain,
    					 const char * cpumap,
    					 int state,
    					 unsigned int flags)
    int	virDomainSetIOThreadParams	(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetInterfaceParameters	(virDomainPtr domain,
    					 const char * device,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetLaunchSecurityState	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetLifecycleAction	(virDomainPtr domain,
    					 unsigned int type,
    					 unsigned int action,
    					 unsigned int flags)
    int	virDomainSetMaxMemory		(virDomainPtr domain,
    					 unsigned long memory)
    int	virDomainSetMemory		(virDomainPtr domain,
    					 unsigned long memory)
    int	virDomainSetMemoryFlags		(virDomainPtr domain,
    					 unsigned long memory,
    					 unsigned int flags)
    int	virDomainSetMemoryParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetMemoryStatsPeriod	(virDomainPtr domain,
    					 int period,
    					 unsigned int flags)
    int	virDomainSetMetadata		(virDomainPtr domain,
    					 int type,
    					 const char * metadata,
    					 const char * key,
    					 const char * uri,
    					 unsigned int flags)
    int	virDomainSetNumaParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetPerfEvents		(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)
    int	virDomainSetSchedulerParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams)
    int	virDomainSetSchedulerParametersFlags	(virDomainPtr domain,
    						 virTypedParameterPtr params,
    						 int nparams,
    						 unsigned int flags)
    int	virDomainSetTime		(virDomainPtr dom,
    					 long long seconds,
    					 unsigned int nseconds,
    					 unsigned int flags)
    int	virDomainSetUserPassword	(virDomainPtr dom,
    					 const char * user,
    					 const char * password,
    					 unsigned int flags)
    int	virDomainSetVcpu		(virDomainPtr domain,
    					 const char * vcpumap,
    					 int state,
    					 unsigned int flags)
    int	virDomainSetVcpus		(virDomainPtr domain,
    					 unsigned int nvcpus)
    int	virDomainSetVcpusFlags		(virDomainPtr domain,
    					 unsigned int nvcpus,
    					 unsigned int flags)
    int	virDomainShutdown		(virDomainPtr domain)
    int	virDomainShutdownFlags		(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainStartDirtyRateCalc	(virDomainPtr domain,
    					 int seconds,
    					 unsigned int flags)
    void	virDomainStatsRecordListFree	(virDomainStatsRecordPtr * stats)
    int	virDomainSuspend		(virDomainPtr domain)
    int	virDomainUndefine		(virDomainPtr domain)
    int	virDomainUndefineFlags		(virDomainPtr domain,
    					 unsigned int flags)
    int	virDomainUpdateDeviceFlags	(virDomainPtr domain,
    					 const char * xml,
    					 unsigned int flags)

## Description

### Macros

### `VIR_COPY_CPUMAP`

    #define VIR_COPY_CPUMAP

This macro is to be used in conjunction with virDomainGetVcpus() and virDomainPinVcpu() APIs. VIR_COPY_CPUMAP macro extracts the cpumap of the specified vcpu from cpumaps array and copies it into cpumap to be used later by virDomainPinVcpu() API.

### `VIR_CPU_MAPLEN`

    #define VIR_CPU_MAPLEN

This macro is to be used in conjunction with virDomainPinVcpu() API. It returns the length (in bytes) required to store the complete CPU map between a single virtual & all physical CPUs of a domain.

### `VIR_CPU_USABLE`

    #define VIR_CPU_USABLE

This macro is to be used in conjunction with virDomainGetVcpus() API. VIR_CPU_USABLE macro returns a non-zero value (true) if the cpu is usable by the vcpu, and 0 otherwise.

### `VIR_CPU_USED`

    #define VIR_CPU_USED

This macro can be used in conjunction with virNodeGetCPUMap() API. It returns non-zero if the bit of the related CPU is set.

### `VIR_DOMAIN_BANDWIDTH_IN_AVERAGE`

    #define VIR_DOMAIN_BANDWIDTH_IN_AVERAGE

Macro represents the inbound average of NIC bandwidth, as a uint.

### `VIR_DOMAIN_BANDWIDTH_IN_BURST`

    #define VIR_DOMAIN_BANDWIDTH_IN_BURST

Macro represents the inbound burst of NIC bandwidth, as a uint.

### `VIR_DOMAIN_BANDWIDTH_IN_FLOOR`

    #define VIR_DOMAIN_BANDWIDTH_IN_FLOOR

Macro represents the inbound floor of NIC bandwidth, as a uint.

### `VIR_DOMAIN_BANDWIDTH_IN_PEAK`

    #define VIR_DOMAIN_BANDWIDTH_IN_PEAK

Macro represents the inbound peak of NIC bandwidth, as a uint.

### `VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE`

    #define VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE

Macro represents the outbound average of NIC bandwidth, as a uint.

### `VIR_DOMAIN_BANDWIDTH_OUT_BURST`

    #define VIR_DOMAIN_BANDWIDTH_OUT_BURST

Macro represents the outbound burst of NIC bandwidth, as a uint.

### `VIR_DOMAIN_BANDWIDTH_OUT_PEAK`

    #define VIR_DOMAIN_BANDWIDTH_OUT_PEAK

Macro represents the outbound peak of NIC bandwidth, as a uint.

### `VIR_DOMAIN_BLKIO_DEVICE_READ_BPS`

    #define VIR_DOMAIN_BLKIO_DEVICE_READ_BPS

Macro for the blkio tunable throttle.read_iops_device: it represents the bytes of reading the block device per second, as a string. The string is parsed as a series of /path/to/device, read_bps elements, separated by ','.

### `VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS`

    #define VIR_DOMAIN_BLKIO_DEVICE_READ_IOPS

Macro for the blkio tunable throttle.read_iops_device: it represents the number of reading the block device per second, as a string. The string is parsed as a series of /path/to/device, read_iops elements, separated by ','.

### `VIR_DOMAIN_BLKIO_DEVICE_WEIGHT`

    #define VIR_DOMAIN_BLKIO_DEVICE_WEIGHT

Macro for the blkio tunable weight_device: it represents the per-device weight, as a string. The string is parsed as a series of /path/to/device,weight elements, separated by ','.

### `VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS`

    #define VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS

Macro for the blkio tunable throttle.read_iops_device: it represents the number of reading the block device per second, as a string. The string is parsed as a series of /path/to/device, write_bps elements, separated by ','.

### `VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS`

    #define VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS

Macro for the blkio tunable throttle.write_iops_device: it represents the number of writing the block device per second, as a string. The string is parsed as a series of /path/to/device, write_iops elements, separated by ','.

### `VIR_DOMAIN_BLKIO_FIELD_LENGTH`

    #define VIR_DOMAIN_BLKIO_FIELD_LENGTH

Macro providing the field length of virBlkioParameter. Provided for backwards compatibility; VIR_TYPED_PARAM_FIELD_LENGTH is the preferred value.

### `VIR_DOMAIN_BLKIO_WEIGHT`

    #define VIR_DOMAIN_BLKIO_WEIGHT

Macro for the Blkio tunable weight: it represents the io weight the guest can use, as a uint.

### `VIR_DOMAIN_BLOCK_COPY_BANDWIDTH`

    #define VIR_DOMAIN_BLOCK_COPY_BANDWIDTH

Macro for the virDomainBlockCopy bandwidth tunable: it represents the maximum bandwidth in bytes/s, and is used while getting the copy operation into the mirrored phase, with a type of ullong. For compatibility with virDomainBlockJobSetSpeed(), values larger than 2^52 bytes/sec (a 32-bit MiB/s value) may be rejected on input due to overflow considerations (but do you really have an interface with that much bandwidth?), and values larger than 2^31 bytes/sec may cause overflow problems if queried in bytes/sec. Hypervisors may further restrict the set of valid values. Specifying 0 is the same as omitting this parameter, to request no bandwidth limiting. Some hypervisors may lack support for this parameter, while still allowing a subsequent change of bandwidth via virDomainBlockJobSetSpeed(). The actual speed can be determined with virDomainGetBlockJobInfo().

### `VIR_DOMAIN_BLOCK_COPY_BUF_SIZE`

    #define VIR_DOMAIN_BLOCK_COPY_BUF_SIZE

Macro for the virDomainBlockCopy buffer size tunable: it represents how much data in bytes can be in flight between source and destination, as an unsigned long long. Specifying 0 is the same as omitting this parameter, to request the hypervisor default.

### `VIR_DOMAIN_BLOCK_COPY_GRANULARITY`

    #define VIR_DOMAIN_BLOCK_COPY_GRANULARITY

Macro for the virDomainBlockCopy granularity tunable: it represents the granularity in bytes at which the copy operation recognizes dirty blocks that need copying, as an unsigned int. Hypervisors may restrict this to be a power of two or fall within a certain range. Specifying 0 is the same as omitting this parameter, to request the hypervisor default.

### `VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME`

    #define VIR_DOMAIN_BLOCK_IOTUNE_GROUP_NAME

Macro for the BlockIoTune tunable weight: it represents a group name to allow sharing of I/O throttling quota between multiple drives, as a string.

### `VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC`

    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC

Macro for the BlockIoTune tunable weight: it represents the read bytes per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX`

    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX

Macro for the BlockIoTune tunable weight: it represents the maximum read bytes per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC_MAX_LENGTH

Macro for the BlockIoTune tunable weight: it represents the duration in seconds for the burst allowed by read_bytes_sec_max, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC`

    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC

Macro for the BlockIoTune tunable weight: it represents the read I/O operations per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX`

    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX

Macro for the BlockIoTune tunable weight: it represents the maximum read I/O operations per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC_MAX_LENGTH

Macro for the BlockIoTune tunable weight: it represents the duration in seconds for the burst allowed by read_iops_sec_max, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC`

    #define VIR_DOMAIN_BLOCK_IOTUNE_SIZE_IOPS_SEC

Macro for the BlockIoTune tunable weight: it represents the size I/O operations per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC`

    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC

Macro for the BlockIoTune tunable weight: it represents the total bytes per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX`

    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX

Macro for the BlockIoTune tunable weight: it represents the maximum total bytes per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC_MAX_LENGTH

Macro for the BlockIoTune tunable weight: it represents the duration in seconds for the burst allowed by total_bytes_sec_max, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC`

    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC

Macro for the BlockIoTune tunable weight: it represents the total I/O operations per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX`

    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX

Macro for the BlockIoTune tunable weight: it represents the maximum I/O operations per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC_MAX_LENGTH

Macro for the BlockIoTune tunable weight: it represents the duration in seconds for the burst allowed by total_iops_sec_max, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC`

    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC

Macro for the BlockIoTune tunable weight: it represents the write bytes per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX`

    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX

Macro for the BlockIoTune tunable weight: it represents the maximum write bytes per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC_MAX_LENGTH

Macro for the BlockIoTune tunable weight: it represents the duration in seconds for the burst allowed by write_bytes_sec_max, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC`

    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC

Macro for the BlockIoTune tunable weight: it represents the write I/O operations per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX`

    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX

Macro for the BlockIoTune tunable weight: it represents the maximum write I/O operations per second permitted through a block device, as a ullong.

### `VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC_MAX_LENGTH

Macro for the BlockIoTune tunable weight: it represents the duration in seconds for the burst allowed by write_iops_sec_max, as a ullong.

### `VIR_DOMAIN_BLOCK_STATS_ERRS`

    #define VIR_DOMAIN_BLOCK_STATS_ERRS

In Xen this returns the mysterious 'oo_req', as an llong.

### `VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH`

    #define VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH

Macro providing the field length of parameter names when using virDomainBlockStatsFlags().

### `VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ`

    #define VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ

Macro represents the total flush requests of the block device, as an llong.

### `VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES`

    #define VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES

Macro represents the total time spend on cache flushing in nano-seconds of the block device, as an llong.

### `VIR_DOMAIN_BLOCK_STATS_READ_BYTES`

    #define VIR_DOMAIN_BLOCK_STATS_READ_BYTES

Macro represents the total number of read bytes of the block device, as an llong.

### `VIR_DOMAIN_BLOCK_STATS_READ_REQ`

    #define VIR_DOMAIN_BLOCK_STATS_READ_REQ

Macro represents the total read requests of the block device, as an llong.

### `VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES`

    #define VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES

Macro represents the total time spend on cache reads in nano-seconds of the block device, as an llong.

### `VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES`

    #define VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES

Macro represents the total number of write bytes of the block device, as an llong.

### `VIR_DOMAIN_BLOCK_STATS_WRITE_REQ`

    #define VIR_DOMAIN_BLOCK_STATS_WRITE_REQ

Macro represents the total write requests of the block device, as an llong.

### `VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES`

    #define VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES

Macro represents the total time spend on cache writes in nano-seconds of the block device, as an llong.

### `VIR_DOMAIN_CPU_STATS_CPUTIME`

    #define VIR_DOMAIN_CPU_STATS_CPUTIME

cpu usage (sum of both vcpu and hypervisor usage) in nanoseconds, as a ullong

### `VIR_DOMAIN_CPU_STATS_SYSTEMTIME`

    #define VIR_DOMAIN_CPU_STATS_SYSTEMTIME

cpu time charged to system instructions in nanoseconds, as a ullong

### `VIR_DOMAIN_CPU_STATS_USERTIME`

    #define VIR_DOMAIN_CPU_STATS_USERTIME

cpu time charged to user instructions in nanoseconds, as a ullong

### `VIR_DOMAIN_CPU_STATS_VCPUTIME`

    #define VIR_DOMAIN_CPU_STATS_VCPUTIME

vcpu usage in nanoseconds (cpu_time excluding hypervisor time), as a ullong

### `VIR_DOMAIN_EVENT_CALLBACK`

    #define VIR_DOMAIN_EVENT_CALLBACK

Used to cast the event specific callback into the generic one for use for virConnectDomainEventRegisterAny()

### `VIR_DOMAIN_IOTHREAD_POLL_GROW`

    #define VIR_DOMAIN_IOTHREAD_POLL_GROW

This provides a value for the dynamic polling adjustment algorithm to use to grow its polling interval up to the poll_max_ns value. A value of 0 (zero) allows the hypervisor to choose its own value. The algorithm to use for adjustment is hypervisor specific. Accepted type is VIR_TYPED_PARAM_UINT or since 9.3.0 VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_IOTHREAD_POLL_MAX_NS`

    #define VIR_DOMAIN_IOTHREAD_POLL_MAX_NS

The maximum polling time that can be used by polling algorithm in ns. The polling time starts at 0 (zero) and is the time spent by the guest to process IOThread data before returning the CPU to the host. The polling time will be dynamically modified over time based on the poll_grow and poll_shrink parameters provided. A value set too large will cause more CPU time to be allocated the guest. A value set too small will not provide enough cycles for the guest to process data. Accepted type is VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_IOTHREAD_POLL_SHRINK`

    #define VIR_DOMAIN_IOTHREAD_POLL_SHRINK

This provides a value for the dynamic polling adjustment algorithm to use to shrink its polling interval when the polling interval exceeds the poll_max_ns value. A value of 0 (zero) allows the hypervisor to choose its own value. The algorithm to use for adjustment is hypervisor specific. Accepted type is VIR_TYPED_PARAM_UINT or since 9.3.0 VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX`

    #define VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX

Sets the upper bound for thread pool size. A value of -1 disables this bound leaving hypervisor use its default value, though this value is not accepted for running domains. Since the upper band has to be equal to or greater than lower bound value of 0 is not accepted. Accepted type is VIR_TYPED_PARAM_INT.

### `VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN`

    #define VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN

Sets the lower bound for thread pool size. A value of -1 disables this bound leaving hypervisor use its default value, though this value is not accepted for running domains. Accepted type is VIR_TYPED_PARAM_INT.

### `VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE`

    #define VIR_DOMAIN_JOB_AUTO_CONVERGE_THROTTLE

virDomainGetJobStats field: current percentage guest CPUs are throttled to when auto-convergence decided migration was not converging, as VIR_TYPED_PARAM_INT.

### `VIR_DOMAIN_JOB_COMPRESSION_BYTES`

    #define VIR_DOMAIN_JOB_COMPRESSION_BYTES

virDomainGetJobStats field: number of compressed bytes transferred since the beginning of migration, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_COMPRESSION_CACHE`

    #define VIR_DOMAIN_JOB_COMPRESSION_CACHE

virDomainGetJobStats field: size of the cache (in bytes) used for compressing repeatedly transferred memory pages during live migration, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES`

    #define VIR_DOMAIN_JOB_COMPRESSION_CACHE_MISSES

virDomainGetJobStats field: number of repeatedly changing pages that were not found in compression cache and thus could not be compressed, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW`

    #define VIR_DOMAIN_JOB_COMPRESSION_OVERFLOW

virDomainGetJobStats field: number of repeatedly changing pages that were found in compression cache but were sent uncompressed because the result of compression was larger than the original page as a whole, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_COMPRESSION_PAGES`

    #define VIR_DOMAIN_JOB_COMPRESSION_PAGES

virDomainGetJobStats field: number of compressed pages transferred since the beginning of migration, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_DATA_PROCESSED`

    #define VIR_DOMAIN_JOB_DATA_PROCESSED

virDomainGetJobStats field: number of bytes transferred from the beginning of the job, as VIR_TYPED_PARAM_ULLONG. This field corresponds to dataProcessed field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_DATA_REMAINING`

    #define VIR_DOMAIN_JOB_DATA_REMAINING

virDomainGetJobStats field: number of bytes that still need to be transferred, as VIR_TYPED_PARAM_ULLONG. This field corresponds to dataRemaining field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_DATA_TOTAL`

    #define VIR_DOMAIN_JOB_DATA_TOTAL

virDomainGetJobStats field: total number of bytes supposed to be transferred, as VIR_TYPED_PARAM_ULLONG. For VIR_DOMAIN_JOB_UNBOUNDED jobs, this may be less than the sum of VIR_DOMAIN_JOB_DATA_PROCESSED and VIR_DOMAIN_JOB_DATA_REMAINING in the event that the hypervisor has to repeat some data, e.g., due to dirtied pages during migration. For VIR_DOMAIN_JOB_BOUNDED jobs, VIR_DOMAIN_JOB_DATA_TOTAL shall always equal VIR_DOMAIN_JOB_DATA_PROCESSED + VIR_DOMAIN_JOB_DATA_REMAINING. This field corresponds to dataTotal field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_DISK_BPS`

    #define VIR_DOMAIN_JOB_DISK_BPS

virDomainGetJobStats field: network throughput used while migrating disks in Bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_DISK_PROCESSED`

    #define VIR_DOMAIN_JOB_DISK_PROCESSED

virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_PROCESSED but only tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG. This field corresponds to fileProcessed field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_DISK_REMAINING`

    #define VIR_DOMAIN_JOB_DISK_REMAINING

virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_REMAINING but only tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG. This field corresponds to fileRemaining field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_DISK_TEMP_TOTAL`

    #define VIR_DOMAIN_JOB_DISK_TEMP_TOTAL

virDomainGetJobStats field: possible total temporary disk space for the job in bytes as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_DISK_TEMP_USED`

    #define VIR_DOMAIN_JOB_DISK_TEMP_USED

virDomainGetJobStats field: current usage of temporary disk space for the job in bytes as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_DISK_TOTAL`

    #define VIR_DOMAIN_JOB_DISK_TOTAL

virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_TOTAL but only tracking guest disk progress, as VIR_TYPED_PARAM_ULLONG. This field corresponds to fileTotal field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_DOWNTIME`

    #define VIR_DOMAIN_JOB_DOWNTIME

virDomainGetJobStats field: downtime (ms) that is expected to happen during migration, as VIR_TYPED_PARAM_ULLONG. The real computed downtime between the time guest CPUs were paused and the time they were resumed is reported for completed migration.

### `VIR_DOMAIN_JOB_DOWNTIME_NET`

    #define VIR_DOMAIN_JOB_DOWNTIME_NET

virDomainGetJobStats field: real measured downtime (ms) NOT including the time required to transfer control flow from the source host to the destination host, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_ERRMSG`

    #define VIR_DOMAIN_JOB_ERRMSG

virDomainGetJobStats field: Present only in statistics for a completed job. Optional error message for a failed job.

### `VIR_DOMAIN_JOB_MEMORY_BPS`

    #define VIR_DOMAIN_JOB_MEMORY_BPS

virDomainGetJobStats field: network throughput used while migrating memory in Bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_MEMORY_CONSTANT`

    #define VIR_DOMAIN_JOB_MEMORY_CONSTANT

virDomainGetJobStats field: number of pages filled with a constant byte (all bytes in a single page are identical) transferred since the beginning of the migration job, as VIR_TYPED_PARAM_ULLONG. The most common example of such pages are zero pages, i.e., pages filled with zero bytes.

### `VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE`

    #define VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE

virDomainGetJobStats field: number of memory pages dirtied by the guest per second, as VIR_TYPED_PARAM_ULLONG. This statistics makes sense only when live migration is running.

### `VIR_DOMAIN_JOB_MEMORY_ITERATION`

    #define VIR_DOMAIN_JOB_MEMORY_ITERATION

virDomainGetJobStats field: current iteration over domain's memory during live migration, as VIR_TYPED_PARAM_ULLONG. This is set to zero when memory starts to be transferred and the value is increased by one every time a new iteration is started to transfer memory pages dirtied since the last iteration.

### `VIR_DOMAIN_JOB_MEMORY_NORMAL`

    #define VIR_DOMAIN_JOB_MEMORY_NORMAL

virDomainGetJobStats field: number of pages that were transferred without any kind of compression (i.e., pages which were not filled with a constant byte and which could not be compressed) transferred since the beginning of the migration job, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES`

    #define VIR_DOMAIN_JOB_MEMORY_NORMAL_BYTES

virDomainGetJobStats field: number of bytes transferred as normal pages, as VIR_TYPED_PARAM_ULLONG. See VIR_DOMAIN_JOB_MEMORY_NORMAL for more details.

### `VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE`

    #define VIR_DOMAIN_JOB_MEMORY_PAGE_SIZE

virDomainGetJobStats field: memory page size in bytes, as VIR_TYPED_PARAM_ULLONG. If present, this parameter can be used to convert other page based statistics, such as VIR_DOMAIN_JOB_MEMORY_DIRTY_RATE or VIR_DOMAIN_JOB_COMPRESSION_PAGES to bytes.

### `VIR_DOMAIN_JOB_MEMORY_POSTCOPY_REQS`

    #define VIR_DOMAIN_JOB_MEMORY_POSTCOPY_REQS

virDomainGetJobStats field: number page requests received from the destination host during post-copy migration, as VIR_TYPED_PARAM_ULLONG. This counter is incremented whenever the migrated domain tries to access a memory page which has not been transferred from the source host yet.

### `VIR_DOMAIN_JOB_MEMORY_PROCESSED`

    #define VIR_DOMAIN_JOB_MEMORY_PROCESSED

virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_PROCESSED but only tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG. This field corresponds to memProcessed field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_MEMORY_REMAINING`

    #define VIR_DOMAIN_JOB_MEMORY_REMAINING

virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_REMAINING but only tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG. This field corresponds to memRemaining field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_MEMORY_TOTAL`

    #define VIR_DOMAIN_JOB_MEMORY_TOTAL

virDomainGetJobStats field: as VIR_DOMAIN_JOB_DATA_TOTAL but only tracking guest memory progress, as VIR_TYPED_PARAM_ULLONG. This field corresponds to memTotal field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_OPERATION`

    #define VIR_DOMAIN_JOB_OPERATION

virDomainGetJobStats field: the operation which started the job as VIR_TYPED_PARAM_INT. The values correspond to the items in virDomainJobOperation enum.

### `VIR_DOMAIN_JOB_SETUP_TIME`

    #define VIR_DOMAIN_JOB_SETUP_TIME

virDomainGetJobStats field: total time in milliseconds spent preparing the migration in the 'setup' phase before the iterations begin, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_SUCCESS`

    #define VIR_DOMAIN_JOB_SUCCESS

virDomainGetJobStats field: Present only in statistics for a completed job. Successful completion of the job as VIR_TYPED_PARAM_BOOLEAN.

### `VIR_DOMAIN_JOB_TIME_ELAPSED`

    #define VIR_DOMAIN_JOB_TIME_ELAPSED

virDomainGetJobStats field: time (ms) since the beginning of the job, as VIR_TYPED_PARAM_ULLONG. This field corresponds to timeElapsed field in virDomainJobInfo.

### `VIR_DOMAIN_JOB_TIME_ELAPSED_NET`

    #define VIR_DOMAIN_JOB_TIME_ELAPSED_NET

virDomainGetJobStats field: time (ms) since the beginning of the migration job NOT including the time required to transfer control flow from the source host to the destination host, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_JOB_TIME_REMAINING`

    #define VIR_DOMAIN_JOB_TIME_REMAINING

virDomainGetJobStats field: remaining time (ms) for VIR_DOMAIN_JOB_BOUNDED jobs, as VIR_TYPED_PARAM_ULLONG. This field corresponds to timeRemaining field in virDomainJobInfo.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MAJOR`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MAJOR

Macro represents the API major version of the SEV host, as VIR_TYPED_PARAM_UINT.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MINOR`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_API_MINOR

Macro represents the API minor version of the SEV guest, as VIR_TYPED_PARAM_UINT.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_BUILD_ID`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_BUILD_ID

Macro represents the build ID of the SEV host, as VIR_TYPED_PARAM_UINT.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_MEASUREMENT

Macro represents the launch measurement of the SEV guest, as VIR_TYPED_PARAM_STRING.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_POLICY`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_POLICY

Macro represents the policy of the SEV guest, as VIR_TYPED_PARAM_UINT.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET

A macro used to represent the SEV launch secret. The secret is a base64-encoded VIR_TYPED_PARAM_STRING containing an encrypted launch secret. The secret is created by the domain owner after the SEV launch measurement is retrieved and verified.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_HEADER`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_HEADER

A macro used to represent the SEV launch secret header. The secret header is a base64-encoded VIR_TYPED_PARAM_STRING containing artifacts needed by the SEV firmware to recover the plain text of the launch secret. See section "6.6 LAUNCH_SECRET" in the SEV API specification for a detailed description of the secret header.

### `VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS`

    #define VIR_DOMAIN_LAUNCH_SECURITY_SEV_SECRET_SET_ADDRESS

A macro used to represent the physical address within the guest's memory where the secret will be set, as VIR_TYPED_PARAM_ULLONG. If not specified, the address will be determined by the hypervisor.

### `VIR_DOMAIN_MEMORY_FIELD_LENGTH`

    #define VIR_DOMAIN_MEMORY_FIELD_LENGTH

Macro providing the field length of virMemoryParameter. Provided for backwards compatibility; VIR_TYPED_PARAM_FIELD_LENGTH is the preferred value.

### `VIR_DOMAIN_MEMORY_HARD_LIMIT`

    #define VIR_DOMAIN_MEMORY_HARD_LIMIT

Macro for the memory tunable hard_limit: it represents the maximum memory the guest can use, as a ullong.

### `VIR_DOMAIN_MEMORY_MIN_GUARANTEE`

    #define VIR_DOMAIN_MEMORY_MIN_GUARANTEE

Macro for the memory tunable min_guarantee: it represents the minimum memory guaranteed to be reserved for the guest, as a ullong.

### `VIR_DOMAIN_MEMORY_PARAM_UNLIMITED`

    #define VIR_DOMAIN_MEMORY_PARAM_UNLIMITED

Macro providing the virMemoryParameter value that indicates "unlimited"

### `VIR_DOMAIN_MEMORY_SOFT_LIMIT`

    #define VIR_DOMAIN_MEMORY_SOFT_LIMIT

Macro for the memory tunable soft_limit: it represents the memory upper limit enforced during memory contention, as a ullong.

### `VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT`

    #define VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT

Macro for the swap tunable swap_hard_limit: it represents the maximum swap plus memory the guest can use, as a ullong. This limit has to be more than VIR_DOMAIN_MEMORY_HARD_LIMIT.

### `VIR_DOMAIN_NUMA_MODE`

    #define VIR_DOMAIN_NUMA_MODE

Macro for typed parameter name that lists the numa mode of a domain, as an int containing a virDomainNumatuneMemMode value.

### `VIR_DOMAIN_NUMA_NODESET`

    #define VIR_DOMAIN_NUMA_NODESET

Macro for typed parameter name that lists the numa nodeset of a domain, as a string.

### `VIR_DOMAIN_SAVE_PARAM_DXML`

    #define VIR_DOMAIN_SAVE_PARAM_DXML

an optional parameter used to adjust guest xml on restore. If the hypervisor supports it, it can be used to alter host-specific portions of the domain XML that will be used when restoring an image. For example, it is possible to alter the device while the domain is stopped.

### `VIR_DOMAIN_SAVE_PARAM_FILE`

    #define VIR_DOMAIN_SAVE_PARAM_FILE

the parameter used to specify the savestate file to save to or restore from.

### `VIR_DOMAIN_SCHEDULER_CAP`

    #define VIR_DOMAIN_SCHEDULER_CAP

Macro represents the maximum scheduler cap, when using the credit scheduler, as a uint.

### `VIR_DOMAIN_SCHEDULER_CPU_SHARES`

    #define VIR_DOMAIN_SCHEDULER_CPU_SHARES

Macro represents proportional weight of the scheduler used on the host cpu, when using the posix scheduler, as a ullong.

### `VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD`

    #define VIR_DOMAIN_SCHEDULER_EMULATOR_PERIOD

Macro represents the enforcement period for a quota in microseconds, when using the posix scheduler, for all emulator activity not tied to vcpus, as a ullong.

### `VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA`

    #define VIR_DOMAIN_SCHEDULER_EMULATOR_QUOTA

Macro represents the maximum bandwidth to be used within a period for all emulator activity not tied to vcpus, when using the posix scheduler, as an llong.

### `VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD`

    #define VIR_DOMAIN_SCHEDULER_GLOBAL_PERIOD

Macro represents the enforcement period for a quota, in microseconds, for whole domain, when using the posix scheduler, as a ullong.

### `VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA`

    #define VIR_DOMAIN_SCHEDULER_GLOBAL_QUOTA

Macro represents the maximum bandwidth to be used within a period for whole domain, when using the posix scheduler, as an llong.

### `VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD`

    #define VIR_DOMAIN_SCHEDULER_IOTHREAD_PERIOD

Macro represents the enforcement period for a quota, in microseconds, for IOThreads only, when using the posix scheduler, as a ullong.

### `VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA`

    #define VIR_DOMAIN_SCHEDULER_IOTHREAD_QUOTA

Macro represents the maximum bandwidth to be used within a period for IOThreads only, when using the posix scheduler, as an llong.

### `VIR_DOMAIN_SCHEDULER_LIMIT`

    #define VIR_DOMAIN_SCHEDULER_LIMIT

Macro represents the scheduler limit value, when using the allocation scheduler, as an llong.

### `VIR_DOMAIN_SCHEDULER_RESERVATION`

    #define VIR_DOMAIN_SCHEDULER_RESERVATION

Macro represents the scheduler reservation value, when using the allocation scheduler, as an llong.

### `VIR_DOMAIN_SCHEDULER_SHARES`

    #define VIR_DOMAIN_SCHEDULER_SHARES

Macro represents the scheduler shares value, when using the allocation scheduler, as an int.

### `VIR_DOMAIN_SCHEDULER_VCPU_PERIOD`

    #define VIR_DOMAIN_SCHEDULER_VCPU_PERIOD

Macro represents the enforcement period for a quota, in microseconds, for vcpus only, when using the posix scheduler, as a ullong.

### `VIR_DOMAIN_SCHEDULER_VCPU_QUOTA`

    #define VIR_DOMAIN_SCHEDULER_VCPU_QUOTA

Macro represents the maximum bandwidth to be used within a period for vcpus only, when using the posix scheduler, as an llong.

### `VIR_DOMAIN_SCHEDULER_WEIGHT`

    #define VIR_DOMAIN_SCHEDULER_WEIGHT

Macro represents the relative weight, when using the credit scheduler, as a uint.

### `VIR_DOMAIN_SCHED_FIELD_LENGTH`

    #define VIR_DOMAIN_SCHED_FIELD_LENGTH

Macro providing the field length of virSchedParameter. Provided for backwards compatibility; VIR_TYPED_PARAM_FIELD_LENGTH is the preferred value

### `VIR_DOMAIN_SEND_KEY_MAX_KEYS`

    #define VIR_DOMAIN_SEND_KEY_MAX_KEYS

Maximum number of keycodes that can be sent in one virDomainSendKey() call.

### `VIR_DOMAIN_TUNABLE_BLKDEV_DISK`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_DISK

Macro represents the name of guest disk for which the values are updated, as VIR_TYPED_PARAM_STRING.

### `VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_GROUP_NAME

Macro represents the group name to be used, as VIR_TYPED_PARAM_STRING.

### `VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC

Macro represents the read throughput limit in bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX

Macro represents the read throughput limit during bursts in maximum bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_BYTES_SEC_MAX_LENGTH

Macro represents the length in seconds allowed for a burst period for the blkdeviotune.read_bytes_sec_max as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC

Macro represents the read I/O operations per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX

Macro represents the read maximum I/O operations per second during bursts, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_READ_IOPS_SEC_MAX_LENGTH

Macro represents the length in seconds allowed for a burst period for the blkdeviotune.read_iops_sec_max as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_SIZE_IOPS_SEC

Macro represents the size maximum I/O operations per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC

Macro represents the total throughput limit in bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX

Macro represents the total throughput limit during bursts in maximum bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_BYTES_SEC_MAX_LENGTH

Macro represents the length in seconds allowed for a burst period for the blkdeviotune.total_bytes_sec_max, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC

Macro represents the total I/O operations per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX

Macro represents the total maximum I/O operations per second during bursts, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_TOTAL_IOPS_SEC_MAX_LENGTH

Macro represents the length in seconds allowed for a burst period for the blkdeviotune.total_iops_sec_max as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC

Macro represents the write throughput limit in bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX

Macro represents the write throughput limit during bursts in maximum bytes per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_BYTES_SEC_MAX_LENGTH

Macro represents the length in seconds allowed for a burst period for the blkdeviotune.write_bytes_sec_max as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC

Macro represents the write I/O operations per second, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX

Macro represents the write maximum I/O operations per second during bursts, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH`

    #define VIR_DOMAIN_TUNABLE_BLKDEV_WRITE_IOPS_SEC_MAX_LENGTH

Macro represents the length in seconds allowed for a burst period for the blkdeviotune.write_iops_sec_max as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES`

    #define VIR_DOMAIN_TUNABLE_CPU_CPU_SHARES

Macro represents proportional weight of the scheduler used on the host cpu, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN`

    #define VIR_DOMAIN_TUNABLE_CPU_EMULATORPIN

Macro represents formatted pinning for emulator process, as VIR_TYPED_PARAM_STRING.

### `VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD`

    #define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_PERIOD

Macro represents the enforcement period for a quota in microseconds, when using the posix scheduler, for all emulator activity not tied to vcpus, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA`

    #define VIR_DOMAIN_TUNABLE_CPU_EMULATOR_QUOTA

Macro represents the maximum bandwidth to be used within a period for all emulator activity not tied to vcpus, when using the posix scheduler, as an VIR_TYPED_PARAM_LLONG.

### `VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD`

    #define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_PERIOD

Macro represents the enforcement period for a quota, in microseconds, for whole domain, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA`

    #define VIR_DOMAIN_TUNABLE_CPU_GLOBAL_QUOTA

Macro represents the maximum bandwidth to be used within a period for whole domain, when using the posix scheduler, as VIR_TYPED_PARAM_LLONG.

### `VIR_DOMAIN_TUNABLE_CPU_IOTHREADSPIN`

    #define VIR_DOMAIN_TUNABLE_CPU_IOTHREADSPIN

Macro represents formatted pinning for one IOThread specified by id which is appended to the parameter name, for example "cputune.iothreadpin1", as VIR_TYPED_PARAM_STRING.

### `VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD`

    #define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_PERIOD

Macro represents the enforcement period for a quota, in microseconds, for iothreads only, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA`

    #define VIR_DOMAIN_TUNABLE_CPU_IOTHREAD_QUOTA

Macro represents the maximum bandwidth to be used within a period for iothreads only, when using the posix scheduler, as VIR_TYPED_PARAM_LLONG.

### `VIR_DOMAIN_TUNABLE_CPU_VCPUPIN`

    #define VIR_DOMAIN_TUNABLE_CPU_VCPUPIN

Macro represents formatted pinning for one vcpu specified by id which is appended to the parameter name, for example "cputune.vcpupin1", as VIR_TYPED_PARAM_STRING.

### `VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD`

    #define VIR_DOMAIN_TUNABLE_CPU_VCPU_PERIOD

Macro represents the enforcement period for a quota, in microseconds, for vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_ULLONG.

### `VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA`

    #define VIR_DOMAIN_TUNABLE_CPU_VCPU_QUOTA

Macro represents the maximum bandwidth to be used within a period for vcpus only, when using the posix scheduler, as VIR_TYPED_PARAM_LLONG.

### `VIR_GET_CPUMAP`

    #define VIR_GET_CPUMAP

This macro is to be used in conjunction with virDomainGetVcpus() and virDomainPinVcpu() APIs. VIR_GET_CPUMAP macro returns a pointer to the cpumap of the specified vcpu from cpumaps array.

### `VIR_KEYCODE_SET_RFB`

    #define VIR_KEYCODE_SET_RFB

Compatibility alias for VIR_KEYCODE_SET_QNUM, which replaced it since 4.2.0.

### `VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT`

    #define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INCREMENT

virDomainMigrate* params field: the increment added to VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL whenever the hypervisor decides the current rate is not enough to ensure convergence of the migration. As VIR_TYPED_PARAM_INT.

### `VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL`

    #define VIR_MIGRATE_PARAM_AUTO_CONVERGE_INITIAL

virDomainMigrate* params field: the initial percentage guest CPUs are throttled to when auto-convergence decides migration is not converging. As VIR_TYPED_PARAM_INT.

### `VIR_MIGRATE_PARAM_BANDWIDTH`

    #define VIR_MIGRATE_PARAM_BANDWIDTH

virDomainMigrate* params field: the maximum bandwidth (in MiB/s) that will be used for migration as VIR_TYPED_PARAM_ULLONG. If set to 0 or omitted, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if this field is used and is not 0.

### `VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY`

    #define VIR_MIGRATE_PARAM_BANDWIDTH_POSTCOPY

virDomainMigrate* params field: the maximum bandwidth (in MiB/s) that will be used for post-copy phase of a migration as VIR_TYPED_PARAM_ULLONG. If set to 0 or omitted, post-copy migration speed will not be limited.

### `VIR_MIGRATE_PARAM_COMPRESSION`

    #define VIR_MIGRATE_PARAM_COMPRESSION

virDomainMigrate* params multiple field: name of the method used to compress migration traffic. Supported compression methods: xbzrle, mt, zlib, zstd. The parameter may be specified multiple times if more than one method should be used. Not all combinations of compression methods and migration options may be allowed. Parallel migration of QEMU domains is only compatible with either zlib or zstd method.

### `VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS`

    #define VIR_MIGRATE_PARAM_COMPRESSION_MT_DTHREADS

virDomainMigrate* params field: the number of decompression threads for multithread compression as VIR_TYPED_PARAM_INT.

### `VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL`

    #define VIR_MIGRATE_PARAM_COMPRESSION_MT_LEVEL

virDomainMigrate* params field: the level of compression for multithread compression as VIR_TYPED_PARAM_INT. Accepted values are in range 0-9. 0 is no compression, 1 is maximum speed and 9 is maximum compression.

### `VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS`

    #define VIR_MIGRATE_PARAM_COMPRESSION_MT_THREADS

virDomainMigrate* params field: the number of compression threads for multithread compression as VIR_TYPED_PARAM_INT.

### `VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE`

    #define VIR_MIGRATE_PARAM_COMPRESSION_XBZRLE_CACHE

virDomainMigrate* params field: the size of page cache for xbzrle compression as VIR_TYPED_PARAM_ULLONG.

### `VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL`

    #define VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL

virDomainMigrate* params field: the level of compression for zlib as VIR_TYPED_PARAM_INT. Accepted values are in range 0-9. 0 is no compression, 1 is maximum speed and 9 is maximum compression.

### `VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL`

    #define VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL

virDomainMigrate* params field: the level of compression for zstd as VIR_TYPED_PARAM_INT. Accepted values are in range 0-20. 0 is no compression, 1 is maximum speed and 20 is maximum compression.

### `VIR_MIGRATE_PARAM_DEST_NAME`

    #define VIR_MIGRATE_PARAM_DEST_NAME

virDomainMigrate* params field: the name to be used for the domain on the destination host as VIR_TYPED_PARAM_STRING. Omitting this parameter keeps the domain name the same. This field is only allowed to be used with hypervisors that support domain renaming during migration.

### `VIR_MIGRATE_PARAM_DEST_XML`

    #define VIR_MIGRATE_PARAM_DEST_XML

virDomainMigrate* params field: the new configuration to be used for the domain on the destination host as VIR_TYPED_PARAM_STRING. The configuration must include an identical set of virtual devices, to ensure a stable guest ABI across migration. Only parameters related to host side configuration can be changed in the XML. Hypervisors which support this field will forbid migration if the provided XML would cause a change in the guest ABI. This field cannot be used to rename the domain during migration (use VIR_MIGRATE_PARAM_DEST_NAME field for that purpose). Domain name in the destination XML must match the original domain name. Omitting this parameter keeps the original domain configuration. Using this field with hypervisors that do not support changing domain configuration during migration will result in a failure.

### `VIR_MIGRATE_PARAM_DISKS_PORT`

    #define VIR_MIGRATE_PARAM_DISKS_PORT

virDomainMigrate* params field: port that destination server should use for incoming disks migration. Type is VIR_TYPED_PARAM_INT. If set to 0 or omitted, libvirt will choose a suitable default. At the moment this is only supported by the QEMU driver.

### `VIR_MIGRATE_PARAM_DISKS_URI`

    #define VIR_MIGRATE_PARAM_DISKS_URI

virDomainMigrate* params field: URI used for incoming disks migration. Type is VIR_TYPED_PARAM_STRING. Only schemes "tcp" and "unix" are accepted. TCP URI can currently only provide a server and port to listen on (and connect to), UNIX URI may only provide a path component for a UNIX socket. This is currently only supported by the QEMU driver. UNIX URI is only usable if the management application makes sure that socket created with this name on the destination will be reachable from the source under the same exact path.

### `VIR_MIGRATE_PARAM_GRAPHICS_URI`

    #define VIR_MIGRATE_PARAM_GRAPHICS_URI

virDomainMigrate* params field: URI to use for migrating client's connection to domain's graphical console as VIR_TYPED_PARAM_STRING. If specified, the client will be asked to automatically reconnect using these parameters instead of the automatically computed ones. This can be useful if, e.g., the client does not have a direct access to the network virtualization hosts are connected to and needs to connect through a proxy. The URI is formed as follows: protocol://hostname[:port]/[?parameters] where protocol is either "spice" or "vnc" and parameters is a list of protocol specific parameters separated by '&'. Currently recognized parameters are "tlsPort" and "tlsSubject". For example, spice://target.host.com:1234/?tlsPort=4567

### `VIR_MIGRATE_PARAM_LISTEN_ADDRESS`

    #define VIR_MIGRATE_PARAM_LISTEN_ADDRESS

virDomainMigrate* params field: The listen address that hypervisor on the destination side should bind to for incoming migration. Both IPv4 and IPv6 addresses are accepted as well as hostnames (the resolving is done on destination). Some hypervisors do not support this feature and will return an error if this field is used.

### `VIR_MIGRATE_PARAM_MIGRATE_DISKS`

    #define VIR_MIGRATE_PARAM_MIGRATE_DISKS

virDomainMigrate* params multiple field: The multiple values that list the block devices to be migrated. At the moment this is only supported by the QEMU driver but not for the tunnelled migration.

### `VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS`

    #define VIR_MIGRATE_PARAM_PARALLEL_CONNECTIONS

virDomainMigrate* params field: number of connections used during parallel migration. As VIR_TYPED_PARAM_INT.

### `VIR_MIGRATE_PARAM_PERSIST_XML`

    #define VIR_MIGRATE_PARAM_PERSIST_XML

virDomainMigrate* params field: the new persistent configuration to be used for the domain on the destination host as VIR_TYPED_PARAM_STRING. This field cannot be used to rename the domain during migration (use VIR_MIGRATE_PARAM_DEST_NAME field for that purpose). Domain name in the destination XML must match the original domain name. Omitting this parameter keeps the original domain persistent configuration. Using this field with hypervisors that do not support changing domain configuration during migration will result in a failure.

### `VIR_MIGRATE_PARAM_TLS_DESTINATION`

    #define VIR_MIGRATE_PARAM_TLS_DESTINATION

virDomainMigrate* params field: override the destination host name used for TLS verification. As VIR_TYPED_PARAM_STRING. Normally the TLS certificate from the destination host must match the host's name for TLS verification to succeed. When the certificate does not match the destination hostname and the expected certificate's hostname is known, this parameter can be used to pass this expected hostname when starting the migration.

### `VIR_MIGRATE_PARAM_URI`

    #define VIR_MIGRATE_PARAM_URI

virDomainMigrate* params field: URI to use for initiating domain migration as VIR_TYPED_PARAM_STRING. It takes a hypervisor specific format. The uri_transports element of the hypervisor capabilities XML includes details of the supported URI schemes. When omitted libvirt will auto-generate suitable default URI. It is typically only necessary to specify this URI if the destination host has multiple interfaces and a specific interface is required to transmit migration data. This field may not be used when VIR_MIGRATE_TUNNELLED flag is set.

### `VIR_PERF_PARAM_ALIGNMENT_FAULTS`

    #define VIR_PERF_PARAM_ALIGNMENT_FAULTS

Macro for typed parameter name that represents alignment_faults perf event which can be used to measure the count of alignment faults by applications running on the platform. It corresponds to the "perf.alignment_faults" field in the *Stats APIs.

### `VIR_PERF_PARAM_BRANCH_INSTRUCTIONS`

    #define VIR_PERF_PARAM_BRANCH_INSTRUCTIONS

Macro for typed parameter name that represents branch_instructions perf event which can be used to measure the count of branch instructions by applications running on the platform. It corresponds to the "perf.branch_instructions" field in the *Stats APIs.

### `VIR_PERF_PARAM_BRANCH_MISSES`

    #define VIR_PERF_PARAM_BRANCH_MISSES

Macro for typed parameter name that represents branch_misses perf event which can be used to measure the count of branch misses by applications running on the platform. It corresponds to the "perf.branch_misses" field in the *Stats APIs.

### `VIR_PERF_PARAM_BUS_CYCLES`

    #define VIR_PERF_PARAM_BUS_CYCLES

Macro for typed parameter name that represents bus_cycles perf event which can be used to measure the count of bus cycles by applications running on the platform. It corresponds to the "perf.bus_cycles" field in the *Stats APIs.

### `VIR_PERF_PARAM_CACHE_MISSES`

    #define VIR_PERF_PARAM_CACHE_MISSES

Macro for typed parameter name that represents cache_misses perf event which can be used to measure the count of cache misses by applications running on the platform. It corresponds to the "perf.cache_misses" field in the *Stats APIs.

### `VIR_PERF_PARAM_CACHE_REFERENCES`

    #define VIR_PERF_PARAM_CACHE_REFERENCES

Macro for typed parameter name that represents cache_references perf event which can be used to measure the count of cache hits by applications running on the platform. It corresponds to the "perf.cache_references" field in the *Stats APIs.

### `VIR_PERF_PARAM_CMT`

    #define VIR_PERF_PARAM_CMT

Macro for typed parameter name that represents CMT perf event which can be used to measure the usage of cache (bytes) by applications running on the platform. It corresponds to the "perf.cmt" field in the *Stats APIs.

### `VIR_PERF_PARAM_CONTEXT_SWITCHES`

    #define VIR_PERF_PARAM_CONTEXT_SWITCHES

Macro for typed parameter name that represents context_switches perf event which can be used to measure the count of context switches by applications running on the platform. It corresponds to the "perf.context_switches" field in the *Stats APIs.

### `VIR_PERF_PARAM_CPU_CLOCK`

    #define VIR_PERF_PARAM_CPU_CLOCK

Macro for typed parameter name that represents cpu_clock perf event which can be used to measure the count of cpu clock time by applications running on the platform. It corresponds to the "perf.cpu_clock" field in the *Stats APIs.

### `VIR_PERF_PARAM_CPU_CYCLES`

    #define VIR_PERF_PARAM_CPU_CYCLES

Macro for typed parameter name that represents cpu_cycles perf event describing the total/elapsed cpu cycles. This can be used to measure how many cpu cycles one instruction needs. It corresponds to the "perf.cpu_cycles" field in the *Stats APIs.

### `VIR_PERF_PARAM_CPU_MIGRATIONS`

    #define VIR_PERF_PARAM_CPU_MIGRATIONS

Macro for typed parameter name that represents cpu_migrations perf event which can be used to measure the count of cpu migrations by applications running on the platform. It corresponds to the "perf.cpu_migrations" field in the *Stats APIs.

### `VIR_PERF_PARAM_EMULATION_FAULTS`

    #define VIR_PERF_PARAM_EMULATION_FAULTS

Macro for typed parameter name that represents emulation_faults perf event which can be used to measure the count of emulation faults by applications running on the platform. It corresponds to the "perf.emulation_faults" field in the *Stats APIs.

### `VIR_PERF_PARAM_INSTRUCTIONS`

    #define VIR_PERF_PARAM_INSTRUCTIONS

Macro for typed parameter name that represents instructions perf event which can be used to measure the count of instructions by applications running on the platform. It corresponds to the "perf.instructions" field in the *Stats APIs.

### `VIR_PERF_PARAM_MBML`

    #define VIR_PERF_PARAM_MBML

Macro for typed parameter name that represents MBML perf event which can be used to monitor the amount of data (bytes/s) sent through the memory controller on the socket. It corresponds to the "perf.mbml" field in the *Stats APIs.

### `VIR_PERF_PARAM_MBMT`

    #define VIR_PERF_PARAM_MBMT

Macro for typed parameter name that represents MBMT perf event which can be used to monitor total system bandwidth (bytes/s) from one level of cache to another. It corresponds to the "perf.mbmt" field in the *Stats APIs.

### `VIR_PERF_PARAM_PAGE_FAULTS`

    #define VIR_PERF_PARAM_PAGE_FAULTS

Macro for typed parameter name that represents page_faults perf event which can be used to measure the count of page faults by applications running on the platform. It corresponds to the "perf.page_faults" field in the *Stats APIs.

### `VIR_PERF_PARAM_PAGE_FAULTS_MAJ`

    #define VIR_PERF_PARAM_PAGE_FAULTS_MAJ

Macro for typed parameter name that represents page_faults_maj perf event which can be used to measure the count of major page faults by applications running on the platform. It corresponds to the "perf.page_faults_maj" field in the *Stats APIs.

### `VIR_PERF_PARAM_PAGE_FAULTS_MIN`

    #define VIR_PERF_PARAM_PAGE_FAULTS_MIN

Macro for typed parameter name that represents page_faults_min perf event which can be used to measure the count of minor page faults by applications running on the platform. It corresponds to the "perf.page_faults_min" field in the *Stats APIs.

### `VIR_PERF_PARAM_REF_CPU_CYCLES`

    #define VIR_PERF_PARAM_REF_CPU_CYCLES

Macro for typed parameter name that represents ref_cpu_cycles perf event which can be used to measure the count of total cpu cycles not affected by CPU frequency scaling by applications running on the platform. It corresponds to the "perf.ref_cpu_cycles" field in the *Stats APIs.

### `VIR_PERF_PARAM_STALLED_CYCLES_BACKEND`

    #define VIR_PERF_PARAM_STALLED_CYCLES_BACKEND

Macro for typed parameter name that represents stalled_cycles_backend perf event which can be used to measure the count of stalled cpu cycles in the backend of the instruction processor pipeline by application running on the platform. It corresponds to the "perf.stalled_cycles_backend" field in the *Stats APIs.

### `VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND`

    #define VIR_PERF_PARAM_STALLED_CYCLES_FRONTEND

Macro for typed parameter name that represents stalled_cycles_frontend perf event which can be used to measure the count of stalled cpu cycles in the frontend of the instruction processor pipeline by applications running on the platform. It corresponds to the "perf.stalled_cycles_frontend" field in the *Stats APIs.

### `VIR_PERF_PARAM_TASK_CLOCK`

    #define VIR_PERF_PARAM_TASK_CLOCK

Macro for typed parameter name that represents task_clock perf event which can be used to measure the count of task clock time by applications running on the platform. It corresponds to the "perf.task_clock" field in the *Stats APIs.

### `VIR_UNUSE_CPU`

    #define VIR_UNUSE_CPU

This macro is to be used in conjunction with virDomainPinVcpu() API. It resets the bit (CPU not usable) of the related cpu in cpumap.

### `VIR_USE_CPU`

    #define VIR_USE_CPU

This macro is to be used in conjunction with virDomainPinVcpu() API. It sets the bit (CPU usable) of the related cpu in cpumap.

### `_virBlkioParameter`

    #define _virBlkioParameter

### `_virMemoryParameter`

    #define _virMemoryParameter

### `_virSchedParameter`

    #define _virSchedParameter

### Types

### `virBlkioParameter`

    struct virBlkioParameter {

char field[VIR_TYPED_PARAM_FIELD_LENGTH] | field | parameter name
int | type | parameter type, virTypedParameterType
union {
int | i | type is INT
unsigned int | ui | type is UINT
long long int | l | type is LLONG
unsigned long long int | ul | type is ULLONG
double | d | type is DOUBLE
char | b | type is BOOLEAN
char * | s | type is STRING, may not be NULL
} | value | parameter value |

    }

### `virBlkioParameterPtr`

    typedef virBlkioParameter * virBlkioParameterPtr;

a virBlkioParameterPtr is a pointer to a virBlkioParameter structure. Provided for backwards compatibility; virTypedParameterPtr is the preferred alias.

### `virBlkioParameterType`

A blkio parameter field type. Provided for backwards compatibility; virTypedParameterType is the preferred enum

    enum virBlkioParameterType {

VIR_DOMAIN_BLKIO_PARAM_BOOLEAN | = | VIR_TYPED_PARAM_BOOLEAN
VIR_DOMAIN_BLKIO_PARAM_DOUBLE | = | VIR_TYPED_PARAM_DOUBLE
VIR_DOMAIN_BLKIO_PARAM_INT | = | VIR_TYPED_PARAM_INT
VIR_DOMAIN_BLKIO_PARAM_LLONG | = | VIR_TYPED_PARAM_LLONG
VIR_DOMAIN_BLKIO_PARAM_UINT | = | VIR_TYPED_PARAM_UINT
VIR_DOMAIN_BLKIO_PARAM_ULLONG | = | VIR_TYPED_PARAM_ULLONG

    }

### `virConnectDomainEventAgentLifecycleReason`

    enum virConnectDomainEventAgentLifecycleReason {

VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_UNKNOWN | = | 0 (0x0) | unknown state change reason
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED | = | 1 (0x1) | state changed due to domain start
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL | = | 2 (0x2) | channel state changed
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_LAST | = | 3 (0x3)

    }

### `virConnectDomainEventAgentLifecycleState`

    enum virConnectDomainEventAgentLifecycleState {

VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_CONNECTED | = | 1 (0x1) | agent connected
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_DISCONNECTED | = | 2 (0x2) | agent disconnected
VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_STATE_LAST | = | 3 (0x3)

    }

### `virConnectDomainEventBlockJobStatus`

Tracks status of a virDomainBlockPull(), virDomainBlockRebase(), virDomainBlockCopy(), or virDomainBlockCommit() operation

    enum virConnectDomainEventBlockJobStatus {

VIR_DOMAIN_BLOCK_JOB_COMPLETED | = | 0 (0x0)
VIR_DOMAIN_BLOCK_JOB_FAILED | = | 1 (0x1)
VIR_DOMAIN_BLOCK_JOB_CANCELED | = | 2 (0x2)
VIR_DOMAIN_BLOCK_JOB_READY | = | 3 (0x3)
VIR_DOMAIN_BLOCK_JOB_LAST | = | 4 (0x4)

    }

### `virConnectDomainEventDiskChangeReason`

The reason describing why this callback is called

    enum virConnectDomainEventDiskChangeReason {

VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START | = | 0 (0x0) | Removable media changed to empty according to startup policy as source was missing. oldSrcPath is set, newSrcPath is NULL
VIR_DOMAIN_EVENT_DISK_DROP_MISSING_ON_START | = | 1 (0x1) | Disk was dropped from domain as source file was missing. oldSrcPath is set, newSrcPath is NULL
VIR_DOMAIN_EVENT_DISK_CHANGE_LAST | = | 2 (0x2)

    }

### `virConnectGetAllDomainStatsFlags`

    enum virConnectGetAllDomainStatsFlags {

VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE | = | VIR_CONNECT_LIST_DOMAINS_ACTIVE
VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE | = | VIR_CONNECT_LIST_DOMAINS_INACTIVE
VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER | = | VIR_CONNECT_LIST_DOMAINS_OTHER
VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED | = | VIR_CONNECT_LIST_DOMAINS_PAUSED
VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT | = | VIR_CONNECT_LIST_DOMAINS_PERSISTENT
VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING | = | VIR_CONNECT_LIST_DOMAINS_RUNNING
VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF | = | VIR_CONNECT_LIST_DOMAINS_SHUTOFF
VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT | = | VIR_CONNECT_LIST_DOMAINS_TRANSIENT
VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT | = | 536870912 (0x20000000; 1 << 29) | report statistics that can be obtained immediately without any blocking
VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING | = | 1073741824 (0x40000000; 1 << 30) | include backing chain for block stats
VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS | = | 2147483648 (0x80000000; 1 << 31) | enforce requested stats

    }

### `virConnectListAllDomainsFlags`

Flags used to tune which domains are listed by virConnectListAllDomains(). Note that these flags come in groups; if all bits from a group are 0, then that group is not used to filter results.

    enum virConnectListAllDomainsFlags {

VIR_CONNECT_LIST_DOMAINS_ACTIVE | = | 1 (0x1; 1 << 0)
VIR_CONNECT_LIST_DOMAINS_INACTIVE | = | 2 (0x2; 1 << 1)
VIR_CONNECT_LIST_DOMAINS_PERSISTENT | = | 4 (0x4; 1 << 2)
VIR_CONNECT_LIST_DOMAINS_TRANSIENT | = | 8 (0x8; 1 << 3)
VIR_CONNECT_LIST_DOMAINS_RUNNING | = | 16 (0x10; 1 << 4)
VIR_CONNECT_LIST_DOMAINS_PAUSED | = | 32 (0x20; 1 << 5)
VIR_CONNECT_LIST_DOMAINS_SHUTOFF | = | 64 (0x40; 1 << 6)
VIR_CONNECT_LIST_DOMAINS_OTHER | = | 128 (0x80; 1 << 7)
VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE | = | 256 (0x100; 1 << 8)
VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE | = | 512 (0x200; 1 << 9)
VIR_CONNECT_LIST_DOMAINS_AUTOSTART | = | 1024 (0x400; 1 << 10)
VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART | = | 2048 (0x800; 1 << 11)
VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT | = | 4096 (0x1000; 1 << 12)
VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT | = | 8192 (0x2000; 1 << 13)
VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT | = | 16384 (0x4000; 1 << 14)
VIR_CONNECT_LIST_DOMAINS_NO_CHECKPOINT | = | 32768 (0x8000; 1 << 15)

    }

### `virDomain`

    struct virDomain {

The content of this structure is not made public by the API

    }

### `virDomainAbortJobFlagsValues`

Flags OR'ed together to provide specific behavior when aborting a domain job.

    enum virDomainAbortJobFlagsValues {

VIR_DOMAIN_ABORT_JOB_POSTCOPY | = | 1 (0x1; 1 << 0) | Interrupt post-copy migration. Since migration in a post-copy phase cannot be aborted without losing the domain (none of the hosts involved in migration has a complete state of the domain), the migration will be suspended and it can later be resumed using virDomainMigrate* APIs with VIR_MIGRATE_POSTCOPY_RESUME flag.

    }

### `virDomainAgentResponseTimeoutValues`

    enum virDomainAgentResponseTimeoutValues {

VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK | = | -2 (-0x2)
VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT | = | -1 (-0x1)
VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT | = | 0 (0x0)

    }

### `virDomainAuthorizedSSHKeysSetFlags`

    enum virDomainAuthorizedSSHKeysSetFlags {

VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND | = | 1 (0x1; 1 << 0) | don't truncate file, just append
VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE | = | 2 (0x2; 1 << 1) | remove keys, instead of adding them

    }

### `virDomainBackupBeginFlags`

    enum virDomainBackupBeginFlags {

VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL | = | 1 (0x1; 1 << 0) | reuse separately provided images

    }

### `virDomainBlockCommitFlags`

Flags available for virDomainBlockCommit().

    enum virDomainBlockCommitFlags {

VIR_DOMAIN_BLOCK_COMMIT_SHALLOW | = | 1 (0x1; 1 << 0) | NULL base means next backing file, not whole chain
VIR_DOMAIN_BLOCK_COMMIT_DELETE | = | 2 (0x2; 1 << 1) | Delete any files that are now invalid after their contents have been committed
VIR_DOMAIN_BLOCK_COMMIT_ACTIVE | = | 4 (0x4; 1 << 2) | Allow a two-phase commit when top is the active layer
VIR_DOMAIN_BLOCK_COMMIT_RELATIVE | = | 8 (0x8; 1 << 3) | keep the backing chain referenced using relative names
VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES | = | 16 (0x10; 1 << 4) | bandwidth in bytes/s instead of MiB/s

    }

### `virDomainBlockCopyFlags`

Flags available for virDomainBlockCopy().

    enum virDomainBlockCopyFlags {

VIR_DOMAIN_BLOCK_COPY_SHALLOW | = | 1 (0x1; 1 << 0) | Limit copy to top of source backing chain
VIR_DOMAIN_BLOCK_COPY_REUSE_EXT | = | 2 (0x2; 1 << 1) | Reuse existing external file for a copy
VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB | = | 4 (0x4; 1 << 2) | Don't force usage of recoverable job for the copy operation
VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES | = | 8 (0x8; 1 << 3) | Force the copy job to synchronously propagate guest writes into the destination image, so that the copy is guaranteed to converge

    }

### `virDomainBlockInfo`

    struct virDomainBlockInfo {

unsigned long long | capacity | logical size in bytes of the image (how much storage the guest will see)
unsigned long long | allocation | host storage in bytes occupied by the image (such as highest allocated extent if there are no holes, similar to 'du')
unsigned long long | physical | host physical size in bytes of the image container (last offset, similar to 'ls')

    }

### `virDomainBlockInfoPtr`

    typedef virDomainBlockInfo * virDomainBlockInfoPtr;

### `virDomainBlockJobAbortFlags`

VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC: Request only, do not wait for completion VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT: Pivot to new file when ending a copy or active commit job

    enum virDomainBlockJobAbortFlags {

VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC | = | 1 (0x1; 1 << 0)
VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT | = | 2 (0x2; 1 << 1)

    }

### `virDomainBlockJobCursor`

    typedef unsigned long long virDomainBlockJobCursor;

An iterator for monitoring block job operations

### `virDomainBlockJobInfo`

    struct virDomainBlockJobInfo {

int | type | virDomainBlockJobType
unsigned long | bandwidth | The following fields provide an indication of block job progress. `cur` indicates the current position and will be between 0 and `end`. `end` is the final cursor position for this operation and represents completion. To approximate progress, divide `cur` by `end`.
virDomainBlockJobCursor | cur
virDomainBlockJobCursor | end

    }

### `virDomainBlockJobInfoFlags`

Flags for use with virDomainGetBlockJobInfo

    enum virDomainBlockJobInfoFlags {

VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES | = | 1 (0x1; 1 << 0) | bandwidth in bytes/s instead of MiB/s

    }

### `virDomainBlockJobInfoPtr`

    typedef virDomainBlockJobInfo * virDomainBlockJobInfoPtr;

### `virDomainBlockJobSetSpeedFlags`

Flags for use with virDomainBlockJobSetSpeed

    enum virDomainBlockJobSetSpeedFlags {

VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES | = | 1 (0x1; 1 << 0) | bandwidth in bytes/s instead of MiB/s

    }

### `virDomainBlockJobType`

Describes various possible block jobs.

    enum virDomainBlockJobType {

VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN | = | 0 (0x0) | Placeholder
VIR_DOMAIN_BLOCK_JOB_TYPE_PULL | = | 1 (0x1) | Block Pull (virDomainBlockPull, or virDomainBlockRebase without flags), job ends on completion
VIR_DOMAIN_BLOCK_JOB_TYPE_COPY | = | 2 (0x2) | Block Copy (virDomainBlockCopy, or virDomainBlockRebase with flags), job exists as long as mirroring is active
VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT | = | 3 (0x3) | Block Commit (virDomainBlockCommit without flags), job ends on completion
VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT | = | 4 (0x4) | Active Block Commit (virDomainBlockCommit with flags), job exists as long as sync is active
VIR_DOMAIN_BLOCK_JOB_TYPE_BACKUP | = | 5 (0x5) | Backup (virDomainBackupBegin)
VIR_DOMAIN_BLOCK_JOB_TYPE_LAST | = | 6 (0x6)

    }

### `virDomainBlockPullFlags`

Flags for use with virDomainBlockPull (values chosen to be a subset of the flags for virDomainBlockRebase)

    enum virDomainBlockPullFlags {

VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES | = | 64 (0x40; 1 << 6) | bandwidth in bytes/s instead of MiB/s

    }

### `virDomainBlockRebaseFlags`

Flags available for virDomainBlockRebase().

    enum virDomainBlockRebaseFlags {

VIR_DOMAIN_BLOCK_REBASE_SHALLOW | = | 1 (0x1; 1 << 0) | Limit copy to top of source backing chain
VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT | = | 2 (0x2; 1 << 1) | Reuse existing external file for a copy
VIR_DOMAIN_BLOCK_REBASE_COPY_RAW | = | 4 (0x4; 1 << 2) | Make destination file raw
VIR_DOMAIN_BLOCK_REBASE_COPY | = | 8 (0x8; 1 << 3) | Start a copy job
VIR_DOMAIN_BLOCK_REBASE_RELATIVE | = | 16 (0x10; 1 << 4) | Keep backing chain referenced using relative names
VIR_DOMAIN_BLOCK_REBASE_COPY_DEV | = | 32 (0x20; 1 << 5) | Treat destination as block device instead of file
VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES | = | 64 (0x40; 1 << 6) | bandwidth in bytes/s instead of MiB/s

    }

### `virDomainBlockResizeFlags`

Flags available for virDomainBlockResize().

    enum virDomainBlockResizeFlags {

VIR_DOMAIN_BLOCK_RESIZE_BYTES | = | 1 (0x1; 1 << 0) | size in bytes instead of KiB
VIR_DOMAIN_BLOCK_RESIZE_CAPACITY | = | 2 (0x2; 1 << 1) | resize to full the capacity of the source

    }

### `virDomainBlockStatsPtr`

    typedef virDomainBlockStatsStruct * virDomainBlockStatsPtr;

A pointer to a virDomainBlockStats structure

### `virDomainBlockStatsStruct`

    struct virDomainBlockStatsStruct {

long long | rd_req | number of read requests
long long | rd_bytes | number of read bytes
long long | wr_req | number of write requests
long long | wr_bytes | number of written bytes
long long | errs | In Xen this returns the mysterious 'oo_req'.

    }

### `virDomainBlockedReason`

    enum virDomainBlockedReason {

VIR_DOMAIN_BLOCKED_UNKNOWN | = | 0 (0x0) | the reason is unknown
VIR_DOMAIN_BLOCKED_LAST | = | 1 (0x1)

    }

### `virDomainChannelFlags`

    enum virDomainChannelFlags {

VIR_DOMAIN_CHANNEL_FORCE | = | 1 (0x1; 1 << 0) | abort a (possibly) active channel connection to force a new connection

    }

### `virDomainConsoleFlags`

    enum virDomainConsoleFlags {

VIR_DOMAIN_CONSOLE_FORCE | = | 1 (0x1; 1 << 0) | abort a (possibly) active console connection to force a new connection
VIR_DOMAIN_CONSOLE_SAFE | = | 2 (0x2; 1 << 1) | check if the console driver supports safe console operations

    }

### `virDomainControlErrorReason`

Reason for the error state.

    enum virDomainControlErrorReason {

VIR_DOMAIN_CONTROL_ERROR_REASON_NONE | = | 0 (0x0) | server didn't provide a reason
VIR_DOMAIN_CONTROL_ERROR_REASON_UNKNOWN | = | 1 (0x1) | unknown reason for the error
VIR_DOMAIN_CONTROL_ERROR_REASON_MONITOR | = | 2 (0x2) | monitor connection is broken
VIR_DOMAIN_CONTROL_ERROR_REASON_INTERNAL | = | 3 (0x3) | error caused due to internal failure in libvirt
VIR_DOMAIN_CONTROL_ERROR_REASON_LAST | = | 4 (0x4)

    }

### `virDomainControlInfo`

    struct virDomainControlInfo {

unsigned int | state | control state, one of virDomainControlState
unsigned int | details | state details, currently 0 except for ERROR state (one of virDomainControlErrorReason)
unsigned long long | stateTime | for how long (in msec) control interface has been in current state (except for OK and ERROR states)

    }

### `virDomainControlInfoPtr`

    typedef virDomainControlInfo * virDomainControlInfoPtr;

Pointer to virDomainControlInfo structure.

### `virDomainControlState`

Current state of a control interface to the domain.

    enum virDomainControlState {

VIR_DOMAIN_CONTROL_OK | = | 0 (0x0) | operational, ready to accept commands
VIR_DOMAIN_CONTROL_JOB | = | 1 (0x1) | background job is running (can be monitored by virDomainGetJobInfo); only limited set of commands may be allowed
VIR_DOMAIN_CONTROL_OCCUPIED | = | 2 (0x2) | occupied by a running command
VIR_DOMAIN_CONTROL_ERROR | = | 3 (0x3) | unusable, domain cannot be fully operated, possible reason is provided in the details field
VIR_DOMAIN_CONTROL_LAST | = | 4 (0x4)

    }

### `virDomainCoreDumpFlags`

Domain core dump flags.

    enum virDomainCoreDumpFlags {

VIR_DUMP_CRASH | = | 1 (0x1; 1 << 0) | crash after dump
VIR_DUMP_LIVE | = | 2 (0x2; 1 << 1) | live dump
VIR_DUMP_BYPASS_CACHE | = | 4 (0x4; 1 << 2) | avoid file system cache pollution
VIR_DUMP_RESET | = | 8 (0x8; 1 << 3) | reset domain after dump finishes
VIR_DUMP_MEMORY_ONLY | = | 16 (0x10; 1 << 4) | use dump-guest-memory

    }

### `virDomainCoreDumpFormat`

Values for specifying different formats of domain core dumps.

    enum virDomainCoreDumpFormat {

VIR_DOMAIN_CORE_DUMP_FORMAT_RAW | = | 0 (0x0) | dump guest memory in raw format
VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB | = | 1 (0x1) | kdump-compressed format, with zlib compression
VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_LZO | = | 2 (0x2) | kdump-compressed format, with lzo compression
VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_SNAPPY | = | 3 (0x3) | kdump-compressed format, with snappy compression
VIR_DOMAIN_CORE_DUMP_FORMAT_WIN_DMP | = | 4 (0x4) | Windows full crashdump format
VIR_DOMAIN_CORE_DUMP_FORMAT_LAST | = | 5 (0x5) | NB: this enum value will increase over time as new formats are added to the libvirt API. It reflects the last format supported by this version of the libvirt API.

    }

### `virDomainCrashedReason`

    enum virDomainCrashedReason {

VIR_DOMAIN_CRASHED_UNKNOWN | = | 0 (0x0) | crashed for unknown reason
VIR_DOMAIN_CRASHED_PANICKED | = | 1 (0x1) | domain panicked
VIR_DOMAIN_CRASHED_LAST | = | 2 (0x2)

    }

### `virDomainCreateFlags`

Flags OR'ed together to provide specific behaviour when creating a Domain.

    enum virDomainCreateFlags {

VIR_DOMAIN_NONE | = | 0 (0x0) | Default behavior
VIR_DOMAIN_START_PAUSED | = | 1 (0x1; 1 << 0) | Launch guest in paused state
VIR_DOMAIN_START_AUTODESTROY | = | 2 (0x2; 1 << 1) | Automatically kill guest when virConnectPtr is closed
VIR_DOMAIN_START_BYPASS_CACHE | = | 4 (0x4; 1 << 2) | Avoid file system cache pollution
VIR_DOMAIN_START_FORCE_BOOT | = | 8 (0x8; 1 << 3) | Boot, discarding any managed save
VIR_DOMAIN_START_VALIDATE | = | 16 (0x10; 1 << 4) | Validate the XML document against schema
VIR_DOMAIN_START_RESET_NVRAM | = | 32 (0x20; 1 << 5) | Re-initialize NVRAM from template

    }

### `virDomainDefineFlags`

    enum virDomainDefineFlags {

VIR_DOMAIN_DEFINE_VALIDATE | = | 1 (0x1; 1 << 0) | Validate the XML document against schema

    }

### `virDomainDestroyFlagsValues`

Flags used to provide specific behaviour to the virDomainDestroyFlags() function

    enum virDomainDestroyFlagsValues {

VIR_DOMAIN_DESTROY_DEFAULT | = | 0 (0x0) | Default behavior - could lead to data loss!!
VIR_DOMAIN_DESTROY_GRACEFUL | = | 1 (0x1; 1 << 0) | only SIGTERM, no SIGKILL
VIR_DOMAIN_DESTROY_REMOVE_LOGS | = | 2 (0x2; 1 << 1) | remove VM logs on destroy

    }

### `virDomainDeviceModifyFlags`

    enum virDomainDeviceModifyFlags {

VIR_DOMAIN_DEVICE_MODIFY_CONFIG | = | VIR_DOMAIN_AFFECT_CONFIG | See virDomainModificationImpact
VIR_DOMAIN_DEVICE_MODIFY_CURRENT | = | VIR_DOMAIN_AFFECT_CURRENT | See virDomainModificationImpact
VIR_DOMAIN_DEVICE_MODIFY_LIVE | = | VIR_DOMAIN_AFFECT_LIVE | See virDomainModificationImpact
VIR_DOMAIN_DEVICE_MODIFY_FORCE | = | 4 (0x4; 1 << 2) | Forcibly modify device (ex. force eject a cdrom)

    }

### `virDomainDirtyRateCalcFlags`

Flags OR'ed together to provide specific behaviour when calculating dirty page rate for a Domain

    enum virDomainDirtyRateCalcFlags {

VIR_DOMAIN_DIRTYRATE_MODE_PAGE_SAMPLING | = | 0 (0x0) | default mode - page-sampling
VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_BITMAP | = | 1 (0x1; 1 << 0) | dirty-bitmap mode
VIR_DOMAIN_DIRTYRATE_MODE_DIRTY_RING | = | 2 (0x2; 1 << 1) | dirty-ring mode

    }

### `virDomainDirtyRateStatus`

Details on the cause of a dirty rate calculation status.

    enum virDomainDirtyRateStatus {

VIR_DOMAIN_DIRTYRATE_UNSTARTED | = | 0 (0x0) | the dirtyrate calculation has not been started
VIR_DOMAIN_DIRTYRATE_MEASURING | = | 1 (0x1) | the dirtyrate calculation is measuring
VIR_DOMAIN_DIRTYRATE_MEASURED | = | 2 (0x2) | the dirtyrate calculation is completed
VIR_DOMAIN_DIRTYRATE_LAST | = | 3 (0x3)

    }

### `virDomainDiskError`

    struct virDomainDiskError {

char * | disk | disk target
int | error | virDomainDiskErrorCode

    }

### `virDomainDiskErrorCode`

Disk I/O error.

    enum virDomainDiskErrorCode {

VIR_DOMAIN_DISK_ERROR_NONE | = | 0 (0x0) | no error
VIR_DOMAIN_DISK_ERROR_UNSPEC | = | 1 (0x1) | unspecified I/O error
VIR_DOMAIN_DISK_ERROR_NO_SPACE | = | 2 (0x2) | no space left on the device
VIR_DOMAIN_DISK_ERROR_LAST | = | 3 (0x3)

    }

### `virDomainDiskErrorPtr`

    typedef virDomainDiskError * virDomainDiskErrorPtr;

### `virDomainEventCrashedDetailType`

Details on the cause of a 'crashed' lifecycle event

    enum virDomainEventCrashedDetailType {

VIR_DOMAIN_EVENT_CRASHED_PANICKED | = | 0 (0x0) | Guest was panicked
VIR_DOMAIN_EVENT_CRASHED_CRASHLOADED | = | 1 (0x1) | Guest was crashloaded
VIR_DOMAIN_EVENT_CRASHED_LAST | = | 2 (0x2)

    }

### `virDomainEventDefinedDetailType`

Details on the cause of a 'defined' lifecycle event

    enum virDomainEventDefinedDetailType {

VIR_DOMAIN_EVENT_DEFINED_ADDED | = | 0 (0x0) | Newly created config file
VIR_DOMAIN_EVENT_DEFINED_UPDATED | = | 1 (0x1) | Changed config file
VIR_DOMAIN_EVENT_DEFINED_RENAMED | = | 2 (0x2) | Domain was renamed
VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT | = | 3 (0x3) | Config was restored from a snapshot
VIR_DOMAIN_EVENT_DEFINED_LAST | = | 4 (0x4)

    }

### `virDomainEventGraphicsAddress`

    struct virDomainEventGraphicsAddress {

int | family | Address family, virDomainEventGraphicsAddressType
char * | node | Address of node (eg IP address, or UNIX path)
char * | service | Service name/number (eg TCP port, or NULL)

    }

### `virDomainEventGraphicsAddressPtr`

    typedef virDomainEventGraphicsAddress * virDomainEventGraphicsAddressPtr;

### `virDomainEventGraphicsAddressType`

The type of address for the connection

    enum virDomainEventGraphicsAddressType {

VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4 | = | 0 (0x0) | IPv4 address
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6 | = | 1 (0x1) | IPv6 address
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX | = | 2 (0x2) | UNIX socket path
VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST | = | 3 (0x3)

    }

### `virDomainEventGraphicsPhase`

The phase of the graphics client connection

    enum virDomainEventGraphicsPhase {

VIR_DOMAIN_EVENT_GRAPHICS_CONNECT | = | 0 (0x0) | Initial socket connection established
VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE | = | 1 (0x1) | Authentication & setup completed
VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT | = | 2 (0x2) | Final socket disconnection
VIR_DOMAIN_EVENT_GRAPHICS_LAST | = | 3 (0x3)

    }

### `virDomainEventGraphicsSubject`

    struct virDomainEventGraphicsSubject {

int | nidentity | Number of identities in arra
virDomainEventGraphicsSubjectIdentityPtr | identities | Array of identities for subject

    }

### `virDomainEventGraphicsSubjectIdentity`

    struct virDomainEventGraphicsSubjectIdentity {

char * | type | Type of identity
char * | name | Identity value

    }

### `virDomainEventGraphicsSubjectIdentityPtr`

    typedef virDomainEventGraphicsSubjectIdentity * virDomainEventGraphicsSubjectIdentityPtr;

### `virDomainEventGraphicsSubjectPtr`

    typedef virDomainEventGraphicsSubject * virDomainEventGraphicsSubjectPtr;

### `virDomainEventID`

An enumeration of supported eventId parameters for virConnectDomainEventRegisterAny(). Each event id determines which signature of callback function will be used.

    enum virDomainEventID {

VIR_DOMAIN_EVENT_ID_LIFECYCLE | = | 0 (0x0) | virConnectDomainEventCallback
VIR_DOMAIN_EVENT_ID_REBOOT | = | 1 (0x1) | virConnectDomainEventGenericCallback
VIR_DOMAIN_EVENT_ID_RTC_CHANGE | = | 2 (0x2) | virConnectDomainEventRTCChangeCallback
VIR_DOMAIN_EVENT_ID_WATCHDOG | = | 3 (0x3) | virConnectDomainEventWatchdogCallback
VIR_DOMAIN_EVENT_ID_IO_ERROR | = | 4 (0x4) | virConnectDomainEventIOErrorCallback
VIR_DOMAIN_EVENT_ID_GRAPHICS | = | 5 (0x5) | virConnectDomainEventGraphicsCallback
VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON | = | 6 (0x6) | virConnectDomainEventIOErrorReasonCallback
VIR_DOMAIN_EVENT_ID_CONTROL_ERROR | = | 7 (0x7) | virConnectDomainEventGenericCallback
VIR_DOMAIN_EVENT_ID_BLOCK_JOB | = | 8 (0x8) | virConnectDomainEventBlockJobCallback
VIR_DOMAIN_EVENT_ID_DISK_CHANGE | = | 9 (0x9) | virConnectDomainEventDiskChangeCallback
VIR_DOMAIN_EVENT_ID_TRAY_CHANGE | = | 10 (0xa) | virConnectDomainEventTrayChangeCallback
VIR_DOMAIN_EVENT_ID_PMWAKEUP | = | 11 (0xb) | virConnectDomainEventPMWakeupCallback
VIR_DOMAIN_EVENT_ID_PMSUSPEND | = | 12 (0xc) | virConnectDomainEventPMSuspendCallback
VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE | = | 13 (0xd) | virConnectDomainEventBalloonChangeCallback
VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK | = | 14 (0xe) | virConnectDomainEventPMSuspendDiskCallback
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED | = | 15 (0xf) | virConnectDomainEventDeviceRemovedCallback
VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 | = | 16 (0x10) | virConnectDomainEventBlockJobCallback
VIR_DOMAIN_EVENT_ID_TUNABLE | = | 17 (0x11) | virConnectDomainEventTunableCallback
VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE | = | 18 (0x12) | virConnectDomainEventAgentLifecycleCallback
VIR_DOMAIN_EVENT_ID_DEVICE_ADDED | = | 19 (0x13) | virConnectDomainEventDeviceAddedCallback
VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION | = | 20 (0x14) | virConnectDomainEventMigrationIterationCallback
VIR_DOMAIN_EVENT_ID_JOB_COMPLETED | = | 21 (0x15) | virConnectDomainEventJobCompletedCallback
VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED | = | 22 (0x16) | virConnectDomainEventDeviceRemovalFailedCallback
VIR_DOMAIN_EVENT_ID_METADATA_CHANGE | = | 23 (0x17) | virConnectDomainEventMetadataChangeCallback
VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD | = | 24 (0x18) | virConnectDomainEventBlockThresholdCallback
VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE | = | 25 (0x19) | virConnectDomainEventMemoryFailureCallback
VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE | = | 26 (0x1a) | virConnectDomainEventMemoryDeviceSizeChangeCallback
VIR_DOMAIN_EVENT_ID_LAST | = | 27 (0x1b) | NB: this enum value will increase over time as new events are added to the libvirt API. It reflects the last event ID supported by this version of the libvirt API.

    }

### `virDomainEventIOErrorAction`

The action that is to be taken due to an IO error occurring

    enum virDomainEventIOErrorAction {

VIR_DOMAIN_EVENT_IO_ERROR_NONE | = | 0 (0x0) | No action, IO error ignored
VIR_DOMAIN_EVENT_IO_ERROR_PAUSE | = | 1 (0x1) | Guest CPUs are paused
VIR_DOMAIN_EVENT_IO_ERROR_REPORT | = | 2 (0x2) | IO error reported to guest OS
VIR_DOMAIN_EVENT_IO_ERROR_LAST | = | 3 (0x3)

    }

### `virDomainEventPMSuspendedDetailType`

Details on the cause of a 'pmsuspended' lifecycle event

    enum virDomainEventPMSuspendedDetailType {

VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY | = | 0 (0x0) | Guest was PM suspended to memory
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK | = | 1 (0x1) | Guest was PM suspended to disk
VIR_DOMAIN_EVENT_PMSUSPENDED_LAST | = | 2 (0x2)

    }

### `virDomainEventResumedDetailType`

Details on the cause of a 'resumed' lifecycle event

    enum virDomainEventResumedDetailType {

VIR_DOMAIN_EVENT_RESUMED_UNPAUSED | = | 0 (0x0) | Normal resume due to admin unpause
VIR_DOMAIN_EVENT_RESUMED_MIGRATED | = | 1 (0x1) | Resumed for completion of migration
VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT | = | 2 (0x2) | Resumed from snapshot
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY | = | 3 (0x3) | Resumed, but migration is still running in post-copy mode
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED | = | 4 (0x4) | Running, but migration failed in post-copy
VIR_DOMAIN_EVENT_RESUMED_LAST | = | 5 (0x5)

    }

### `virDomainEventShutdownDetailType`

Details on the cause of a 'shutdown' lifecycle event

    enum virDomainEventShutdownDetailType {

VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED | = | 0 (0x0) | Guest finished shutdown sequence
VIR_DOMAIN_EVENT_SHUTDOWN_GUEST | = | 1 (0x1) | Domain finished shutting down after request from the guest itself (e.g. hardware-specific action)
VIR_DOMAIN_EVENT_SHUTDOWN_HOST | = | 2 (0x2) | Domain finished shutting down after request from the host (e.g. killed by a signal)
VIR_DOMAIN_EVENT_SHUTDOWN_LAST | = | 3 (0x3)

    }

### `virDomainEventStartedDetailType`

Details on the cause of a 'started' lifecycle event

    enum virDomainEventStartedDetailType {

VIR_DOMAIN_EVENT_STARTED_BOOTED | = | 0 (0x0) | Normal startup from boot
VIR_DOMAIN_EVENT_STARTED_MIGRATED | = | 1 (0x1) | Incoming migration from another host
VIR_DOMAIN_EVENT_STARTED_RESTORED | = | 2 (0x2) | Restored from a state file
VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT | = | 3 (0x3) | Restored from snapshot
VIR_DOMAIN_EVENT_STARTED_WAKEUP | = | 4 (0x4) | Started due to wakeup event
VIR_DOMAIN_EVENT_STARTED_LAST | = | 5 (0x5)

    }

### `virDomainEventStoppedDetailType`

Details on the cause of a 'stopped' lifecycle event

    enum virDomainEventStoppedDetailType {

VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN | = | 0 (0x0) | Normal shutdown
VIR_DOMAIN_EVENT_STOPPED_DESTROYED | = | 1 (0x1) | Forced poweroff from host
VIR_DOMAIN_EVENT_STOPPED_CRASHED | = | 2 (0x2) | Guest crashed
VIR_DOMAIN_EVENT_STOPPED_MIGRATED | = | 3 (0x3) | Migrated off to another host
VIR_DOMAIN_EVENT_STOPPED_SAVED | = | 4 (0x4) | Saved to a state file
VIR_DOMAIN_EVENT_STOPPED_FAILED | = | 5 (0x5) | Host emulator/mgmt failed
VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT | = | 6 (0x6) | offline snapshot loaded
VIR_DOMAIN_EVENT_STOPPED_LAST | = | 7 (0x7)

    }

### `virDomainEventSuspendedDetailType`

Details on the cause of a 'suspended' lifecycle event

    enum virDomainEventSuspendedDetailType {

VIR_DOMAIN_EVENT_SUSPENDED_PAUSED | = | 0 (0x0) | Normal suspend due to admin pause
VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED | = | 1 (0x1) | Suspended for offline migration
VIR_DOMAIN_EVENT_SUSPENDED_IOERROR | = | 2 (0x2) | Suspended due to a disk I/O error
VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG | = | 3 (0x3) | Suspended due to a watchdog firing
VIR_DOMAIN_EVENT_SUSPENDED_RESTORED | = | 4 (0x4) | Restored from paused state file
VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT | = | 5 (0x5) | Restored from paused snapshot
VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR | = | 6 (0x6) | Some APIs (e.g., migration, snapshot) internally need to suspend a domain. This event detail is used when resume operation at the end of such API fails.
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY | = | 7 (0x7) | suspended for post-copy migration
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED | = | 8 (0x8) | suspended after failed post-copy
VIR_DOMAIN_EVENT_SUSPENDED_LAST | = | 9 (0x9)

    }

### `virDomainEventTrayChangeReason`

The reason describing why the callback was called

    enum virDomainEventTrayChangeReason {

VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN | = | 0 (0x0)
VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE | = | 1 (0x1)
VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST | = | 2 (0x2)

    }

### `virDomainEventType`

a virDomainEventType is emitted during domain lifecycle events

    enum virDomainEventType {

VIR_DOMAIN_EVENT_DEFINED | = | 0 (0x0)
VIR_DOMAIN_EVENT_UNDEFINED | = | 1 (0x1)
VIR_DOMAIN_EVENT_STARTED | = | 2 (0x2)
VIR_DOMAIN_EVENT_SUSPENDED | = | 3 (0x3)
VIR_DOMAIN_EVENT_RESUMED | = | 4 (0x4)
VIR_DOMAIN_EVENT_STOPPED | = | 5 (0x5)
VIR_DOMAIN_EVENT_SHUTDOWN | = | 6 (0x6)
VIR_DOMAIN_EVENT_PMSUSPENDED | = | 7 (0x7)
VIR_DOMAIN_EVENT_CRASHED | = | 8 (0x8)
VIR_DOMAIN_EVENT_LAST | = | 9 (0x9)

    }

### `virDomainEventUndefinedDetailType`

Details on the cause of an 'undefined' lifecycle event

    enum virDomainEventUndefinedDetailType {

VIR_DOMAIN_EVENT_UNDEFINED_REMOVED | = | 0 (0x0) | Deleted the config file
VIR_DOMAIN_EVENT_UNDEFINED_RENAMED | = | 1 (0x1) | Domain was renamed
VIR_DOMAIN_EVENT_UNDEFINED_LAST | = | 2 (0x2)

    }

### `virDomainEventWatchdogAction`

The action that is to be taken due to the watchdog device firing

    enum virDomainEventWatchdogAction {

VIR_DOMAIN_EVENT_WATCHDOG_NONE | = | 0 (0x0) | No action, watchdog ignored
VIR_DOMAIN_EVENT_WATCHDOG_PAUSE | = | 1 (0x1) | Guest CPUs are paused
VIR_DOMAIN_EVENT_WATCHDOG_RESET | = | 2 (0x2) | Guest CPUs are reset
VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF | = | 3 (0x3) | Guest is forcibly powered off
VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN | = | 4 (0x4) | Guest is requested to gracefully shutdown
VIR_DOMAIN_EVENT_WATCHDOG_DEBUG | = | 5 (0x5) | No action, a debug message logged
VIR_DOMAIN_EVENT_WATCHDOG_INJECTNMI | = | 6 (0x6) | Inject a non-maskable interrupt into guest
VIR_DOMAIN_EVENT_WATCHDOG_LAST | = | 7 (0x7)

    }

### `virDomainFDAssociateFlags`

    enum virDomainFDAssociateFlags {

VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_RESTORE | = | 1 (0x1; 1 << 0) | Attempt a best-effort restore of security labels after use
VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_WRITABLE | = | 2 (0x2; 1 << 1) | Use a seclabel allowing writes for the FD even if usage implies read-only mode

    }

### `virDomainFSInfo`

    struct virDomainFSInfo {

char * | mountpoint | path to mount point
char * | name | device name in the guest (e.g. "sda1")
char * | fstype | filesystem type
size_t | ndevAlias | number of elements in devAlias
char ** | devAlias | array of disk device aliases

    }

### `virDomainFSInfoPtr`

    typedef virDomainFSInfo * virDomainFSInfoPtr;

### `virDomainGetHostnameFlags`

    enum virDomainGetHostnameFlags {

VIR_DOMAIN_GET_HOSTNAME_LEASE | = | 1 (0x1; 1 << 0) | Parse DHCP lease file
VIR_DOMAIN_GET_HOSTNAME_AGENT | = | 2 (0x2; 1 << 1) | Query qemu guest agent

    }

### `virDomainGetJobStatsFlags`

Flags OR'ed together to provide specific behavior when querying domain job statistics.

    enum virDomainGetJobStatsFlags {

VIR_DOMAIN_JOB_STATS_COMPLETED | = | 1 (0x1; 1 << 0) | return stats of a recently completed job
VIR_DOMAIN_JOB_STATS_KEEP_COMPLETED | = | 2 (0x2; 1 << 1) | don't remove completed stats when reading them

    }

### `virDomainGuestInfoTypes`

    enum virDomainGuestInfoTypes {

VIR_DOMAIN_GUEST_INFO_USERS | = | 1 (0x1; 1 << 0) | return active users
VIR_DOMAIN_GUEST_INFO_OS | = | 2 (0x2; 1 << 1) | return OS information
VIR_DOMAIN_GUEST_INFO_TIMEZONE | = | 4 (0x4; 1 << 2) | return timezone information
VIR_DOMAIN_GUEST_INFO_HOSTNAME | = | 8 (0x8; 1 << 3) | return hostname information
VIR_DOMAIN_GUEST_INFO_FILESYSTEM | = | 16 (0x10; 1 << 4) | return filesystem information
VIR_DOMAIN_GUEST_INFO_DISKS | = | 32 (0x20; 1 << 5) | return disks information
VIR_DOMAIN_GUEST_INFO_INTERFACES | = | 64 (0x40; 1 << 6) | return interfaces information

    }

### `virDomainIOThreadInfo`

    struct virDomainIOThreadInfo {

unsigned int | iothread_id | IOThread ID
unsigned char * | cpumap | CPU map for thread. A pointer to an array of real CPUs (in 8-bit bytes)
int | cpumaplen | cpumap size

    }

### `virDomainIOThreadInfoPtr`

    typedef virDomainIOThreadInfo * virDomainIOThreadInfoPtr;

### `virDomainIPAddress`

    struct virDomainIPAddress {

int | type | virIPAddrType
char * | addr | IP address
unsigned int | prefix | IP address prefix

    }

### `virDomainIPAddressPtr`

    typedef virDomainIPAddress * virDomainIPAddressPtr;

### `virDomainInfo`

    struct virDomainInfo {

unsigned char | state | the running state, one of virDomainState
unsigned long | maxMem | the maximum memory in KBytes allowed
unsigned long | memory | the memory in KBytes used by the domain
unsigned short | nrVirtCpu | the number of virtual CPUs for the domain
unsigned long long | cpuTime | the CPU time used in nanoseconds

    }

### `virDomainInfoPtr`

    typedef virDomainInfo * virDomainInfoPtr;

a virDomainInfoPtr is a pointer to a virDomainInfo structure.

### `virDomainInterface`

    struct virDomainInterface {

char * | name | interface name
char * | hwaddr | hardware address, may be NULL
unsigned int | naddrs | number of items in `addrs`
virDomainIPAddressPtr | addrs | array of IP addresses

    }

### `virDomainInterfaceAddressesSource`

    enum virDomainInterfaceAddressesSource {

VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE | = | 0 (0x0) | Parse DHCP lease file
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT | = | 1 (0x1) | Query qemu guest agent
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP | = | 2 (0x2) | Query ARP tables
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LAST | = | 3 (0x3)

    }

### `virDomainInterfacePtr`

    typedef virDomainInterface * virDomainInterfacePtr;

### `virDomainInterfaceStatsPtr`

    typedef virDomainInterfaceStatsStruct * virDomainInterfaceStatsPtr;

A pointer to a virDomainInterfaceStats structure

### `virDomainInterfaceStatsStruct`

    struct virDomainInterfaceStatsStruct {

long long | rx_bytes
long long | rx_packets
long long | rx_errs
long long | rx_drop
long long | tx_bytes
long long | tx_packets
long long | tx_errs
long long | tx_drop

    }

### `virDomainJobInfo`

    struct virDomainJobInfo {

int | type | Time is measured in milliseconds
unsigned long long | timeElapsed | Always set
unsigned long long | timeRemaining | Only for VIR_DOMAIN_JOB_BOUNDED Data is measured in bytes unless otherwise specified and is measuring the job as a whole. For VIR_DOMAIN_JOB_UNBOUNDED, dataTotal may be less than the final sum of dataProcessed + dataRemaining in the event that the hypervisor has to repeat some data, such as due to dirtied pages during migration. For VIR_DOMAIN_JOB_BOUNDED, dataTotal shall always equal the sum of dataProcessed + dataRemaining.
unsigned long long | dataTotal
unsigned long long | dataProcessed
unsigned long long | dataRemaining | As above, but only tracking guest memory progress
unsigned long long | memTotal
unsigned long long | memProcessed
unsigned long long | memRemaining | As above, but only tracking guest disk file progress
unsigned long long | fileTotal
unsigned long long | fileProcessed
unsigned long long | fileRemaining

    }

### `virDomainJobInfoPtr`

    typedef virDomainJobInfo * virDomainJobInfoPtr;

### `virDomainJobOperation`

    enum virDomainJobOperation {

VIR_DOMAIN_JOB_OPERATION_UNKNOWN | = | 0 (0x0)
VIR_DOMAIN_JOB_OPERATION_START | = | 1 (0x1)
VIR_DOMAIN_JOB_OPERATION_SAVE | = | 2 (0x2)
VIR_DOMAIN_JOB_OPERATION_RESTORE | = | 3 (0x3)
VIR_DOMAIN_JOB_OPERATION_MIGRATION_IN | = | 4 (0x4)
VIR_DOMAIN_JOB_OPERATION_MIGRATION_OUT | = | 5 (0x5)
VIR_DOMAIN_JOB_OPERATION_SNAPSHOT | = | 6 (0x6)
VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_REVERT | = | 7 (0x7)
VIR_DOMAIN_JOB_OPERATION_DUMP | = | 8 (0x8)
VIR_DOMAIN_JOB_OPERATION_BACKUP | = | 9 (0x9)
VIR_DOMAIN_JOB_OPERATION_SNAPSHOT_DELETE | = | 10 (0xa)
VIR_DOMAIN_JOB_OPERATION_LAST | = | 11 (0xb)

    }

### `virDomainJobType`

    enum virDomainJobType {

VIR_DOMAIN_JOB_NONE | = | 0 (0x0) | No job is active
VIR_DOMAIN_JOB_BOUNDED | = | 1 (0x1) | Job with a finite completion time
VIR_DOMAIN_JOB_UNBOUNDED | = | 2 (0x2) | Job without a finite completion time
VIR_DOMAIN_JOB_COMPLETED | = | 3 (0x3) | Job has finished, but isn't cleaned up
VIR_DOMAIN_JOB_FAILED | = | 4 (0x4) | Job hit error, but isn't cleaned up
VIR_DOMAIN_JOB_CANCELLED | = | 5 (0x5) | Job was aborted, but isn't cleaned up
VIR_DOMAIN_JOB_LAST | = | 6 (0x6)

    }

### `virDomainLifecycle`

    enum virDomainLifecycle {

VIR_DOMAIN_LIFECYCLE_POWEROFF | = | 0 (0x0)
VIR_DOMAIN_LIFECYCLE_REBOOT | = | 1 (0x1)
VIR_DOMAIN_LIFECYCLE_CRASH | = | 2 (0x2)
VIR_DOMAIN_LIFECYCLE_LAST | = | 3 (0x3)

    }

### `virDomainLifecycleAction`

    enum virDomainLifecycleAction {

VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY | = | 0 (0x0)
VIR_DOMAIN_LIFECYCLE_ACTION_RESTART | = | 1 (0x1)
VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME | = | 2 (0x2)
VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE | = | 3 (0x3)
VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY | = | 4 (0x4)
VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART | = | 5 (0x5)
VIR_DOMAIN_LIFECYCLE_ACTION_LAST | = | 6 (0x6)

    }

### `virDomainMemoryFailureActionType`

Action of a memory failure event.

    enum virDomainMemoryFailureActionType {

VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_IGNORE | = | 0 (0x0) | the memory failure could be ignored. This will only be the case for action-optional failures.
VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_INJECT | = | 1 (0x1) | memory failure occurred in guest memory, the guest enabled MCE handling mechanism, and hypervisor could inject the MCE into the guest successfully.
VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_FATAL | = | 2 (0x2) | the failure is unrecoverable. This occurs for action-required failures if the recipient is the hypervisor; hypervisor will exit.
VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_RESET | = | 3 (0x3) | the failure is unrecoverable but confined to the guest. This occurs if the recipient is a guest which is not ready to handle memory failures.
VIR_DOMAIN_EVENT_MEMORY_FAILURE_ACTION_LAST | = | 4 (0x4)

    }

### `virDomainMemoryFailureFlags`

    enum virDomainMemoryFailureFlags {

VIR_DOMAIN_MEMORY_FAILURE_ACTION_REQUIRED | = | 1 (0x1; 1 << 0) | whether a memory failure event is action-required or action-optional (e.g. a failure during memory scrub).
VIR_DOMAIN_MEMORY_FAILURE_RECURSIVE | = | 2 (0x2; 1 << 1) | whether the failure occurred while the previous failure was still in progress.

    }

### `virDomainMemoryFailureRecipientType`

Recipient of a memory failure event.

    enum virDomainMemoryFailureRecipientType {

VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_HYPERVISOR | = | 0 (0x0) | memory failure at hypersivor memory address space
VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_GUEST | = | 1 (0x1) | memory failure at guest memory address space
VIR_DOMAIN_EVENT_MEMORY_FAILURE_RECIPIENT_LAST | = | 2 (0x2)

    }

### `virDomainMemoryFlags`

Memory peeking flags.

    enum virDomainMemoryFlags {

VIR_MEMORY_VIRTUAL | = | 1 (0x1; 1 << 0) | addresses are virtual addresses
VIR_MEMORY_PHYSICAL | = | 2 (0x2; 1 << 1) | addresses are physical addresses

    }

### `virDomainMemoryModFlags`

Memory size modification flags.

    enum virDomainMemoryModFlags {

VIR_DOMAIN_MEM_CONFIG | = | VIR_DOMAIN_AFFECT_CONFIG | See virDomainModificationImpact
VIR_DOMAIN_MEM_CURRENT | = | VIR_DOMAIN_AFFECT_CURRENT | See virDomainModificationImpact
VIR_DOMAIN_MEM_LIVE | = | VIR_DOMAIN_AFFECT_LIVE | See virDomainModificationImpact
VIR_DOMAIN_MEM_MAXIMUM | = | 4 (0x4; 1 << 2) | affect Max rather than current

    }

### `virDomainMemoryStatPtr`

    typedef virDomainMemoryStatStruct * virDomainMemoryStatPtr;

### `virDomainMemoryStatStruct`

    struct virDomainMemoryStatStruct {

int | tag
unsigned long long | val

    }

### `virDomainMemoryStatTags`

These represent values from inside of the guest (e.g. the same value would be read from '/proc/meminfo' and/or other files from inside the guest).

    enum virDomainMemoryStatTags {

VIR_DOMAIN_MEMORY_STAT_LAST | = | VIR_DOMAIN_MEMORY_STAT_NR
VIR_DOMAIN_MEMORY_STAT_SWAP_IN | = | 0 (0x0) | The total amount of data read from swap space (in kB).
VIR_DOMAIN_MEMORY_STAT_SWAP_OUT | = | 1 (0x1) | The total amount of memory written out to swap space (in kB).
VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT | = | 2 (0x2) | Page faults occur when a process makes a valid access to virtual memory that is not available. When servicing the page fault, if disk IO is required, it is considered a major fault. If not, it is a minor fault. These are expressed as the number of faults that have occurred.
VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT | = | 3 (0x3)
VIR_DOMAIN_MEMORY_STAT_UNUSED | = | 4 (0x4) | The amount of memory left completely unused by the system. Memory that is available but used for reclaimable caches should NOT be reported as free. This value is expressed in kB.
VIR_DOMAIN_MEMORY_STAT_AVAILABLE | = | 5 (0x5) | The total amount of usable memory as seen by the domain. This value may be less than the amount of memory assigned to the domain if a balloon driver is in use or if the guest OS does not initialize all assigned pages. This value is expressed in kB.
VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON | = | 6 (0x6) | Current balloon value (in KB).
VIR_DOMAIN_MEMORY_STAT_RSS | = | 7 (0x7) | Resident Set Size of the process running the domain. This value is in kB
VIR_DOMAIN_MEMORY_STAT_USABLE | = | 8 (0x8) | How much the balloon can be inflated without pushing the guest system to swap, corresponds to 'Available' in /proc/meminfo
VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE | = | 9 (0x9) | Timestamp of the last update of statistics, in seconds.
VIR_DOMAIN_MEMORY_STAT_DISK_CACHES | = | 10 (0xa) | The amount of memory, that can be quickly reclaimed without additional I/O (in kB). Typically these pages are used for caching files from disk.
VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGALLOC | = | 11 (0xb) | The number of successful huge page allocations from inside the domain via virtio balloon.
VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGFAIL | = | 12 (0xc) | The number of failed huge page allocations from inside the domain via virtio balloon.
VIR_DOMAIN_MEMORY_STAT_NR | = | 13 (0xd) | The number of statistics supported by this version of the interface. To add new statistics, add them to the enum and increase this value.

    }

### `virDomainMessageType`

    enum virDomainMessageType {

VIR_DOMAIN_MESSAGE_DEPRECATION | = | 1 (0x1; 1 << 0)
VIR_DOMAIN_MESSAGE_TAINTING | = | 2 (0x2; 1 << 1)

    }

### `virDomainMetadataType`

    enum virDomainMetadataType {

VIR_DOMAIN_METADATA_DESCRIPTION | = | 0 (0x0) | Operate on <description>
VIR_DOMAIN_METADATA_TITLE | = | 1 (0x1) | Operate on <title>
VIR_DOMAIN_METADATA_ELEMENT | = | 2 (0x2) | Operate on <metadata>
VIR_DOMAIN_METADATA_LAST | = | 3 (0x3)

    }

### `virDomainMigrateFlags`

Domain migration flags.

    enum virDomainMigrateFlags {

VIR_MIGRATE_LIVE | = | 1 (0x1; 1 << 0) | Do not pause the domain during migration. The domain's memory will be transferred to the destination host while the domain is running. The migration may never converge if the domain is changing its memory faster then it can be transferred. The domain can be manually paused anytime during migration using virDomainSuspend.
VIR_MIGRATE_PEER2PEER | = | 2 (0x2; 1 << 1) | Tell the source libvirtd to connect directly to the destination host. Without this flag the client (e.g., virsh) connects to both hosts and controls the migration process. In peer-to-peer mode, the source libvirtd controls the migration by calling the destination daemon directly.
VIR_MIGRATE_TUNNELLED | = | 4 (0x4; 1 << 2) | Tunnel migration data over libvirtd connection. Without this flag the source hypervisor sends migration data directly to the destination hypervisor. This flag can only be used when VIR_MIGRATE_PEER2PEER is set as well. Note the less-common spelling that we're stuck with: VIR_MIGRATE_TUNNELLED should be VIR_MIGRATE_TUNNELED.
VIR_MIGRATE_PERSIST_DEST | = | 8 (0x8; 1 << 3) | Define the domain as persistent on the destination host after successful migration. If the domain was persistent on the source host and VIR_MIGRATE_UNDEFINE_SOURCE is not used, it will end up persistent on both hosts.
VIR_MIGRATE_UNDEFINE_SOURCE | = | 16 (0x10; 1 << 4) | Undefine the domain on the source host once migration successfully finishes.
VIR_MIGRATE_PAUSED | = | 32 (0x20; 1 << 5) | Leave the domain suspended on the destination host. virDomainResume (on the virDomainPtr returned by the migration API) has to be called explicitly to resume domain's virtual CPUs.
VIR_MIGRATE_NON_SHARED_DISK | = | 64 (0x40; 1 << 6) | Migrate full disk images in addition to domain's memory. By default only non-shared non-readonly disk images are transferred. The VIR_MIGRATE_PARAM_MIGRATE_DISKS parameter can be used to specify which disks should be migrated. This flag and VIR_MIGRATE_NON_SHARED_INC are mutually exclusive.
VIR_MIGRATE_NON_SHARED_INC | = | 128 (0x80; 1 << 7) | Migrate disk images in addition to domain's memory. This is similar to VIR_MIGRATE_NON_SHARED_DISK, but only the top level of each disk's backing chain is copied. That is, the rest of the backing chain is expected to be present on the destination and to be exactly the same as on the source host. This flag and VIR_MIGRATE_NON_SHARED_DISK are mutually exclusive.
VIR_MIGRATE_CHANGE_PROTECTION | = | 256 (0x100; 1 << 8) | Protect against domain configuration changes during the migration process. This flag is used automatically when both sides support it. Explicitly setting this flag will cause migration to fail if either the source or the destination does not support it.
VIR_MIGRATE_UNSAFE | = | 512 (0x200; 1 << 9) | Force migration even if it is considered unsafe. In some cases libvirt may refuse to migrate the domain because doing so may lead to potential problems such as data corruption, and thus the migration is considered unsafe. For a QEMU domain this may happen if the domain uses disks without explicitly setting cache mode to "none". Migrating such domains is unsafe unless the disk images are stored on coherent clustered filesystem, such as GFS2 or GPFS.
VIR_MIGRATE_OFFLINE | = | 1024 (0x400; 1 << 10) | Migrate a domain definition without starting the domain on the destination and without stopping it on the source host. Offline migration requires VIR_MIGRATE_PERSIST_DEST to be set. Offline migration may not copy disk storage or any other file based storage (such as UEFI variables).
VIR_MIGRATE_COMPRESSED | = | 2048 (0x800; 1 << 11) | Compress migration data. The compression methods can be specified using VIR_MIGRATE_PARAM_COMPRESSION. A hypervisor default method will be used if this parameter is omitted. Individual compression methods can be tuned via their specific VIR_MIGRATE_PARAM_COMPRESSION_* parameters.
VIR_MIGRATE_ABORT_ON_ERROR | = | 4096 (0x1000; 1 << 12) | Cancel migration if a soft error (such as I/O error) happens during migration.
VIR_MIGRATE_AUTO_CONVERGE | = | 8192 (0x2000; 1 << 13) | Enable algorithms that ensure a live migration will eventually converge. This usually means the domain will be slowed down to make sure it does not change its memory faster than a hypervisor can transfer the changed memory to the destination host. VIR_MIGRATE_PARAM_AUTO_CONVERGE_* parameters can be used to tune the algorithm.
VIR_MIGRATE_RDMA_PIN_ALL | = | 16384 (0x4000; 1 << 14) | This flag can be used with RDMA migration (i.e., when VIR_MIGRATE_PARAM_URI starts with "rdma://") to tell the hypervisor to pin all domain's memory at once before migration starts rather then letting it pin memory pages as needed. This means that all memory pages belonging to the domain will be locked in host's memory and the host will not be allowed to swap them out. For QEMU/KVM this requires hard_limit memory tuning element (in the domain XML) to be used and set to the maximum memory configured for the domain plus any memory consumed by the QEMU process itself. Beware of setting the memory limit too high (and thus allowing the domain to lock most of the host's memory). Doing so may be dangerous to both the domain and the host itself since the host's kernel may run out of memory.
VIR_MIGRATE_POSTCOPY | = | 32768 (0x8000; 1 << 15) | Setting the VIR_MIGRATE_POSTCOPY flag tells libvirt to enable post-copy migration. However, the migration will start normally and virDomainMigrateStartPostCopy needs to be called to switch it into the post-copy mode. See virDomainMigrateStartPostCopy for more details.
VIR_MIGRATE_TLS | = | 65536 (0x10000; 1 << 16) | Setting the VIR_MIGRATE_TLS flag will cause the migration to attempt to use the TLS environment configured by the hypervisor in order to perform the migration. If incorrectly configured on either source or destination, the migration will fail.
VIR_MIGRATE_PARALLEL | = | 131072 (0x20000; 1 << 17) | Send memory pages to the destination host through several network connections. See VIR_MIGRATE_PARAM_PARALLEL_* parameters for configuring the parallel migration.
VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES | = | 262144 (0x40000; 1 << 18) | Force the guest writes which happen when copying disk images for non-shared storage migration to be synchronously written to the destination. This ensures the storage migration converges for VMs doing heavy I/O on fast local storage and slow mirror. Requires one of VIR_MIGRATE_NON_SHARED_DISK, VIR_MIGRATE_NON_SHARED_INC to be present as well.
VIR_MIGRATE_POSTCOPY_RESUME | = | 524288 (0x80000; 1 << 19) | Resume migration which failed in post-copy phase.
VIR_MIGRATE_ZEROCOPY | = | 1048576 (0x100000; 1 << 20) | Use zero-copy mechanism for migrating memory pages. For QEMU/KVM this means QEMU will be temporarily allowed to lock all guest pages in host's memory, although only those that are queued for transfer will be locked at the same time.

    }

### `virDomainMigrateMaxSpeedFlags`

Domain migration speed flags.

    enum virDomainMigrateMaxSpeedFlags {

VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY | = | 1 (0x1; 1 << 0) | Set or get maximum speed of post-copy migration.

    }

### `virDomainModificationImpact`

Several modification APIs take flags to determine whether a change to the domain affects just the running instance, just the persistent definition, or both at the same time. The counterpart query APIs also take the same flags to determine whether to query the running instance or persistent definition, although both cannot be queried at once. The use of VIR_DOMAIN_AFFECT_CURRENT will resolve to either VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG according to current domain state. VIR_DOMAIN_AFFECT_LIVE requires a running domain, and VIR_DOMAIN_AFFECT_CONFIG requires a persistent domain (whether or not it is running). These enums should not conflict with those of virTypedParameterFlags.

    enum virDomainModificationImpact {

VIR_DOMAIN_AFFECT_CURRENT | = | 0 (0x0) | Affect current domain state.
VIR_DOMAIN_AFFECT_LIVE | = | 1 (0x1; 1 << 0) | Affect running domain state.
VIR_DOMAIN_AFFECT_CONFIG | = | 2 (0x2; 1 << 1) | Affect persistent domain state. 1 << 2 is reserved for virTypedParameterFlags

    }

### `virDomainNostateReason`

    enum virDomainNostateReason {

VIR_DOMAIN_NOSTATE_UNKNOWN | = | 0 (0x0)
VIR_DOMAIN_NOSTATE_LAST | = | 1 (0x1)

    }

### `virDomainNumatuneMemMode`

Representation of the various modes in the <numatune> element of a domain.

    enum virDomainNumatuneMemMode {

VIR_DOMAIN_NUMATUNE_MEM_STRICT | = | 0 (0x0)
VIR_DOMAIN_NUMATUNE_MEM_PREFERRED | = | 1 (0x1)
VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE | = | 2 (0x2)
VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE | = | 3 (0x3)
VIR_DOMAIN_NUMATUNE_MEM_LAST | = | 4 (0x4) | This constant is subject to change

    }

### `virDomainOpenGraphicsFlags`

    enum virDomainOpenGraphicsFlags {

VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH | = | 1 (0x1; 1 << 0)

    }

### `virDomainPMSuspendedDiskReason`

    enum virDomainPMSuspendedDiskReason {

VIR_DOMAIN_PMSUSPENDED_DISK_UNKNOWN | = | 0 (0x0)
VIR_DOMAIN_PMSUSPENDED_DISK_LAST | = | 1 (0x1)

    }

### `virDomainPMSuspendedReason`

    enum virDomainPMSuspendedReason {

VIR_DOMAIN_PMSUSPENDED_UNKNOWN | = | 0 (0x0)
VIR_DOMAIN_PMSUSPENDED_LAST | = | 1 (0x1)

    }

### `virDomainPausedReason`

    enum virDomainPausedReason {

VIR_DOMAIN_PAUSED_UNKNOWN | = | 0 (0x0) | the reason is unknown
VIR_DOMAIN_PAUSED_USER | = | 1 (0x1) | paused on user request
VIR_DOMAIN_PAUSED_MIGRATION | = | 2 (0x2) | paused for offline migration
VIR_DOMAIN_PAUSED_SAVE | = | 3 (0x3) | paused for save
VIR_DOMAIN_PAUSED_DUMP | = | 4 (0x4) | paused for offline core dump
VIR_DOMAIN_PAUSED_IOERROR | = | 5 (0x5) | paused due to a disk I/O error
VIR_DOMAIN_PAUSED_WATCHDOG | = | 6 (0x6) | paused due to a watchdog event
VIR_DOMAIN_PAUSED_FROM_SNAPSHOT | = | 7 (0x7) | paused after restoring from snapshot
VIR_DOMAIN_PAUSED_SHUTTING_DOWN | = | 8 (0x8) | paused during shutdown process
VIR_DOMAIN_PAUSED_SNAPSHOT | = | 9 (0x9) | paused while creating a snapshot
VIR_DOMAIN_PAUSED_CRASHED | = | 10 (0xa) | paused due to a guest crash
VIR_DOMAIN_PAUSED_STARTING_UP | = | 11 (0xb) | the domain is being started
VIR_DOMAIN_PAUSED_POSTCOPY | = | 12 (0xc) | paused for post-copy migration
VIR_DOMAIN_PAUSED_POSTCOPY_FAILED | = | 13 (0xd) | paused after failed post-copy
VIR_DOMAIN_PAUSED_API_ERROR | = | 14 (0xe) | Some APIs (e.g., migration, snapshot) internally need to suspend a domain. This paused state reason is used when resume operation at the end of such API fails.
VIR_DOMAIN_PAUSED_LAST | = | 15 (0xf)

    }

### `virDomainProcessSignal`

These just happen to match Linux signal numbers. The numbers will be mapped to whatever the SIGNUM is in the guest OS in question by the agent delivering the signal. The names are based on the POSIX / XSI signal standard though. Do not rely on all values matching Linux though. It is possible this enum might be extended with new signals which have no mapping in Linux.

    enum virDomainProcessSignal {

VIR_DOMAIN_PROCESS_SIGNAL_NOP | = | 0 (0x0) | No constant in POSIX/Linux
VIR_DOMAIN_PROCESS_SIGNAL_HUP | = | 1 (0x1) | SIGHUP
VIR_DOMAIN_PROCESS_SIGNAL_INT | = | 2 (0x2) | SIGINT
VIR_DOMAIN_PROCESS_SIGNAL_QUIT | = | 3 (0x3) | SIGQUIT
VIR_DOMAIN_PROCESS_SIGNAL_ILL | = | 4 (0x4) | SIGILL
VIR_DOMAIN_PROCESS_SIGNAL_TRAP | = | 5 (0x5) | SIGTRAP
VIR_DOMAIN_PROCESS_SIGNAL_ABRT | = | 6 (0x6) | SIGABRT
VIR_DOMAIN_PROCESS_SIGNAL_BUS | = | 7 (0x7) | SIGBUS
VIR_DOMAIN_PROCESS_SIGNAL_FPE | = | 8 (0x8) | SIGFPE
VIR_DOMAIN_PROCESS_SIGNAL_KILL | = | 9 (0x9) | SIGKILL
VIR_DOMAIN_PROCESS_SIGNAL_USR1 | = | 10 (0xa) | SIGUSR1
VIR_DOMAIN_PROCESS_SIGNAL_SEGV | = | 11 (0xb) | SIGSEGV
VIR_DOMAIN_PROCESS_SIGNAL_USR2 | = | 12 (0xc) | SIGUSR2
VIR_DOMAIN_PROCESS_SIGNAL_PIPE | = | 13 (0xd) | SIGPIPE
VIR_DOMAIN_PROCESS_SIGNAL_ALRM | = | 14 (0xe) | SIGALRM
VIR_DOMAIN_PROCESS_SIGNAL_TERM | = | 15 (0xf) | SIGTERM
VIR_DOMAIN_PROCESS_SIGNAL_STKFLT | = | 16 (0x10) | Not in POSIX (SIGSTKFLT on Linux
VIR_DOMAIN_PROCESS_SIGNAL_CHLD | = | 17 (0x11) | SIGCHLD
VIR_DOMAIN_PROCESS_SIGNAL_CONT | = | 18 (0x12) | SIGCONT
VIR_DOMAIN_PROCESS_SIGNAL_STOP | = | 19 (0x13) | SIGSTOP
VIR_DOMAIN_PROCESS_SIGNAL_TSTP | = | 20 (0x14) | SIGTSTP
VIR_DOMAIN_PROCESS_SIGNAL_TTIN | = | 21 (0x15) | SIGTTIN
VIR_DOMAIN_PROCESS_SIGNAL_TTOU | = | 22 (0x16) | SIGTTOU
VIR_DOMAIN_PROCESS_SIGNAL_URG | = | 23 (0x17) | SIGURG
VIR_DOMAIN_PROCESS_SIGNAL_XCPU | = | 24 (0x18) | SIGXCPU
VIR_DOMAIN_PROCESS_SIGNAL_XFSZ | = | 25 (0x19) | SIGXFSZ
VIR_DOMAIN_PROCESS_SIGNAL_VTALRM | = | 26 (0x1a) | SIGVTALRM
VIR_DOMAIN_PROCESS_SIGNAL_PROF | = | 27 (0x1b) | SIGPROF
VIR_DOMAIN_PROCESS_SIGNAL_WINCH | = | 28 (0x1c) | Not in POSIX (SIGWINCH on Linux)
VIR_DOMAIN_PROCESS_SIGNAL_POLL | = | 29 (0x1d) | SIGPOLL (also known as SIGIO on Linux)
VIR_DOMAIN_PROCESS_SIGNAL_PWR | = | 30 (0x1e) | Not in POSIX (SIGPWR on Linux)
VIR_DOMAIN_PROCESS_SIGNAL_SYS | = | 31 (0x1f) | SIGSYS (also known as SIGUNUSED on Linux)
VIR_DOMAIN_PROCESS_SIGNAL_RT0 | = | 32 (0x20) | SIGRTMIN
VIR_DOMAIN_PROCESS_SIGNAL_RT1 | = | 33 (0x21) | SIGRTMIN + 1
VIR_DOMAIN_PROCESS_SIGNAL_RT2 | = | 34 (0x22) | SIGRTMIN + 2
VIR_DOMAIN_PROCESS_SIGNAL_RT3 | = | 35 (0x23) | SIGRTMIN + 3
VIR_DOMAIN_PROCESS_SIGNAL_RT4 | = | 36 (0x24) | SIGRTMIN + 4
VIR_DOMAIN_PROCESS_SIGNAL_RT5 | = | 37 (0x25) | SIGRTMIN + 5
VIR_DOMAIN_PROCESS_SIGNAL_RT6 | = | 38 (0x26) | SIGRTMIN + 6
VIR_DOMAIN_PROCESS_SIGNAL_RT7 | = | 39 (0x27) | SIGRTMIN + 7
VIR_DOMAIN_PROCESS_SIGNAL_RT8 | = | 40 (0x28) | SIGRTMIN + 8
VIR_DOMAIN_PROCESS_SIGNAL_RT9 | = | 41 (0x29) | SIGRTMIN + 9
VIR_DOMAIN_PROCESS_SIGNAL_RT10 | = | 42 (0x2a) | SIGRTMIN + 10
VIR_DOMAIN_PROCESS_SIGNAL_RT11 | = | 43 (0x2b) | SIGRTMIN + 11
VIR_DOMAIN_PROCESS_SIGNAL_RT12 | = | 44 (0x2c) | SIGRTMIN + 12
VIR_DOMAIN_PROCESS_SIGNAL_RT13 | = | 45 (0x2d) | SIGRTMIN + 13
VIR_DOMAIN_PROCESS_SIGNAL_RT14 | = | 46 (0x2e) | SIGRTMIN + 14
VIR_DOMAIN_PROCESS_SIGNAL_RT15 | = | 47 (0x2f) | SIGRTMIN + 15
VIR_DOMAIN_PROCESS_SIGNAL_RT16 | = | 48 (0x30) | SIGRTMIN + 16
VIR_DOMAIN_PROCESS_SIGNAL_RT17 | = | 49 (0x31) | SIGRTMIN + 17
VIR_DOMAIN_PROCESS_SIGNAL_RT18 | = | 50 (0x32) | SIGRTMIN + 18
VIR_DOMAIN_PROCESS_SIGNAL_RT19 | = | 51 (0x33) | SIGRTMIN + 19
VIR_DOMAIN_PROCESS_SIGNAL_RT20 | = | 52 (0x34) | SIGRTMIN + 20
VIR_DOMAIN_PROCESS_SIGNAL_RT21 | = | 53 (0x35) | SIGRTMIN + 21
VIR_DOMAIN_PROCESS_SIGNAL_RT22 | = | 54 (0x36) | SIGRTMIN + 22
VIR_DOMAIN_PROCESS_SIGNAL_RT23 | = | 55 (0x37) | SIGRTMIN + 23
VIR_DOMAIN_PROCESS_SIGNAL_RT24 | = | 56 (0x38) | SIGRTMIN + 24
VIR_DOMAIN_PROCESS_SIGNAL_RT25 | = | 57 (0x39) | SIGRTMIN + 25
VIR_DOMAIN_PROCESS_SIGNAL_RT26 | = | 58 (0x3a) | SIGRTMIN + 26
VIR_DOMAIN_PROCESS_SIGNAL_RT27 | = | 59 (0x3b) | SIGRTMIN + 27
VIR_DOMAIN_PROCESS_SIGNAL_RT28 | = | 60 (0x3c) | SIGRTMIN + 28
VIR_DOMAIN_PROCESS_SIGNAL_RT29 | = | 61 (0x3d) | SIGRTMIN + 29
VIR_DOMAIN_PROCESS_SIGNAL_RT30 | = | 62 (0x3e) | SIGRTMIN + 30
VIR_DOMAIN_PROCESS_SIGNAL_RT31 | = | 63 (0x3f) | SIGRTMIN + 31
VIR_DOMAIN_PROCESS_SIGNAL_RT32 | = | 64 (0x40) | SIGRTMIN + 32 / SIGRTMAX
VIR_DOMAIN_PROCESS_SIGNAL_LAST | = | 65 (0x41)

    }

### `virDomainPtr`

    typedef virDomain * virDomainPtr;

a virDomainPtr is pointer to a virDomain private structure, this is the type used to reference a domain in the API.

### `virDomainRebootFlagValues`

    enum virDomainRebootFlagValues {

VIR_DOMAIN_REBOOT_DEFAULT | = | 0 (0x0) | hypervisor choice
VIR_DOMAIN_REBOOT_ACPI_POWER_BTN | = | 1 (0x1; 1 << 0) | Send ACPI event
VIR_DOMAIN_REBOOT_GUEST_AGENT | = | 2 (0x2; 1 << 1) | Use guest agent
VIR_DOMAIN_REBOOT_INITCTL | = | 4 (0x4; 1 << 2) | Use initctl
VIR_DOMAIN_REBOOT_SIGNAL | = | 8 (0x8; 1 << 3) | Send a signal
VIR_DOMAIN_REBOOT_PARAVIRT | = | 16 (0x10; 1 << 4) | Use paravirt guest control

    }

### `virDomainRunningReason`

    enum virDomainRunningReason {

VIR_DOMAIN_RUNNING_UNKNOWN | = | 0 (0x0)
VIR_DOMAIN_RUNNING_BOOTED | = | 1 (0x1) | normal startup from boot
VIR_DOMAIN_RUNNING_MIGRATED | = | 2 (0x2) | migrated from another host
VIR_DOMAIN_RUNNING_RESTORED | = | 3 (0x3) | restored from a state file
VIR_DOMAIN_RUNNING_FROM_SNAPSHOT | = | 4 (0x4) | restored from snapshot
VIR_DOMAIN_RUNNING_UNPAUSED | = | 5 (0x5) | returned from paused state
VIR_DOMAIN_RUNNING_MIGRATION_CANCELED | = | 6 (0x6) | returned from migration
VIR_DOMAIN_RUNNING_SAVE_CANCELED | = | 7 (0x7) | returned from failed save process
VIR_DOMAIN_RUNNING_WAKEUP | = | 8 (0x8) | returned from pmsuspended due to wakeup event
VIR_DOMAIN_RUNNING_CRASHED | = | 9 (0x9) | resumed from crashed
VIR_DOMAIN_RUNNING_POSTCOPY | = | 10 (0xa) | running in post-copy migration mode
VIR_DOMAIN_RUNNING_POSTCOPY_FAILED | = | 11 (0xb) | running in failed post-copy migration
VIR_DOMAIN_RUNNING_LAST | = | 12 (0xc)

    }

### `virDomainSaveImageXMLFlags`

    enum virDomainSaveImageXMLFlags {

VIR_DOMAIN_SAVE_IMAGE_XML_SECURE | = | VIR_DOMAIN_XML_SECURE | dump security sensitive information too

    }

### `virDomainSaveRestoreFlags`

Flags for use in virDomainSaveFlags(), virDomainManagedSave(), virDomainSaveParams(), virDomainRestoreParams(), virDomainRestoreFlags(), and virDomainSaveImageDefineXML(). Not all flags apply to all these functions.

    enum virDomainSaveRestoreFlags {

VIR_DOMAIN_SAVE_BYPASS_CACHE | = | 1 (0x1; 1 << 0) | Avoid file system cache pollution
VIR_DOMAIN_SAVE_RUNNING | = | 2 (0x2; 1 << 1) | Favor running over paused
VIR_DOMAIN_SAVE_PAUSED | = | 4 (0x4; 1 << 2) | Favor paused over running
VIR_DOMAIN_SAVE_RESET_NVRAM | = | 8 (0x8; 1 << 3) | Re-initialize NVRAM from template

    }

### `virDomainSetTimeFlags`

    enum virDomainSetTimeFlags {

VIR_DOMAIN_TIME_SYNC | = | 1 (0x1; 1 << 0) | Re-sync domain time from domain's RTC

    }

### `virDomainSetUserPasswordFlags`

    enum virDomainSetUserPasswordFlags {

VIR_DOMAIN_PASSWORD_ENCRYPTED | = | 1 (0x1; 1 << 0) | the password is already encrypted

    }

### `virDomainShutdownFlagValues`

    enum virDomainShutdownFlagValues {

VIR_DOMAIN_SHUTDOWN_DEFAULT | = | 0 (0x0) | hypervisor choice
VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN | = | 1 (0x1; 1 << 0) | Send ACPI event
VIR_DOMAIN_SHUTDOWN_GUEST_AGENT | = | 2 (0x2; 1 << 1) | Use guest agent
VIR_DOMAIN_SHUTDOWN_INITCTL | = | 4 (0x4; 1 << 2) | Use initctl
VIR_DOMAIN_SHUTDOWN_SIGNAL | = | 8 (0x8; 1 << 3) | Send a signal
VIR_DOMAIN_SHUTDOWN_PARAVIRT | = | 16 (0x10; 1 << 4) | Use paravirt guest control

    }

### `virDomainShutdownReason`

    enum virDomainShutdownReason {

VIR_DOMAIN_SHUTDOWN_UNKNOWN | = | 0 (0x0) | the reason is unknown
VIR_DOMAIN_SHUTDOWN_USER | = | 1 (0x1) | shutting down on user request
VIR_DOMAIN_SHUTDOWN_LAST | = | 2 (0x2)

    }

### `virDomainShutoffReason`

    enum virDomainShutoffReason {

VIR_DOMAIN_SHUTOFF_UNKNOWN | = | 0 (0x0) | the reason is unknown
VIR_DOMAIN_SHUTOFF_SHUTDOWN | = | 1 (0x1) | normal shutdown
VIR_DOMAIN_SHUTOFF_DESTROYED | = | 2 (0x2) | forced poweroff
VIR_DOMAIN_SHUTOFF_CRASHED | = | 3 (0x3) | domain crashed
VIR_DOMAIN_SHUTOFF_MIGRATED | = | 4 (0x4) | migrated to another host
VIR_DOMAIN_SHUTOFF_SAVED | = | 5 (0x5) | saved to a file
VIR_DOMAIN_SHUTOFF_FAILED | = | 6 (0x6) | domain failed to start
VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT | = | 7 (0x7) | restored from a snapshot which was taken while domain was shutoff
VIR_DOMAIN_SHUTOFF_DAEMON | = | 8 (0x8) | daemon decides to kill domain during reconnection processing
VIR_DOMAIN_SHUTOFF_LAST | = | 9 (0x9)

    }

### `virDomainState`

A domain may be in different states at a given point in time

    enum virDomainState {

VIR_DOMAIN_NOSTATE | = | 0 (0x0) | no state
VIR_DOMAIN_RUNNING | = | 1 (0x1) | the domain is running
VIR_DOMAIN_BLOCKED | = | 2 (0x2) | the domain is blocked on resource
VIR_DOMAIN_PAUSED | = | 3 (0x3) | the domain is paused by user
VIR_DOMAIN_SHUTDOWN | = | 4 (0x4) | the domain is being shut down
VIR_DOMAIN_SHUTOFF | = | 5 (0x5) | the domain is shut off
VIR_DOMAIN_CRASHED | = | 6 (0x6) | the domain is crashed
VIR_DOMAIN_PMSUSPENDED | = | 7 (0x7) | the domain is suspended by guest power management
VIR_DOMAIN_LAST | = | 8 (0x8) | NB: this enum value will increase over time as new states are added to the libvirt API. It reflects the last state supported by this version of the libvirt API.

    }

### `virDomainStatsRecord`

    struct virDomainStatsRecord {

virDomainPtr | dom
virTypedParameterPtr | params
int | nparams

    }

### `virDomainStatsRecordPtr`

    typedef virDomainStatsRecord * virDomainStatsRecordPtr;

### `virDomainStatsTypes`

    enum virDomainStatsTypes {

VIR_DOMAIN_STATS_STATE | = | 1 (0x1; 1 << 0) | return domain state
VIR_DOMAIN_STATS_CPU_TOTAL | = | 2 (0x2; 1 << 1) | return domain CPU info
VIR_DOMAIN_STATS_BALLOON | = | 4 (0x4; 1 << 2) | return domain balloon info
VIR_DOMAIN_STATS_VCPU | = | 8 (0x8; 1 << 3) | return domain virtual CPU info
VIR_DOMAIN_STATS_INTERFACE | = | 16 (0x10; 1 << 4) | return domain interfaces info
VIR_DOMAIN_STATS_BLOCK | = | 32 (0x20; 1 << 5) | return domain block info
VIR_DOMAIN_STATS_PERF | = | 64 (0x40; 1 << 6) | return domain perf event info
VIR_DOMAIN_STATS_IOTHREAD | = | 128 (0x80; 1 << 7) | return iothread poll info
VIR_DOMAIN_STATS_MEMORY | = | 256 (0x100; 1 << 8) | return domain memory info
VIR_DOMAIN_STATS_DIRTYRATE | = | 512 (0x200; 1 << 9) | return domain dirty rate info
VIR_DOMAIN_STATS_VM | = | 1024 (0x400; 1 << 10) | return vm info

    }

### `virDomainUndefineFlagsValues`

    enum virDomainUndefineFlagsValues {

VIR_DOMAIN_UNDEFINE_MANAGED_SAVE | = | 1 (0x1; 1 << 0) | Also remove any managed save
VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA | = | 2 (0x2; 1 << 1) | If last use of domain, then also remove any snapshot metadata
VIR_DOMAIN_UNDEFINE_NVRAM | = | 4 (0x4; 1 << 2) | Also remove any nvram file
VIR_DOMAIN_UNDEFINE_KEEP_NVRAM | = | 8 (0x8; 1 << 3) | Keep nvram file
VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA | = | 16 (0x10; 1 << 4) | If last use of domain, then also remove any checkpoint metadata
VIR_DOMAIN_UNDEFINE_TPM | = | 32 (0x20; 1 << 5) | Also remove any TPM state
VIR_DOMAIN_UNDEFINE_KEEP_TPM | = | 64 (0x40; 1 << 6) | Keep TPM state Future undefine control flags should come here.

    }

### `virDomainVcpuFlags`

Flags for controlling virtual CPU hot-plugging.

    enum virDomainVcpuFlags {

VIR_DOMAIN_VCPU_CONFIG | = | VIR_DOMAIN_AFFECT_CONFIG | See virDomainModificationImpact
VIR_DOMAIN_VCPU_CURRENT | = | VIR_DOMAIN_AFFECT_CURRENT | See virDomainModificationImpact
VIR_DOMAIN_VCPU_LIVE | = | VIR_DOMAIN_AFFECT_LIVE | See virDomainModificationImpact
VIR_DOMAIN_VCPU_MAXIMUM | = | 4 (0x4; 1 << 2) | Max rather than current count
VIR_DOMAIN_VCPU_GUEST | = | 8 (0x8; 1 << 3) | Modify state of the cpu in the guest
VIR_DOMAIN_VCPU_HOTPLUGGABLE | = | 16 (0x10; 1 << 4) | Make vcpus added hot(un)pluggable

    }

### `virDomainXMLFlags`

Flags available for virDomainGetXMLDesc

    enum virDomainXMLFlags {

VIR_DOMAIN_XML_SECURE | = | 1 (0x1; 1 << 0) | dump security sensitive information too
VIR_DOMAIN_XML_INACTIVE | = | 2 (0x2; 1 << 1) | dump inactive domain information
VIR_DOMAIN_XML_UPDATE_CPU | = | 4 (0x4; 1 << 2) | update guest CPU requirements according to host CPU
VIR_DOMAIN_XML_MIGRATABLE | = | 8 (0x8; 1 << 3) | dump XML suitable for migration

    }

### `virKeycodeSet`

Enum to specify which keycode mapping is in use for virDomainSendKey().

    enum virKeycodeSet {

VIR_KEYCODE_SET_LINUX | = | 0 (0x0)
VIR_KEYCODE_SET_XT | = | 1 (0x1)
VIR_KEYCODE_SET_ATSET1 | = | 2 (0x2)
VIR_KEYCODE_SET_ATSET2 | = | 3 (0x3)
VIR_KEYCODE_SET_ATSET3 | = | 4 (0x4)
VIR_KEYCODE_SET_OSX | = | 5 (0x5)
VIR_KEYCODE_SET_XT_KBD | = | 6 (0x6)
VIR_KEYCODE_SET_USB | = | 7 (0x7)
VIR_KEYCODE_SET_WIN32 | = | 8 (0x8)
VIR_KEYCODE_SET_QNUM | = | 9 (0x9)
VIR_KEYCODE_SET_LAST | = | 10 (0xa) | NB: this enum value will increase over time as new keycode sets are added to the libvirt API. It reflects the last keycode set supported by this version of the libvirt API.

    }

### `virMemoryParameter`

    struct virMemoryParameter {

char field[VIR_TYPED_PARAM_FIELD_LENGTH] | field | parameter name
int | type | parameter type, virTypedParameterType
union {
int | i | type is INT
unsigned int | ui | type is UINT
long long int | l | type is LLONG
unsigned long long int | ul | type is ULLONG
double | d | type is DOUBLE
char | b | type is BOOLEAN
char * | s | type is STRING, may not be NULL
} | value | parameter value |

    }

### `virMemoryParameterPtr`

    typedef virMemoryParameter * virMemoryParameterPtr;

a virMemoryParameterPtr is a pointer to a virMemoryParameter structure. Provided for backwards compatibility; virTypedParameterPtr is the preferred alias.

### `virMemoryParameterType`

A memory parameter field type. Provided for backwards compatibility; virTypedParameterType is the preferred enum

    enum virMemoryParameterType {

VIR_DOMAIN_MEMORY_PARAM_BOOLEAN | = | VIR_TYPED_PARAM_BOOLEAN
VIR_DOMAIN_MEMORY_PARAM_DOUBLE | = | VIR_TYPED_PARAM_DOUBLE
VIR_DOMAIN_MEMORY_PARAM_INT | = | VIR_TYPED_PARAM_INT
VIR_DOMAIN_MEMORY_PARAM_LLONG | = | VIR_TYPED_PARAM_LLONG
VIR_DOMAIN_MEMORY_PARAM_UINT | = | VIR_TYPED_PARAM_UINT
VIR_DOMAIN_MEMORY_PARAM_ULLONG | = | VIR_TYPED_PARAM_ULLONG

    }

### `virSchedParameter`

    struct virSchedParameter {

char field[VIR_TYPED_PARAM_FIELD_LENGTH] | field | parameter name
int | type | parameter type, virTypedParameterType
union {
int | i | type is INT
unsigned int | ui | type is UINT
long long int | l | type is LLONG
unsigned long long int | ul | type is ULLONG
double | d | type is DOUBLE
char | b | type is BOOLEAN
char * | s | type is STRING, may not be NULL
} | value | parameter value |

    }

### `virSchedParameterPtr`

    typedef virSchedParameter * virSchedParameterPtr;

a virSchedParameterPtr is a pointer to a virSchedParameter structure. Provided for backwards compatibility; virTypedParameterPtr is the preferred alias since 0.9.2.

### `virSchedParameterType`

A scheduler parameter field type. Provided for backwards compatibility; virTypedParameterType is the preferred enum

    enum virSchedParameterType {

VIR_DOMAIN_SCHED_FIELD_BOOLEAN | = | VIR_TYPED_PARAM_BOOLEAN
VIR_DOMAIN_SCHED_FIELD_DOUBLE | = | VIR_TYPED_PARAM_DOUBLE
VIR_DOMAIN_SCHED_FIELD_INT | = | VIR_TYPED_PARAM_INT
VIR_DOMAIN_SCHED_FIELD_LLONG | = | VIR_TYPED_PARAM_LLONG
VIR_DOMAIN_SCHED_FIELD_UINT | = | VIR_TYPED_PARAM_UINT
VIR_DOMAIN_SCHED_FIELD_ULLONG | = | VIR_TYPED_PARAM_ULLONG

    }

### `virVcpuHostCpuState`

    enum virVcpuHostCpuState {

VIR_VCPU_INFO_CPU_UNAVAILABLE | = | -2 (-0x2) | the hypervisor does not expose real CPU information
VIR_VCPU_INFO_CPU_OFFLINE | = | -1 (-0x1) | the vCPU is offline

    }

### `virVcpuInfo`

    struct virVcpuInfo {

unsigned int | number | virtual CPU number
int | state | value from virVcpuState
unsigned long long | cpuTime | CPU time used, in nanoseconds
int | cpu | real CPU number, or one of the values from virVcpuHostCpuState

    }

### `virVcpuInfoPtr`

    typedef virVcpuInfo * virVcpuInfoPtr;

### `virVcpuState`

structure for information about a virtual CPU in a domain.

    enum virVcpuState {

VIR_VCPU_OFFLINE | = | 0 (0x0) | the virtual CPU is offline
VIR_VCPU_RUNNING | = | 1 (0x1) | the virtual CPU is running
VIR_VCPU_BLOCKED | = | 2 (0x2) | the virtual CPU is blocked on resource
VIR_VCPU_LAST | = | 3 (0x3)

    }

### Functions

### `virConnectDomainEventAgentLifecycleCallback`

    typedef void	(*virConnectDomainEventAgentLifecycleCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int state,
    							 int reason,
    							 void * opaque)

This callback occurs when libvirt detects a change in the state of a guest agent.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
state
  new state of the guest agent, one of virConnectDomainEventAgentLifecycleState
reason
  reason for state change; one of virConnectDomainEventAgentLifecycleReason
opaque
  application specified data

### `virConnectDomainEventBalloonChangeCallback`

    typedef void	(*virConnectDomainEventBalloonChangeCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 unsigned long long actual,
    							 void * opaque)

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
actual
  the new balloon level measured in kibibytes(blocks of 1024 bytes)
opaque
  application specified data

### `virConnectDomainEventBlockJobCallback`

    typedef void	(*virConnectDomainEventBlockJobCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * disk,
    						 int type,
    						 int status,
    						 void * opaque)

The string returned for `disk` can be used in any of the libvirt API that operate on a particular disk of the domain, and depends on what event type was registered with virConnectDomainEventRegisterAny(). If the callback was registered using the older type of VIR_DOMAIN_EVENT_ID_BLOCK_JOB, then `disk` contains the absolute file name of the host resource for the active layer of the disk; however, this name is unstable (pivoting via block copy or active block commit will change which file is active, giving a different name for the two events associated with the same job) and cannot be relied on if the active layer is associated with a network resource. If the callback was registered using the newer type of VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2, then `disk` will contain the device target shorthand (the <target dev='...'/> sub-element, such as "vda").

conn
  connection object
dom
  domain on which the event occurred
disk
  name associated with the affected disk (filename or target device, depending on how the callback was registered)
type
  type of block job (virDomainBlockJobType)
status
  status of the operation (virConnectDomainEventBlockJobStatus)
opaque
  application specified data

### `virConnectDomainEventBlockThresholdCallback`

    typedef void	(*virConnectDomainEventBlockThresholdCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * dev,
    							 const char * path,
    							 unsigned long long threshold,
    							 unsigned long long excess,
    							 void * opaque)

The callback occurs when the hypervisor detects that the given storage element was written beyond the point specified by `threshold`. The excess data size written beyond `threshold` is reported by `excess` (if supported by the hypervisor, 0 otherwise). The event is useful for thin-provisioned storage.

The threshold size can be set via the virDomainSetBlockThreshold API.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
dev
  name associated with the affected disk or storage backing chain element
path
  for local storage, the path of the backing chain element
threshold
  threshold offset in bytes
excess
  number of bytes written beyond the threshold
opaque
  application specified data

### `virConnectDomainEventCallback`

    typedef int	(*virConnectDomainEventCallback)	(virConnectPtr conn,
    					 virDomainPtr dom,
    					 int event,
    					 int detail,
    					 void * opaque)

A callback function to be registered, and called when a domain event occurs

conn
  virConnect connection
dom
  The domain on which the event occurred
event
  The specific virDomainEventType which occurred
detail
  event specific detail information (virDomainEvent*DetailType)
opaque
  opaque user data
Returns
  0 (the return value is currently ignored)

### `virConnectDomainEventDeregister`

    int	virConnectDomainEventDeregister	(virConnectPtr conn,
    					 virConnectDomainEventCallback cb)

Removes a callback previously registered with the virConnectDomainEventRegister() function.

Use of this method is no longer recommended. Instead applications should try virConnectDomainEventDeregisterAny() which has a more flexible API contract

conn
  pointer to the connection
cb
  callback to the function handling domain events
Returns
  0 on success, -1 on failure. Older versions of some hypervisors sometimes returned a positive number on success, but without any reliable semantics on what that number represents.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | read | -

### `virConnectDomainEventDeregisterAny`

    int	virConnectDomainEventDeregisterAny	(virConnectPtr conn,
    						 int callbackID)

Removes an event callback. The callbackID parameter should be the value obtained from a previous virConnectDomainEventRegisterAny() method.

conn
  pointer to the connection
callbackID
  the callback identifier
Returns
  0 on success, -1 on failure. Older versions of some hypervisors sometimes returned a positive number on success, but without any reliable semantics on what that number represents.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | read | -

### `virConnectDomainEventDeviceAddedCallback`

    typedef void	(*virConnectDomainEventDeviceAddedCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * devAlias,
    							 void * opaque)

This callback occurs when a device is added to the domain.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_DEVICE_ADDED with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
devAlias
  device alias
opaque
  application specified data

### `virConnectDomainEventDeviceRemovalFailedCallback`

    typedef void	(*virConnectDomainEventDeviceRemovalFailedCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * devAlias,
    							 void * opaque)

This callback occurs when it's certain that removal of a device failed.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED with virConnectDomainEventRegisterAny().

conn
  connection object
dom
  domain on which the event occurred
devAlias
  device alias
opaque
  application specified data

### `virConnectDomainEventDeviceRemovedCallback`

    typedef void	(*virConnectDomainEventDeviceRemovedCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * devAlias,
    							 void * opaque)

This callback occurs when a device is removed from the domain.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
devAlias
  device alias
opaque
  application specified data

### `virConnectDomainEventDiskChangeCallback`

    typedef void	(*virConnectDomainEventDiskChangeCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * oldSrcPath,
    						 const char * newSrcPath,
    						 const char * devAlias,
    						 int reason,
    						 void * opaque)

This callback occurs when disk gets changed. However, not all `reason` will cause both `oldSrcPath` and `newSrcPath` to be non-NULL. Please see virConnectDomainEventDiskChangeReason for more details.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_DISK_CHANGE with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
oldSrcPath
  old source path
newSrcPath
  new source path
devAlias
  device alias name
reason
  reason why this callback was called; any of virConnectDomainEventDiskChangeReason
opaque
  application specified data

### `virConnectDomainEventGenericCallback`

    typedef void	(*virConnectDomainEventGenericCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 void * opaque)

A generic domain event callback handler, for use with virConnectDomainEventRegisterAny(). Specific events usually have a customization with extra parameters, often with `opaque` being passed in a different parameter position; use VIR_DOMAIN_EVENT_CALLBACK() when registering an appropriate handler.

conn
  the connection pointer
dom
  the domain pointer
opaque
  application specified data

### `virConnectDomainEventGraphicsCallback`

    typedef void	(*virConnectDomainEventGraphicsCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int phase,
    						 const virDomainEventGraphicsAddress * local,
    						 const virDomainEventGraphicsAddress * remote,
    						 const char * authScheme,
    						 const virDomainEventGraphicsSubject * subject,
    						 void * opaque)

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_GRAPHICS with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
phase
  the phase of the connection (virDomainEventGraphicsPhase)
local
  the local server address
remote
  the remote client address
authScheme
  the authentication scheme activated
subject
  the authenticated subject (user)
opaque
  application specified data

### `virConnectDomainEventIOErrorCallback`

    typedef void	(*virConnectDomainEventIOErrorCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * srcPath,
    						 const char * devAlias,
    						 int action,
    						 void * opaque)

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_IO_ERROR with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
srcPath
  The host file on which the IO error occurred
devAlias
  The guest device alias associated with the path
action
  action that is to be taken due to the IO error (virDomainEventIOErrorAction)
opaque
  application specified data

### `virConnectDomainEventIOErrorReasonCallback`

    typedef void	(*virConnectDomainEventIOErrorReasonCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * srcPath,
    							 const char * devAlias,
    							 int action,
    							 const char * reason,
    							 void * opaque)

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON with virConnectDomainEventRegisterAny()

If the I/O error is known to be caused by an ENOSPC condition in the host (where resizing the disk to be larger will allow the guest to be resumed as if nothing happened), `reason` will be "enospc". Otherwise, `reason` will be "", although future strings may be added if determination of other error types becomes possible.

conn
  connection object
dom
  domain on which the event occurred
srcPath
  The host file on which the IO error occurred
devAlias
  The guest device alias associated with the path
action
  action that is to be taken due to the IO error (virDomainEventIOErrorAction)
reason
  the cause of the IO error
opaque
  application specified data

### `virConnectDomainEventJobCompletedCallback`

    typedef void	(*virConnectDomainEventJobCompletedCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 virTypedParameterPtr params,
    							 int nparams,
    							 void * opaque)

This callback occurs when a job (such as migration or backup) running on the domain is completed.

The params array will contain statistics of the just completed job as virDomainGetJobStats would return. The callback must not free `params` (the array will be freed once the callback finishes).

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_JOB_COMPLETED with virConnectDomainEventRegisterAny().

conn
  connection object
dom
  domain on which the event occurred
params
  job statistics stored as an array of virTypedParameter
nparams
  size of the params array
opaque
  application specific data

### `virConnectDomainEventMemoryDeviceSizeChangeCallback`

    typedef void	(*virConnectDomainEventMemoryDeviceSizeChangeCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 const char * alias,
    							 unsigned long long size,
    							 void * opaque)

The callback occurs when the guest acknowledges request to change size of memory device (so far only virtio-mem model supports this). The `size` then reflects the new amount of guest visible memory (in kibibytes).

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_MEMORY_DEVICE_SIZE_CHANGE with virConnectDomainEventRegisterAny().

conn
  connection object
dom
  domain on which the event occurred
alias
  memory device alias
size
  new current size of memory device (in KiB)
opaque
  application specified data

### `virConnectDomainEventMemoryFailureCallback`

    typedef void	(*virConnectDomainEventMemoryFailureCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int recipient,
    							 int action,
    							 unsigned int flags,
    							 void * opaque)

The callback occurs when the hypervisor handles the hardware memory corrupted event.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
recipient
  the recipient of hardware memory failure (virDomainMemoryFailureRecipientType)
action
  the action of hardware memory failure (virDomainMemoryFailureActionType)
flags
  the flags of hardware memory failure (virDomainMemoryFailureFlags)
opaque
  application specified data

### `virConnectDomainEventMetadataChangeCallback`

    typedef void	(*virConnectDomainEventMetadataChangeCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int type,
    							 const char * nsuri,
    							 void * opaque)

This callback is triggered when the domain XML metadata is changed

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_METADATA_CHANGE with virConnectDomainEventRegisterAny().

conn
  connection object
dom
  domain on which the event occurred
type
  a value from virDomainMetadataTypea
nsuri
  XML namespace URI
opaque
  application specified data

### `virConnectDomainEventMigrationIterationCallback`

    typedef void	(*virConnectDomainEventMigrationIterationCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int iteration,
    							 void * opaque)

This callback occurs during live migration when a new iteration over domain's memory starts. The `iteration` value is increased by one every time a new iteration is started to transfer memory pages dirtied since the last iteration.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION with virConnectDomainEventRegisterAny().

conn
  connection object
dom
  domain on which the event occurred
iteration
  current iteration over domain's memory
opaque
  application specific data

### `virConnectDomainEventPMSuspendCallback`

    typedef void	(*virConnectDomainEventPMSuspendCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int reason,
    						 void * opaque)

This callback occurs when the guest is suspended.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_PMSUSPEND with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
reason
  reason why the callback was called, unused currently, always passes 0
opaque
  application specified data

### `virConnectDomainEventPMSuspendDiskCallback`

    typedef void	(*virConnectDomainEventPMSuspendDiskCallback)	(virConnectPtr conn,
    							 virDomainPtr dom,
    							 int reason,
    							 void * opaque)

This callback occurs when the guest is suspended to disk.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
reason
  reason why the callback was called, unused currently, always passes 0
opaque
  application specified data

### `virConnectDomainEventPMWakeupCallback`

    typedef void	(*virConnectDomainEventPMWakeupCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int reason,
    						 void * opaque)

This callback occurs when the guest is woken up.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_PMWAKEUP with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
reason
  reason why the callback was called, unused currently, always passes 0
opaque
  application specified data

### `virConnectDomainEventRTCChangeCallback`

    typedef void	(*virConnectDomainEventRTCChangeCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 long long utcoffset,
    						 void * opaque)

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_RTC_CHANGE with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
utcoffset
  the new RTC offset from UTC, measured in seconds
opaque
  application specified data

### `virConnectDomainEventRegister`

    int	virConnectDomainEventRegister	(virConnectPtr conn,
    					 virConnectDomainEventCallback cb,
    					 void * opaque,
    					 virFreeCallback freecb)

Adds a callback to receive notifications of domain lifecycle events occurring on a connection. This function requires that an event loop has been previously registered with virEventRegisterImpl() or virEventRegisterDefaultImpl().

Use of this method is no longer recommended. Instead applications should try virConnectDomainEventRegisterAny() which has a more flexible API contract.

The virDomainPtr object handle passed into the callback upon delivery of an event is only valid for the duration of execution of the callback. If the callback wishes to keep the domain object after the callback returns, it shall take a reference to it, by calling virDomainRef. The reference can be released once the object is no longer required by calling virDomainFree.

conn
  pointer to the connection
cb
  callback to the function handling domain events
opaque
  opaque data to pass on to the callback
freecb
  optional function to deallocate opaque when not used anymore
Returns
  0 on success, -1 on failure. Older versions of some hypervisors sometimes returned a positive number on success, but without any reliable semantics on what that number represents.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | getattr

### `virConnectDomainEventRegisterAny`

    int	virConnectDomainEventRegisterAny	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int eventID,
    						 virConnectDomainEventGenericCallback cb,
    						 void * opaque,
    						 virFreeCallback freecb)

Adds a callback to receive notifications of arbitrary domain events occurring on a domain. This function requires that an event loop has been previously registered with virEventRegisterImpl() or virEventRegisterDefaultImpl().

If `dom` is NULL, then events will be monitored for any domain. If `dom` is non-NULL, then only the specific domain will be monitored.

Most types of event have a callback providing a custom set of parameters for the event. When registering an event, it is thus necessary to use the VIR_DOMAIN_EVENT_CALLBACK() macro to cast the supplied function pointer to match the signature of this method.

The virDomainPtr object handle passed into the callback upon delivery of an event is only valid for the duration of execution of the callback. If the callback wishes to keep the domain object after the callback returns, it shall take a reference to it, by calling virDomainRef(). The reference can be released once the object is no longer required by calling virDomainFree().

The return value from this method is a non-negative integer identifier for the callback. To unregister a callback, this callback ID should be passed to the virConnectDomainEventDeregisterAny() method.

conn
  pointer to the connection
dom
  pointer to the domain
eventID
  the event type to receive
cb
  callback to the function handling domain events
opaque
  opaque data to pass on to the callback
freecb
  optional function to deallocate opaque when not used anymore
Returns
  a callback identifier on success, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | getattr

### `virConnectDomainEventTrayChangeCallback`

    typedef void	(*virConnectDomainEventTrayChangeCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 const char * devAlias,
    						 int reason,
    						 void * opaque)

This callback occurs when the tray of a removable device is moved.

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_TRAY_CHANGE with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
devAlias
  device alias
reason
  why the tray status was changed? (virDomainEventTrayChangeReason)
opaque
  application specified data

### `virConnectDomainEventTunableCallback`

    typedef void	(*virConnectDomainEventTunableCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 virTypedParameterPtr params,
    						 int nparams,
    						 void * opaque)

This callback occurs when tunable values are updated. The params must not be freed in the callback handler as it's done internally after the callback handler is executed.

Currently supported name spaces: "cputune.*" "blkdeviotune.*"

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_TUNABLE with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
params
  changed tunable values stored as array of virTypedParameter
nparams
  size of the array
opaque
  application specified data

### `virConnectDomainEventWatchdogCallback`

    typedef void	(*virConnectDomainEventWatchdogCallback)	(virConnectPtr conn,
    						 virDomainPtr dom,
    						 int action,
    						 void * opaque)

The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_WATCHDOG with virConnectDomainEventRegisterAny()

conn
  connection object
dom
  domain on which the event occurred
action
  action that is to be taken due to watchdog firing (virDomainEventWatchdogAction)
opaque
  application specified data

### `virConnectDomainXMLFromNative`

    char *	virConnectDomainXMLFromNative	(virConnectPtr conn,
    					 const char * nativeFormat,
    					 const char * nativeConfig,
    					 unsigned int flags)

Reads native configuration data describing a domain, and generates libvirt domain XML. The format of the native data is hypervisor dependent.

conn
  a connection object
nativeFormat
  configuration format importing from
nativeConfig
  the configuration data to import
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. The caller must free() the returned value.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | write | -

### `virConnectDomainXMLToNative`

    char *	virConnectDomainXMLToNative	(virConnectPtr conn,
    					 const char * nativeFormat,
    					 const char * domainXml,
    					 unsigned int flags)

Reads a domain XML configuration document, and generates a native configuration file describing the domain. The format of the native data is hypervisor dependent.

Note that certain hypervisor drivers such as the QEMU driver configure many aspects of the domain dynamically via hypervisor APIs and that may not be part of the returned native configuration format. Similarly certain resources are passed to the hypervisor via file descriptors, which are not part of the native configuration returned by this API. Such configuration is thus not trivially usable outside of libvirt.

conn
  a connection object
nativeFormat
  configuration format exporting to
domainXml
  the domain configuration to export
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  a 0 terminated UTF-8 encoded native config datafile, or NULL in case of error. The caller must free() the returned value.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | write | -

### `virConnectGetAllDomainStats`

    int	virConnectGetAllDomainStats	(virConnectPtr conn,
    					 unsigned int stats,
    					 virDomainStatsRecordPtr ** retStats,
    					 unsigned int flags)

Query statistics for all domains on a given connection.

Report statistics of various parameters for a running VM according to `stats` field. The statistics are returned as an array of structures for each queried domain. The structure contains an array of typed parameters containing the individual statistics. The typed parameter name for each statistic field consists of a dot-separated string containing name of the requested group followed by a group specific description of the statistic value.

The statistic groups are enabled using the `stats` parameter which is a binary-OR of enum virDomainStatsTypes. The following groups are available (although not necessarily implemented for each hypervisor):

VIR_DOMAIN_STATS_STATE: Return domain state and reason for entering that state. The typed parameter keys are in this format:

      "state.state" - state of the VM, returned as int from virDomainState enum
      "state.reason" - reason for entering given state, returned as int from
                       virDomain*Reason enum corresponding to given state.

VIR_DOMAIN_STATS_CPU_TOTAL: Return CPU statistics and usage information. The typed parameter keys are in this format:

      "cpu.time" - total cpu time spent for this domain in nanoseconds
                   as unsigned long long.
      "cpu.user" - user cpu time spent in nanoseconds as unsigned long long.
      "cpu.system" - system cpu time spent in nanoseconds as unsigned long
                     long.
      "cpu.haltpoll.success.time" - halt-polling cpu usage about the VCPU polled
                                    until a virtual interrupt was delivered in
                                    nanoseconds as unsigned long long.
      "cpu.haltpoll.fail.time" - halt-polling cpu usage about the VCPU had to schedule
                                 out (either because the maximum poll time was reached
                                 or it needed to yield the CPU) in nanoseconds as
                                 unsigned long long.
      "cpu.cache.monitor.count" - the number of cache monitors for this domain
      "cpu.cache.monitor.<num>.name" - the name of cache monitor <num>
      "cpu.cache.monitor.<num>.vcpus" - vcpu list of cache monitor <num>
      "cpu.cache.monitor.<num>.bank.count" - the number of cache banks in
                                             cache monitor <num>
      "cpu.cache.monitor.<num>.bank.<index>.id" - host allocated cache id for
                                                  bank <index> in cache
                                                  monitor <num>
      "cpu.cache.monitor.<num>.bank.<index>.bytes" - the number of bytes of
                                                     last level cache that the
                                                     domain is using on cache
                                                     bank <index>

VIR_DOMAIN_STATS_BALLOON: Return memory balloon device information. The typed parameter keys are in this format:

      "balloon.current" - the memory in kiB currently used
                          as unsigned long long.
      "balloon.maximum" - the maximum memory in kiB allowed
                          as unsigned long long.
      "balloon.swap_in" - the amount of data read from swap space (in KiB)
                          as unsigned long long
      "balloon.swap_out" - the amount of memory written out to swap space
                           (in KiB) as unsigned long long
      "balloon.major_fault" - the number of page faults when disk IO was
                              required as unsigned long long
      "balloon.minor_fault" - the number of other page faults
                              as unsigned long long
      "balloon.unused" - the amount of memory left unused by the system
                         (in KiB) as unsigned long long
      "balloon.available" - the amount of usable memory as seen by the domain
                            (in KiB) as unsigned long long
      "balloon.rss" - Resident Set Size of running domain's process
                      (in KiB) as unsigned long long
      "balloon.usable" - the amount of memory which can be reclaimed by balloon
                         without causing host swapping (in KiB)
                         as unsigned long long
      "balloon.last-update" - timestamp of the last update of statistics
                              (in seconds) as unsigned long long
      "balloon.disk_caches" - the amount of memory that can be reclaimed
                              without additional I/O, typically disk (in KiB)
                              as unsigned long long
      "balloon.hugetlb_pgalloc" - the number of successful huge page allocations
                                  from inside the domain via virtio balloon
                                  as unsigned long long
      "balloon.hugetlb_pgfail" - the number of failed huge page allocations
                                 from inside the domain via virtio balloon
                                 as unsigned long long

VIR_DOMAIN_STATS_VCPU: Return virtual CPU statistics. Due to VCPU hotplug, the vcpu.<num>.* array could be sparse. The actual size of the array corresponds to "vcpu.current". The array size will never exceed "vcpu.maximum". The typed parameter keys are in this format:

      "vcpu.current" - current number of online virtual CPUs as unsigned int.
      "vcpu.maximum" - maximum number of online virtual CPUs as unsigned int.
      "vcpu.<num>.state" - state of the virtual CPU <num>, as int
                           from virVcpuState enum.
      "vcpu.<num>.time" - virtual cpu time spent by virtual CPU <num>
                          as unsigned long long.
      "vcpu.<num>.wait" - time the vCPU <num> wants to run, but the host
                          scheduler has something else running ahead of it.
      "vcpu.<num>.halted" - virtual CPU <num> is halted, may indicate the
                            processor is idle or even disabled, depending
                            on the architecture)
      "vcpu.<num>.delay" - time the vCPU <num> thread was enqueued by the
                           host scheduler, but was waiting in the queue
                           instead of running. Exposed to the VM as a steal
                           time.

     This group of statistics also reports additional hypervisor-originating
     per-vCPU stats. The hypervisor-specific statistics in this group have the
     following naming scheme:

      "vcpu.<num>.$NAME.$TYPE"

        $NAME - name of the statistics field provided by the hypervisor

        $TYPE - Type of the value. The following types are returned:
           'cur' - current instant value
           'sum' - aggregate value
           'max' - peak value

       The returned value may be either an unsigned long long or a boolean.
       Meaning is hypervisor specific. Please see the disclaimer for the
       VIR_DOMAIN_STATS_VM group below.

VIR_DOMAIN_STATS_INTERFACE: Return network interface statistics (from domain point of view). The typed parameter keys are in this format:

      "net.count" - number of network interfaces on this domain
                    as unsigned int.
      "net.<num>.name" - name of the interface <num> as string.
      "net.<num>.rx.bytes" - bytes received as unsigned long long.
      "net.<num>.rx.pkts" - packets received as unsigned long long.
      "net.<num>.rx.errs" - receive errors as unsigned long long.
      "net.<num>.rx.drop" - receive packets dropped as unsigned long long.
      "net.<num>.tx.bytes" - bytes transmitted as unsigned long long.
      "net.<num>.tx.pkts" - packets transmitted as unsigned long long.
      "net.<num>.tx.errs" - transmission errors as unsigned long long.
      "net.<num>.tx.drop" - transmit packets dropped as unsigned long long.

VIR_DOMAIN_STATS_BLOCK: Return block devices statistics. By default, this information is limited to the active layer of each <disk> of the domain (where block.count is equal to the number of disks), but adding VIR_CONNECT_GET_ALL_DOMAINS_STATS_BACKING to `flags` will expand the array to cover backing chains (block.count corresponds to the number of host resources used together to provide the guest disks). The typed parameter keys are in this format:

      "block.count" - number of block devices in the subsequent list,
                      as unsigned int.
      "block.<num>.name" - name of the block device <num> as string.
                           matches the target name (vda/sda/hda) of the
                           block device.  If the backing chain is listed,
                           this name is the same for all host resources tied
                           to the same guest device.
      "block.<num>.backingIndex" - unsigned int giving the <backingStore>
                                    index, only used when backing images
                                    are listed.
      "block.<num>.path" - string describing the source of block device <num>,
                           if it is a file or block device (omitted for network
                           sources and drives with no media inserted).
      "block.<num>.rd.reqs" - number of read requests as unsigned long long.
      "block.<num>.rd.bytes" - number of read bytes as unsigned long long.
      "block.<num>.rd.times" - total time (ns) spent on reads as
                               unsigned long long.
      "block.<num>.wr.reqs" - number of write requests as unsigned long long.
      "block.<num>.wr.bytes" - number of written bytes as unsigned long long.
      "block.<num>.wr.times" - total time (ns) spent on writes as
                               unsigned long long.
      "block.<num>.fl.reqs" - total flush requests as unsigned long long.
      "block.<num>.fl.times" - total time (ns) spent on cache flushing as
                               unsigned long long.
      "block.<num>.errors" - Xen only: the 'oo_req' value as
                             unsigned long long.
      "block.<num>.allocation" - offset of the highest written sector
                                 as unsigned long long.
      "block.<num>.capacity" - logical size in bytes of the block device
                               backing image as unsigned long long.
      "block.<num>.physical" - physical size in bytes of the container of the
                               backing image as unsigned long long.
      "block.<num>.threshold" - current threshold for delivering the
                                VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD
                                event in bytes. See virDomainSetBlockThreshold.

VIR_DOMAIN_STATS_PERF: Return perf event statistics. The typed parameter keys are in this format:

      "perf.cmt" - the usage of l3 cache (bytes) by applications running on
                   the platform as unsigned long long. It is produced by cmt
                   perf event.
      "perf.mbmt" - the total system bandwidth (bytes/s) from one level of
                    cache to another as unsigned long long. It is produced
                    by mbmt perf event.
      "perf.mbml" - the amount of data (bytes/s) sent through the memory
                    controller on the socket as unsigned long long. It is
                    produced by mbml perf event.
      "perf.cache_misses" - the count of cache misses as unsigned long long.
                            It is produced by cache_misses perf event.
      "perf.cache_references" - the count of cache hits as unsigned long long.
                                It is produced by cache_references perf event.
      "perf.instructions" - The count of instructions as unsigned long long.
                            It is produced by instructions perf event.
      "perf.cpu_cycles" - The count of cpu cycles (total/elapsed) as an
                          unsigned long long. It is produced by cpu_cycles
                          perf event.
      "perf.branch_instructions" - The count of branch instructions as
                                   unsigned long long. It is produced by
                                   branch_instructions perf event.
      "perf.branch_misses" - The count of branch misses as unsigned long
                             long. It is produced by branch_misses perf event.
      "perf.bus_cycles" - The count of bus cycles as unsigned long
                          long. It is produced by bus_cycles perf event.
      "perf.stalled_cycles_frontend" - The count of stalled cpu cycles in the
                                       frontend of the instruction processor
                                       pipeline as unsigned long long. It is
                                       produced by stalled_cycles_frontend
                                       perf event.
      "perf.stalled_cycles_backend"  - The count of stalled cpu cycles in the
                                       backend of the instruction processor
                                       pipeline as unsigned long long. It is
                                       produced by stalled_cycles_backend
                                       perf event.
      "perf.ref_cpu_cycles" - The count of total cpu cycles not affected by
                              CPU frequency scaling by applications running
                              as unsigned long long. It is produced by the
                              ref_cpu_cycles perf event.
      "perf.cpu_clock" - The count of cpu clock time as unsigned long long.
                         It is produced by the cpu_clock perf event.
      "perf.task_clock" - The count of task clock time as unsigned long long.
                          It is produced by the task_clock perf event.
      "perf.page_faults" - The count of page faults as unsigned long long.
                           It is produced by the page_faults perf event
      "perf.context_switches" - The count of context switches as unsigned long
                                long. It is produced by the context_switches
                                perf event.
      "perf.cpu_migrations" - The count of cpu migrations, from one logical
                              processor to another, as unsigned long
                              long. It is produced by the cpu_migrations
                              perf event.
      "perf.page_faults_min" - The count of minor page faults as unsigned
                               long long. It is produced by the
                               page_faults_min perf event.
      "perf.page_faults_maj" - The count of major page faults as unsigned
                               long long. It is produced by the
                               page_faults_maj perf event.
      "perf.alignment_faults" - The count of alignment faults as unsigned
                                long long. It is produced by the
                                alignment_faults perf event
      "perf.emulation_faults" - The count of emulation faults as unsigned
                                long long. It is produced by the
                                emulation_faults perf event

VIR_DOMAIN_STATS_IOTHREAD: Return IOThread statistics if available. IOThread polling is a timing mechanism that allows the hypervisor to generate a longer period of time in which the guest will perform operations on the CPU being used by the IOThread. The higher the value for poll-max-ns the longer the guest will keep the CPU. This may affect other host threads using the CPU. The poll-grow and poll-shrink values allow the hypervisor to generate a mechanism to add or remove polling time within the confines of 0 and poll-max-ns. For QEMU, the poll-grow is multiplied by the polling interval, while poll-shrink is used as a divisor. When not provided, QEMU may double the polling time until poll-max-ns is reached. When poll-shrink is 0 (zero) QEMU may reset the polling interval to 0 until it finds its "sweet spot". Setting poll-grow too large may cause frequent fluctuation of the time; however, this can be tempered by a high poll-shrink to reduce the polling interval. For example, a poll-grow of 3 will triple the polling time which could quickly exceed poll-max-ns; however, a poll-shrink of 10 would cut that polling time more gradually.

      The typed parameter keys are in this format:

      "iothread.count" - maximum number of IOThreads in the subsequent list
                         as unsigned int. Each IOThread in the list will
                         will use it's iothread_id value as the <id>. There
                         may be fewer <id> entries than the iothread.count
                         value if the polling values are not supported.
      "iothread.<id>.poll-max-ns" - maximum polling time in ns as an unsigned
                                    long long. A 0 (zero) means polling is
                                    disabled.
      "iothread.<id>.poll-grow" - polling time factor as an unsigned int or
                                  unsigned long long if exceeding range of
                                  unsigned int.
                                  A 0 (zero) indicates to allow the underlying
                                  hypervisor to choose how to grow the
                                  polling time.
      "iothread.<id>.poll-shrink" - polling time divisor as an unsigned int or
                                    unsigned long long if exceeding range of
                                    unsigned int.
                                    A 0 (zero) indicates to allow the underlying
                                    hypervisor to choose how to shrink the
                                    polling time.

VIR_DOMAIN_STATS_MEMORY: Return memory bandwidth statistics and the usage information. The typed parameter keys are in this format:

      "memory.bandwidth.monitor.count" - the number of memory bandwidth
                                         monitors for this domain
      "memory.bandwidth.monitor.<num>.name" - the name of monitor <num>
      "memory.bandwidth.monitor.<num>.vcpus" - the vcpu list of monitor <num>
      "memory.bandwidth.monitor.<num>.node.count" - the number of memory
                                             controller in monitor <num>
      "memory.bandwidth.monitor.<num>.node.<index>.id" - host allocated memory
                                                  controller id for controller
                                                  <index> of monitor <num>
      "memory.bandwidth.monitor.<num>.node.<index>.bytes.local" - the
                        accumulative bytes consumed by @vcpus that passing
                        through the memory controller in the same processor
                        that the scheduled host CPU belongs to.
      "memory.bandwidth.monitor.<num>.node.<index>.bytes.total" - the total
                        bytes consumed by @vcpus that passing through all
                        memory controllers, either local or remote controller.

VIR_DOMAIN_STATS_DIRTYRATE: Return memory dirty rate information. The typed parameter keys are in this format:

      "dirtyrate.calc_status" - the status of last memory dirty rate calculation,
                                returned as int from virDomainDirtyRateStatus
                                enum.
      "dirtyrate.calc_start_time" - the start time of last memory dirty rate
                                    calculation as long long.
      "dirtyrate.calc_period" - the period of last memory dirty rate calculation
                                as int.
      "dirtyrate.megabytes_per_second" - the calculated memory dirty rate in
                                         MiB/s as long long. It is produced
                                         only if the calc_status is measured.
      "dirtyrate.calc_mode" - the calculation mode used last measurement, either
                              of these 3 'page-sampling,dirty-bitmap,dirty-ring'
                              values returned.
      "dirtyrate.vcpu.<num>.megabytes_per_second" - the calculated memory dirty
                                                    rate for a virtual cpu as
                                                    unsigned long long.

VIR_DOMAIN_STATS_VM: Return hypervisor-specific statistics. Note that the naming and meaning of the fields is entirely hypervisor dependent.

      The statistics in this group have the following naming scheme:

      "vm.$NAME.$TYPE"

        $NAME - name of the statistics field provided by the hypervisor

        $TYPE - Type of the value. The following types are returned:
           'cur' - current instant value
           'sum' - aggregate value
           'max' - peak value

       The returned value may be either an unsigned long long or a boolean.

      WARNING:
       The stats reported in this group are runtime-collected and
       hypervisor originated, thus fall outside of the usual stable API
       policies of libvirt.

       Libvirt can't guarantee that the statistics reported from the outside
       source will be present in further versions of the hypervisor, or that
       naming or meaning will stay consistent. Changes to existing fields,
       however, are expected to be rare.

Note that entire stats groups or individual stat fields may be missing from the output in case they are not supported by the given hypervisor, are not applicable for the current state of the guest domain, or their retrieval was not successful.

Using 0 for `stats` returns all stats groups supported by the given hypervisor.

Specifying VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS as `flags` makes the function return error in case some of the stat types in `stats` were not recognized by the daemon. However, even with this flag, a hypervisor may omit individual fields within a known group if the information is not available; as an extreme example, a supported group may produce zero fields for offline domains if the statistics are meaningful only for a running domain.

Passing VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT in `flags` means when libvirt is unable to fetch stats for any of the domains (for whatever reason) only a subset of statistics is returned for the domain. That subset being statistics that don't involve querying the underlying hypervisor.

Similarly to virConnectListAllDomains, `flags` can contain various flags to filter the list of domains to provide stats for.

VIR_CONNECT_GET_ALL_DOMAINS_STATS_ACTIVE selects online domains while VIR_CONNECT_GET_ALL_DOMAINS_STATS_INACTIVE selects offline ones.

VIR_CONNECT_GET_ALL_DOMAINS_STATS_PERSISTENT and VIR_CONNECT_GET_ALL_DOMAINS_STATS_TRANSIENT allow to filter the list according to their persistence.

To filter the list of VMs by domain state `flags` can contain VIR_CONNECT_GET_ALL_DOMAINS_STATS_RUNNING, VIR_CONNECT_GET_ALL_DOMAINS_STATS_PAUSED, VIR_CONNECT_GET_ALL_DOMAINS_STATS_SHUTOFF and/or VIR_CONNECT_GET_ALL_DOMAINS_STATS_OTHER for all other states.

conn
  pointer to the hypervisor connection
stats
  stats to return, binary-OR of virDomainStatsTypes
retStats
  Pointer that will be filled with the array of returned stats
flags
  extra flags; binary-OR of virConnectGetAllDomainStatsFlags
Returns
  the count of returned statistics structures on success, -1 on error. The requested data are returned in the `retStats` parameter. The returned array should be freed by the caller. See virDomainStatsRecordListFree.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | read

### `virConnectGetDomainCapabilities`

    char *	virConnectGetDomainCapabilities	(virConnectPtr conn,
    					 const char * emulatorbin,
    					 const char * arch,
    					 const char * machine,
    					 const char * virttype,
    					 unsigned int flags)

Prior creating a domain (for instance via virDomainCreateXML or virDomainDefineXML) it may be suitable to know what the underlying emulator and/or libvirt is capable of. For instance, if host, libvirt and qemu is capable of VFIO passthrough and so on.

conn
  pointer to the hypervisor connection
emulatorbin
  path to emulator
arch
  domain architecture
machine
  machine type
virttype
  virtualization type
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  NULL in case of error or an XML string defining the capabilities.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | write | -

### `virConnectListAllDomains`

    int	virConnectListAllDomains	(virConnectPtr conn,
    					 virDomainPtr ** domains,
    					 unsigned int flags)

Collect a possibly-filtered list of all domains, and return an allocated array of information for each. This API solves the race inherent in virConnectListDomains() and virConnectListDefinedDomains().

Normally, all domains are returned; however, `flags` can be used to filter the results for a smaller list of targeted domains. The valid flags are divided into groups, where each group contains bits that describe mutually exclusive attributes of a domain, and where all bits within a group describe all possible domains. Some hypervisors might reject explicit bits from a group where the hypervisor cannot make a distinction (for example, not all hypervisors can tell whether domains have snapshots). For a group supported by a given hypervisor, the behavior when no bits of a group are set is identical to the behavior when all bits in that group are set. When setting bits from more than one group, it is possible to select an impossible combination (such as an inactive transient domain), in that case a hypervisor may return either 0 or an error.

The first group of `flags` is VIR_CONNECT_LIST_DOMAINS_ACTIVE (online domains) and VIR_CONNECT_LIST_DOMAINS_INACTIVE (offline domains).

The next group of `flags` is VIR_CONNECT_LIST_DOMAINS_PERSISTENT (defined domains) and VIR_CONNECT_LIST_DOMAINS_TRANSIENT (running but not defined).

The next group of `flags` covers various domain states: VIR_CONNECT_LIST_DOMAINS_RUNNING, VIR_CONNECT_LIST_DOMAINS_PAUSED, VIR_CONNECT_LIST_DOMAINS_SHUTOFF, and a catch-all for all other states (such as crashed, this catch-all covers the possibility of adding new states).

The remaining groups cover boolean attributes commonly asked about domains; they include VIR_CONNECT_LIST_DOMAINS_MANAGEDSAVE and VIR_CONNECT_LIST_DOMAINS_NO_MANAGEDSAVE, for filtering based on whether a managed save image exists; VIR_CONNECT_LIST_DOMAINS_AUTOSTART and VIR_CONNECT_LIST_DOMAINS_NO_AUTOSTART, for filtering based on autostart; VIR_CONNECT_LIST_DOMAINS_HAS_SNAPSHOT and VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT, for filtering based on whether a domain has snapshots; VIR_CONNECT_LIST_DOMAINS_HAS_CHECKPOINT and VIR_CONNECT_LIST_DOMAINS_NO_CHECKPOINT, for filtering based on whether a domain has checkpoints.

Example of usage:

    virDomainPtr *domains;
    size_t i;
    int ret;
    unsigned int flags = VIR_CONNECT_LIST_DOMAINS_RUNNING |
                         VIR_CONNECT_LIST_DOMAINS_PERSISTENT;
    ret = virConnectListAllDomains(conn, &domains, flags);
    if (ret < 0)
        error();
    for (i = 0; i < ret; i++) {
         do_something_with_domain(domains[i]);
         //here or in a separate loop if needed
         virDomainFree(domains[i]);
    }
    free(domains);

conn
  Pointer to the hypervisor connection.
domains
  Pointer to a variable to store the array containing domain objects or NULL if the list is not required (just returns number of guests).
flags
  bitwise-OR of virConnectListAllDomainsFlags
Returns
  the number of domains found or -1 and sets domains to NULL in case of error. On success, the array stored into `domains` is guaranteed to have an extra allocated element set to NULL but not included in the return count, to make iteration easier. The caller is responsible for calling virDomainFree() on each array element, then calling free() on `domains`.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | getattr

### `virConnectListDefinedDomains`

    int	virConnectListDefinedDomains	(virConnectPtr conn,
    					 char ** const names,
    					 int maxnames)

list the defined but inactive domains, stores the pointers to the names in `names`

The use of this function is discouraged. Instead, use virConnectListAllDomains().

conn
  pointer to the hypervisor connection
names
  pointer to an array to store the names
maxnames
  size of the array
Returns
  the number of names provided in the array or -1 in case of error. Note that this command is inherently racy; a domain can be defined between a call to virConnectNumOfDefinedDomains() and this call; you are only guaranteed that all currently defined domains were listed if the return is less than `maxids`. The client must call free() on each returned name.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | getattr

### `virConnectListDomains`

    int	virConnectListDomains		(virConnectPtr conn,
    					 int * ids,
    					 int maxids)

Collect the list of active domains, and store their IDs in array `ids`

The use of this function is discouraged. Instead, use virConnectListAllDomains().

conn
  pointer to the hypervisor connection
ids
  array to collect the list of IDs of active domains
maxids
  size of `ids`
Returns
  the number of domains found or -1 in case of error. Note that this command is inherently racy; a domain can be started between a call to virConnectNumOfDomains() and this call; you are only guaranteed that all currently active domains were listed if the return is less than `maxids`.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | getattr

### `virConnectNumOfDefinedDomains`

    int	virConnectNumOfDefinedDomains	(virConnectPtr conn)

Provides the number of defined but inactive domains.

conn
  pointer to the hypervisor connection
Returns
  the number of domain found or -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | getattr

### `virConnectNumOfDomains`

    int	virConnectNumOfDomains		(virConnectPtr conn)

Provides the number of active domains.

conn
  pointer to the hypervisor connection
Returns
  the number of domain found or -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
connect | search-domains | -

##### Access control return value filters

Object | Permission
--- | ---
domain | getattr

### `virDomainAbortJob`

    int	virDomainAbortJob		(virDomainPtr domain)

Requests that the current background job be aborted at the soonest opportunity. In case the job is a migration in a post-copy mode, virDomainAbortJob will report an error (see virDomainMigrateStartPostCopy for more details).

domain
  a domain object
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainAbortJobFlags`

    int	virDomainAbortJobFlags		(virDomainPtr domain,
    					 unsigned int flags)

Requests that the current background job be aborted at the soonest opportunity. In case the job is a migration in a post-copy mode, this function will report an error unless VIR_DOMAIN_ABORT_JOB_POSTCOPY flag is used (see virDomainMigrateStartPostCopy for more details).

domain
  a domain object
flags
  bitwise-OR of virDomainAbortJobFlagsValues
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainAddIOThread`

    int	virDomainAddIOThread		(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 unsigned int flags)

Dynamically add an IOThread to the domain. It is left up to the underlying virtual hypervisor to determine the valid range for an `iothread_id` and determining whether the `iothread_id` already exists.

Note that this call can fail if the underlying virtualization hypervisor does not support it or if growing the number is arbitrarily limited. This function requires privileged access to the hypervisor.

`flags` may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG. Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects a running domain and may fail if domain is not alive. If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed.

domain
  a domain object
iothread_id
  the specific IOThread ID value to add
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainAgentSetResponseTimeout`

    int	virDomainAgentSetResponseTimeout	(virDomainPtr domain,
    						 int timeout,
    						 unsigned int flags)

Set how long to wait for a response from guest agent commands. By default, agent commands block forever waiting for a response.

`timeout` must be a value from virDomainAgentResponseTimeoutValues or positive:

    VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK(-2): meaning to block forever
       waiting for a result.
    VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT(-1): use default timeout value.
    VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT(0): does not wait.
    positive value: wait for @timeout seconds

domain
  a domain object
timeout
  timeout in seconds
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 on success, -1 on failure

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainAttachDevice`

    int	virDomainAttachDevice		(virDomainPtr domain,
    					 const char * xml)

Create a virtual device attachment to backend. This function, having hotplug semantics, is only allowed on an active domain.

For compatibility, this method can also be used to change the media in an existing CDROM/Floppy device, however, applications are recommended to use the virDomainUpdateDeviceFlags method instead.

Be aware that hotplug changes might not persist across a domain going into S4 state (also known as hibernation) unless you also modify the persistent domain definition.

domain
  pointer to domain object
xml
  pointer to XML description of one device
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainAttachDeviceFlags`

    int	virDomainAttachDeviceFlags	(virDomainPtr domain,
    					 const char * xml,
    					 unsigned int flags)

Attach a virtual device to a domain, using the flags parameter to control how the device is attached. VIR_DOMAIN_AFFECT_CURRENT specifies that the device allocation is made based on current domain state. VIR_DOMAIN_AFFECT_LIVE specifies that the device shall be allocated to the active domain instance only and is not added to the persisted domain configuration. VIR_DOMAIN_AFFECT_CONFIG specifies that the device shall be allocated to the persisted domain configuration only. Note that the target hypervisor must return an error if unable to satisfy flags. E.g. the hypervisor driver will return failure if LIVE is specified but it only supports modifying the persisted device allocation.

For compatibility, this method can also be used to change the media in an existing CDROM/Floppy device, however, applications are recommended to use the virDomainUpdateDeviceFlag method instead.

Be aware that hotplug changes might not persist across a domain going into S4 state (also known as hibernation) unless you also modify the persistent domain definition.

domain
  pointer to domain object
xml
  pointer to XML description of one device
flags
  bitwise-OR of virDomainDeviceModifyFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainAuthorizedSSHKeysGet`

    int	virDomainAuthorizedSSHKeysGet	(virDomainPtr domain,
    					 const char * user,
    					 char *** keys,
    					 unsigned int flags)

For given `user` in `domain` fetch list of public SSH authorized keys and store them into `keys` array which is allocated upon successful return and is NULL terminated. The caller is responsible for freeing `keys` when no longer needed.

Keys are in OpenSSH format (see sshd(8)) but from libvirt's point of view are opaque strings, i.e. not interpreted.

Please note that some hypervisors may require guest agent to be configured and running in order to be able to run this API.

domain
  a domain object
user
  user to list keys for
keys
  pointer to a variable to store authorized keys
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  number of keys stored in `keys`, -1 otherwise.

### `virDomainAuthorizedSSHKeysSet`

    int	virDomainAuthorizedSSHKeysSet	(virDomainPtr domain,
    					 const char * user,
    					 const char ** keys,
    					 unsigned int nkeys,
    					 unsigned int flags)

For given `user` in `domain` set `keys` in authorized keys file. Any previous content of the file is overwritten with new keys. That is, if this API is called with `nkeys` = 0, `keys` = NULL and `flags` = 0 then the authorized keys file for `user` is cleared out.

Keys are in OpenSSH format (see sshd(8)) but from libvirt's point of view are opaque strings, i.e. not interpreted.

If VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND flag is set then the file is not overwritten and new `keys` are appended instead.

If VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE flag is set then instead of adding any new keys, provided `keys` are removed from the file. It's not considered error if the key doesn't exist.

Please note that some hypervisors may require guest agent to be configured and running in order to be able to run this API.

domain
  a domain object
user
  user to add keys for
keys
  authorized keys to set
nkeys
  number of keys in `keys` array
flags
  bitwise or of virDomainAuthorizedSSHKeysSetFlags
Returns
  0 on success, -1 otherwise.

### `virDomainBackupBegin`

    int	virDomainBackupBegin		(virDomainPtr domain,
    					 const char * backupXML,
    					 const char * checkpointXML,
    					 unsigned int flags)

Start a point-in-time backup job for the specified disks of a running domain.

A backup job is a domain job and thus mutually exclusive with any other domain job such as migration.

For now, backup jobs are also mutually exclusive with any other block job on the same device, although this restriction may be lifted in a future release. Progress of the backup job can be tracked via virDomainGetJobStats(). Completion of the job is also announced asynchronously via VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event.

There are two fundamental backup approaches. The first, called a push model, instructs the hypervisor to copy the state of the guest disk to the designated storage destination (which may be on the local file system or a network device). In this mode, the hypervisor writes the content of the guest disk to the destination, then emits VIR_DOMAIN_EVENT_ID_JOB_COMPLETED when the backup is either complete or failed (the backup image is invalid if the job fails or virDomainAbortJob() is used prior to the event being emitted). This kind of the job finishes automatically. Users can determine success by using virDomainGetJobStats() with VIR_DOMAIN_JOB_STATS_COMPLETED flag.

The second, called a pull model, instructs the hypervisor to expose the state of the guest disk over an NBD export. A third-party client can then connect to this export and read whichever portions of the disk it desires. In this mode libvirt has to be informed via virDomainAbortJob() when the third-party NBD client is done and the backup resources can be released.

The `backupXML` parameter contains details about the backup in the top-level element <domainbackup>, including which backup mode to use, whether the backup is incremental from a previous checkpoint, which disks participate in the backup, the destination for a push model backup, and the temporary storage and NBD server details for a pull model backup.

virDomainBackupGetXMLDesc() can be called to learn actual values selected. For more information, see https://libvirt.org/formatbackup.html#backup-xml

The `checkpointXML` parameter is optional; if non-NULL, then libvirt behaves as if virDomainCheckpointCreateXML() were called to create a checkpoint atomically covering the same point in time as the backup.

The VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL specifies that the output or temporary files described by the `backupXML` document were created by the caller with correct format and size to hold the backup or temporary data.

The creation of a new checkpoint allows for future incremental backups. Note that some hypervisors may require a particular disk format, such as qcow2, in order to take advantage of checkpoints, while allowing arbitrary formats if checkpoints are not involved.

domain
  a domain object
backupXML
  description of the requested backup
checkpointXML
  description of a checkpoint to create or NULL
flags
  bitwise or of virDomainBackupBeginFlags
Returns
  0 on success or -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | checkpoint | -
domain | block-write | -

### `virDomainBackupGetXMLDesc`

    char *	virDomainBackupGetXMLDesc	(virDomainPtr domain,
    					 unsigned int flags)

Queries the configuration of the active backup job.

In some cases, a user can start a backup job without supplying all details and rely on libvirt to fill in the rest (for example, selecting the port used for an NBD export). This API can then be used to learn what default values were chosen.

domain
  a domain object
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  a NUL-terminated UTF-8 encoded XML instance or NULL in case of error. The caller must free() the returned value.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainBlockCommit`

    int	virDomainBlockCommit		(virDomainPtr dom,
    					 const char * disk,
    					 const char * base,
    					 const char * top,
    					 unsigned long bandwidth,
    					 unsigned int flags)

Commit changes that were made to temporary top-level files within a disk image backing file chain into a lower-level base file. In other words, take all the difference between `base` and `top`, and update `base` to contain that difference; after the commit, any portion of the chain that previously depended on `top` will now depend on `base`, and all files after `base` up to and including `top` will now be invalidated. A typical use of this command is to reduce the length of a backing file chain after taking an external disk snapshot. To move data in the opposite direction, see virDomainBlockPull().

This command starts a long-running commit block job, whose status may be tracked by virDomainBlockJobInfo() with a job type of VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT, and the operation can be aborted with virDomainBlockJobAbort(). When finished, an asynchronous event is raised to indicate the final status, and the job no longer exists. If the job is aborted, it is up to the hypervisor whether starting a new job will resume from the same point, or start over.

As a special case, if `top` is the active image (or NULL), and `flags` includes VIR_DOMAIN_BLOCK_COMMIT_ACTIVE, the block job will have a type of VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT, and operates in two phases. In the first phase, the contents are being committed into `base`, and the job can only be canceled. The job transitions to the second phase when the block job event with state VIR_DOMAIN_BLOCK_JOB_READY is emitted for the given device. This information is also visible in the live XML as 'ready="yes"' attribute of the corresponding <mirror> element. Once in the second phase, the user must choose whether to cancel the job (keeping `top` as the active image, but now containing only the changes since the time the job ended) or to pivot the job (adjusting to `base` as the active image, and invalidating `top`).

Be aware that this command may invalidate files even if it is aborted; the user is cautioned against relying on the contents of invalidated intermediate files such as `top` (when `top` is not the active image) without manually rebasing those files to use a backing file of a read-only copy of `base` prior to the point where the commit operation was started (and such a rebase cannot be safely done until the commit has successfully completed). However, the domain itself will not have any issues; the active layer remains valid throughout the entire commit operation.

Some hypervisors may support a shortcut where if `flags` contains VIR_DOMAIN_BLOCK_COMMIT_DELETE, then this command will unlink all files that were invalidated, after the commit successfully completes.

If `flags` contains VIR_DOMAIN_BLOCK_COMMIT_RELATIVE, the name recorded into the overlay of the `top` image (if there is such image) as the path to the new backing file will be kept relative to other images. The operation will fail if libvirt can't infer the name.

By default, if `base` is NULL, the commit target will be the bottom of the backing chain; if `flags` contains VIR_DOMAIN_BLOCK_COMMIT_SHALLOW, then the immediate backing file of `top` will be used instead. If `top` is NULL, the active image at the top of the chain will be used. Some hypervisors place restrictions on how much can be committed, and might fail if `base` is not the immediate backing file of `top`, or if `top` is the active layer in use by a running domain but `flags` did not include VIR_DOMAIN_BLOCK_COMMIT_ACTIVE, or if `top` is not the top-most file; restrictions may differ for online vs. offline domains.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

The `base` and `top` parameters can be either paths to files within the backing chain, or the device target shorthand (the <target dev='...'/> sub-element, such as "vda") followed by an index to the backing chain enclosed in square brackets. Backing chain indexes can be found by inspecting //disk//backingStore/`//disk//backingStore/index` in the domain XML. Thus, for example, "vda[3]" refers to the backing store with index equal to "3" in the chain of disk "vda".

The maximum bandwidth that will be used to do the commit can be specified with the `bandwidth` parameter. If set to 0, there is no limit. If `flags` includes VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES, `bandwidth` is in bytes/second; otherwise, it is in MiB/second. Values larger than 2^52 bytes/sec may be rejected due to overflow considerations based on the word size of both client and server, and values larger than 2^31 bytes/sec may cause overflow problems if later queried by virDomainGetBlockJobInfo() without scaling. Hypervisors may further restrict the range of valid bandwidth values. Some hypervisors do not support this feature and will return an error if bandwidth is not 0; in this case, it might still be possible for a later call to virDomainBlockJobSetSpeed() to succeed. The actual speed can be determined with virDomainGetBlockJobInfo().

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
base
  path to backing file to merge into, or device shorthand, or NULL for default
top
  path to file within backing chain that contains data to be merged, or device shorthand, or NULL to merge all possible data
bandwidth
  (optional) specify bandwidth limit; flags determine the unit
flags
  bitwise-OR of virDomainBlockCommitFlags
Returns
  0 if the operation has started, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | block-write | -

### `virDomainBlockCopy`

    int	virDomainBlockCopy		(virDomainPtr dom,
    					 const char * disk,
    					 const char * destxml,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Copy the guest-visible contents of a disk image to a new file described by `destxml`. The destination XML has a top-level element of <disk>, and resembles what is used when hot-plugging a disk via virDomainAttachDevice(), except that only sub-elements related to describing the new host resource are necessary (sub-elements related to the guest view, such as <target>, are ignored). It is strongly recommended to include a <driver type='...'/> format designation for the destination, to avoid the potential of any security problem that might be caused by probing a file for its format.

This command starts a long-running copy. By default, the copy will pull the entire source chain into the destination file, but if `flags` also contains VIR_DOMAIN_BLOCK_COPY_SHALLOW, then only the top of the source chain will be copied (the source and destination have a common backing file). The format of the destination file is controlled by the <driver> sub-element of the XML. The destination will be created unless the VIR_DOMAIN_BLOCK_COPY_REUSE_EXT flag is present stating that the file was pre-created with the correct format and metadata and sufficient size to hold the copy. In case the VIR_DOMAIN_BLOCK_COPY_SHALLOW flag is used the pre-created file has to exhibit the same guest visible contents as the backing file of the original image. This allows a management app to pre-create files with relative backing file names, rather than the default of absolute backing file names.

A copy job has two parts; in the first phase, the source is copied into the destination, and the job can only be canceled by reverting to the source file; progress in this phase can be tracked via the virDomainBlockJobInfo() command, with a job type of VIR_DOMAIN_BLOCK_JOB_TYPE_COPY. The job transitions to the second phase when the block job event with state VIR_DOMAIN_BLOCK_JOB_READY is emitted for the given device. This information is also visible in the live XML as 'ready="yes"' attribute of the corresponding <mirror> element. All further changes are saved to both source and destination. The user must call virDomainBlockJobAbort() to end the mirroring while choosing whether to revert to source or pivot to the destination. An event is issued when the job ends, and depending on the hypervisor, an event may also be issued when the job transitions from pulling to mirroring. If the job is aborted, a new job will have to start over from the beginning of the first phase.

Some hypervisors will restrict certain actions, such as virDomainSave() or virDomainDetachDevice(), while a copy job is active; they may also restrict a copy job to transient domains.

If `flags` contains VIR_DOMAIN_BLOCK_COPY_TRANSIENT_JOB the job will not be recoverable if the VM is turned off while job is active. This flag will remove the restriction of copy jobs to transient domains. Note that this flag is automatically implied if the VM is transient at the time it's started.

If `flags` contains VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES the job will wait for guest writes to be propagated both to the original image and to the destination of the copy so that it's guaranteed that the job converges if the destination storage is slower. This may impact performance of writes while the blockjob is running.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

The `params` and `nparams` arguments can be used to set hypervisor-specific tuning parameters, such as maximum bandwidth or granularity. For a parameter that the hypervisor understands, explicitly specifying 0 behaves the same as omitting the parameter, to use the hypervisor default; however, omitting a parameter is less likely to fail.

This command is a superset of the older virDomainBlockRebase() when used with the VIR_DOMAIN_BLOCK_REBASE_COPY flag, and offers better control over the destination format, the ability to copy to a destination that is not a local file, and the possibility of additional tuning parameters.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
destxml
  XML description of the copy destination
params
  Pointer to block copy parameter objects, or NULL
nparams
  Number of block copy parameters (this value can be the same or less than the number of parameters supported)
flags
  bitwise-OR of virDomainBlockCopyFlags
Returns
  0 if the operation has started, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | block-write | -

### `virDomainBlockJobAbort`

    int	virDomainBlockJobAbort		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned int flags)

Cancel the active block job on the given disk.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

If the current block job for `disk` is VIR_DOMAIN_BLOCK_JOB_TYPE_PULL, then by default, this function performs a synchronous operation and the caller may assume that the operation has completed when 0 is returned. However, BlockJob operations may take a long time to cancel, and during this time further domain interactions may be unresponsive. To avoid this problem, pass VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC in the `flags` argument to enable asynchronous behavior, returning as soon as possible. When the job has been canceled, a BlockJob event will be emitted, with status VIR_DOMAIN_BLOCK_JOB_CANCELED (even if the ABORT_ASYNC flag was not used); it is also possible to poll virDomainBlockJobInfo() to see if the job cancellation is still pending. This type of job can be restarted to pick up from where it left off.

If the current block job for `disk` is VIR_DOMAIN_BLOCK_JOB_TYPE_COPY, then the default is to abort the mirroring and revert to the source disk; likewise, if the current job is VIR_DOMAIN_BLOCK_JOB_TYPE_ACTIVE_COMMIT, the default is to abort without changing the active layer of `disk`. Adding `flags` of VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT causes this call to fail with VIR_ERR_BLOCK_COPY_ACTIVE if the copy or commit is not yet ready; otherwise it will swap the disk over to the new active image to end the mirroring or active commit. An event will be issued when the job is ended, and it is possible to use VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC to control whether this command waits for the completion of the job. Restarting a copy or active commit job requires starting over from the beginning of the first phase.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
flags
  bitwise-OR of virDomainBlockJobAbortFlags
Returns
  -1 in case of failure, 0 when successful.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainBlockJobSetSpeed`

    int	virDomainBlockJobSetSpeed	(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long bandwidth,
    					 unsigned int flags)

Set the maximum allowable bandwidth that a block job may consume. If bandwidth is 0, the limit will revert to the hypervisor default of unlimited.

If `flags` contains VIR_DOMAIN_BLOCK_JOB_SPEED_BANDWIDTH_BYTES, `bandwidth` is in bytes/second; otherwise, it is in MiB/second. Values larger than 2^52 bytes/sec may be rejected due to overflow considerations based on the word size of both client and server, and values larger than 2^31 bytes/sec may cause overflow problems if later queried by virDomainGetBlockJobInfo() without scaling. Hypervisors may further restrict the range of valid bandwidth values.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
bandwidth
  specify bandwidth limit; flags determine the unit
flags
  bitwise-OR of virDomainBlockJobSetSpeedFlags
Returns
  -1 in case of failure, 0 when successful.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainBlockPeek`

    int	virDomainBlockPeek		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long long offset,
    					 size_t size,
    					 void * buffer,
    					 unsigned int flags)

This function allows you to read the contents of a domain's disk device.

Typical uses for this are to determine if the domain has written a Master Boot Record (indicating that the domain has completed installation), or to try to work out the state of the domain's filesystems.

(Note that in the local case you might try to open the block device or file directly, but that won't work in the remote case, nor if you don't have sufficient permission. Hence the need for this call).

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

'offset' and 'size' represent an area which must lie entirely within the device or file. 'size' may be 0 to test if the call would succeed.

'buffer' is the return buffer and must be at least 'size' bytes.

NB. The remote driver imposes a 64K byte limit on 'size'. For your program to be able to work reliably over a remote connection you should split large requests to <= 65536 bytes. However, with 0.9.13 this RPC limit has been raised to 1M byte. Starting with version 1.0.6 the RPC limit has been raised again. Now large requests up to 16M byte are supported.

dom
  pointer to the domain object
disk
  path to the block device, or device shorthand
offset
  offset within block device
size
  size to read
buffer
  return buffer (must be at least size bytes)
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success or -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | block-read | -

### `virDomainBlockPull`

    int	virDomainBlockPull		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long bandwidth,
    					 unsigned int flags)

Populate a disk image with data from its backing image. Once all data from its backing image has been pulled, the disk no longer depends on a backing image. This function pulls data for the entire device in the background. Progress of the operation can be checked with virDomainGetBlockJobInfo() and the operation can be aborted with virDomainBlockJobAbort(). When finished, an asynchronous event is raised to indicate the final status. To move data in the opposite direction, see virDomainBlockCommit().

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

The maximum bandwidth that will be used to do the copy can be specified with the `bandwidth` parameter. If set to 0, there is no limit. If `flags` includes VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES, `bandwidth` is in bytes/second; otherwise, it is in MiB/second. Values larger than 2^52 bytes/sec may be rejected due to overflow considerations based on the word size of both client and server, and values larger than 2^31 bytes/sec may cause overflow problems if later queried by virDomainGetBlockJobInfo() without scaling. Hypervisors may further restrict the range of valid bandwidth values. Some hypervisors do not support this feature and will return an error if bandwidth is not 0; in this case, it might still be possible for a later call to virDomainBlockJobSetSpeed() to succeed. The actual speed can be determined with virDomainGetBlockJobInfo().

This is shorthand for virDomainBlockRebase() with a NULL base.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
bandwidth
  (optional) specify bandwidth limit; flags determine the unit
flags
  bitwise-OR of virDomainBlockPullFlags
Returns
  0 if the operation has started, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | block-write | -

### `virDomainBlockRebase`

    int	virDomainBlockRebase		(virDomainPtr dom,
    					 const char * disk,
    					 const char * base,
    					 unsigned long bandwidth,
    					 unsigned int flags)

Populate a disk image with data from its backing image chain, and setting the backing image to `base`, or alternatively copy an entire backing chain to a new file `base`.

When `flags` is 0, this starts a pull, where `base` must be the absolute path of one of the backing images further up the chain, or NULL to convert the disk image so that it has no backing image. Once all data from its backing image chain has been pulled, the disk no longer depends on those intermediate backing images. This function pulls data for the entire device in the background. Progress of the operation can be checked with virDomainGetBlockJobInfo() with a job type of VIR_DOMAIN_BLOCK_JOB_TYPE_PULL, and the operation can be aborted with virDomainBlockJobAbort(). When finished, an asynchronous event is raised to indicate the final status, and the job no longer exists. If the job is aborted, a new one can be started later to resume from the same point.

If `flags` contains VIR_DOMAIN_BLOCK_REBASE_RELATIVE, the name recorded into the active disk as the location for `base` will be kept relative. The operation will fail if libvirt can't infer the name.

When `flags` includes VIR_DOMAIN_BLOCK_REBASE_COPY, this starts a copy, where `base` must be the name of a new file to copy the chain to. By default, the copy will pull the entire source chain into the destination file, but if `flags` also contains VIR_DOMAIN_BLOCK_REBASE_SHALLOW, then only the top of the source chain will be copied (the source and destination have a common backing file). By default, `base` will be created with the same file format as the source, but this can be altered by adding VIR_DOMAIN_BLOCK_REBASE_COPY_RAW to force the copy to be raw (does not make sense with the shallow flag unless the source is also raw), or by using VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT to reuse an existing file which was pre-created with the correct format and metadata and sufficient size to hold the copy. In case the VIR_DOMAIN_BLOCK_REBASE_SHALLOW flag is used the pre-created file has to exhibit the same guest visible contents as the backing file of the original image. This allows a management app to pre-create files with relative backing file names, rather than the default of absolute backing file names; as a security precaution, you should generally only use reuse_ext with the shallow flag and a non-raw destination file. By default, the copy destination will be treated as type='file', but using VIR_DOMAIN_BLOCK_REBASE_COPY_DEV treats the destination as type='block' (affecting how virDomainGetBlockInfo() will report allocation after pivoting).

A copy job has two parts; in the first phase, the `bandwidth` parameter affects how fast the source is pulled into the destination, and the job can only be canceled by reverting to the source file; progress in this phase can be tracked via the virDomainBlockJobInfo() command, with a job type of VIR_DOMAIN_BLOCK_JOB_TYPE_COPY. The job transitions to the second phase when the job info states cur == end, and remains alive to mirror all further changes to both source and destination. The user must call virDomainBlockJobAbort() to end the mirroring while choosing whether to revert to source or pivot to the destination. An event is issued when the job ends, and depending on the hypervisor, an event may also be issued when the job transitions from pulling to mirroring. If the job is aborted, a new job will have to start over from the beginning of the first phase.

Some hypervisors will restrict certain actions, such as virDomainSave() or virDomainDetachDevice(), while a copy job is active; they may also restrict a copy job to transient domains.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

The `base` parameter can be either a path to a file within the backing chain, or the device target shorthand (the <target dev='...'/> sub-element, such as "vda") followed by an index to the backing chain enclosed in square brackets. Backing chain indexes can be found by inspecting //disk//backingStore/`//disk//backingStore/index` in the domain XML. Thus, for example, "vda[3]" refers to the backing store with index equal to "3" in the chain of disk "vda".

The maximum bandwidth that will be used to do the copy can be specified with the `bandwidth` parameter. If set to 0, there is no limit. If `flags` includes VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES, `bandwidth` is in bytes/second; otherwise, it is in MiB/second. Values larger than 2^52 bytes/sec may be rejected due to overflow considerations based on the word size of both client and server, and values larger than 2^31 bytes/sec may cause overflow problems if later queried by virDomainGetBlockJobInfo() without scaling. Hypervisors may further restrict the range of valid bandwidth values. Some hypervisors do not support this feature and will return an error if bandwidth is not 0; in this case, it might still be possible for a later call to virDomainBlockJobSetSpeed() to succeed. The actual speed can be determined with virDomainGetBlockJobInfo().

When `base` is NULL and `flags` is 0, this is identical to virDomainBlockPull(). When `flags` contains VIR_DOMAIN_BLOCK_REBASE_COPY, this command is shorthand for virDomainBlockCopy() where the destination XML encodes `base` as a <disk type='file'>, `bandwidth` is properly scaled and passed as a typed parameter, the shallow and reuse external flags are preserved, and remaining flags control whether the XML encodes a destination format of raw instead of leaving the destination identical to the source format or probed from the reused file.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
base
  path to backing file to keep, or device shorthand, or NULL for no backing file
bandwidth
  (optional) specify bandwidth limit; flags determine the unit
flags
  bitwise-OR of virDomainBlockRebaseFlags
Returns
  0 if the operation has started, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | block-write | -

### `virDomainBlockResize`

    int	virDomainBlockResize		(virDomainPtr dom,
    					 const char * disk,
    					 unsigned long long size,
    					 unsigned int flags)

Resize a block device of domain while the domain is running. If `flags` is 0, then `size` is in kibibytes (blocks of 1024 bytes); since 0.9.11, if `flags` includes VIR_DOMAIN_BLOCK_RESIZE_BYTES, `size` is in bytes instead. `size` is taken directly as the new size. Depending on the file format, the hypervisor may round up to the next alignment boundary.

If `flag` contains VIR_DOMAIN_BLOCK_RESIZE_CAPACITY (since 10.0.0) the hypervisor will resize the guest block device to fully fill the source. `size` must be either set to zero, or to the exact size of the block device source. This is possible only for image formats with no metadata ('raw') and for source devices with limited capacity such as block devices.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

Note that this call may fail if the underlying virtualization hypervisor does not support it; this call requires privileged access to the hypervisor.

dom
  pointer to the domain object
disk
  path to the block image, or shorthand
size
  new size of the block image, see below for unit
flags
  bitwise-OR of virDomainBlockResizeFlags
Returns
  0 in case of success or -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | block-write | -

### `virDomainBlockStats`

    int	virDomainBlockStats		(virDomainPtr dom,
    					 const char * disk,
    					 virDomainBlockStatsPtr stats,
    					 size_t size)

This function returns block device (disk) stats for block devices attached to the domain.

The `disk` parameter is either the device target shorthand (the <target dev='...'/> sub-element, such as "vda"), or (since 0.9.8) an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk. Some drivers might also accept the empty string for the `disk` parameter, and then yield summary stats for the entire domain.

Domains may have more than one block device. To get stats for each you should make multiple calls to this function.

Individual fields within the stats structure may be returned as -1, which indicates that the hypervisor does not support that particular statistic.

dom
  pointer to the domain object
disk
  path to the block device, or device shorthand
stats
  block device stats (returned)
size
  size of stats structure
Returns
  0 in case of success or -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainBlockStatsFlags`

    int	virDomainBlockStatsFlags	(virDomainPtr dom,
    					 const char * disk,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)

This function is to get block stats parameters for block devices attached to the domain.

The `disk` parameter is either the device target shorthand (the <target dev='...'/> sub-element, such as "vda"), or (since 0.9.8) an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk. Some drivers might also accept the empty string for the `disk` parameter, and then yield summary stats for the entire domain.

Domains may have more than one block device. To get stats for each you should make multiple calls to this function.

On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value.

As a special case, calling with `params` as NULL and `nparams` as 0 on input will cause `nparams` on output to contain the number of parameters supported by the hypervisor. (Note that block devices of different types might support different parameters, so it might be necessary to compute `nparams` for each block device). The caller should then allocate `params` array, i.e. (sizeof(`sizeofvirTypedParameter` * `nparams`) bytes and call the API again. See virDomainGetMemoryParameters() for more details.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
params
  pointer to block stats parameter object (return value, allocated by the caller)
nparams
  pointer to number of block stats; input and output
flags
  bitwise-OR of virTypedParameterFlags
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainCoreDump`

    int	virDomainCoreDump		(virDomainPtr domain,
    					 const char * to,
    					 unsigned int flags)

This method will dump the core of a domain on a given file for analysis. Note that for remote Xen Daemon the file path will be interpreted in the remote host. Hypervisors may require the user to manually ensure proper permissions on the file named by `to`.

If `flags` includes VIR_DUMP_CRASH, then leave the guest shut off with a crashed state after the dump completes. If `flags` includes VIR_DUMP_LIVE, then make the core dump while continuing to allow the guest to run; otherwise, the guest is suspended during the dump. VIR_DUMP_RESET flag forces reset of the guest after dump. The above three flags are mutually exclusive.

Additionally, if `flags` includes VIR_DUMP_BYPASS_CACHE, then libvirt will attempt to bypass the file system cache while creating the file, or fail if it cannot do so for the given system; this can allow less pressure on file system cache, but also risks slowing saves to NFS.

For more control over the output format, see virDomainCoreDumpWithFormat().

domain
  a domain object
to
  path for the core file
flags
  bitwise-OR of virDomainCoreDumpFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | core-dump | -

### `virDomainCoreDumpWithFormat`

    int	virDomainCoreDumpWithFormat	(virDomainPtr domain,
    					 const char * to,
    					 unsigned int dumpformat,
    					 unsigned int flags)

This method will dump the core of a domain on a given file for analysis. Note that for remote Xen Daemon the file path will be interpreted in the remote host. Hypervisors may require the user to manually ensure proper permissions on the file named by `to`.

`dumpformat` controls which format the dump will have; use of VIR_DOMAIN_CORE_DUMP_FORMAT_RAW mirrors what virDomainCoreDump() will perform. Not all hypervisors are able to support all formats.

If `flags` includes VIR_DUMP_CRASH, then leave the guest shut off with a crashed state after the dump completes. If `flags` includes VIR_DUMP_LIVE, then make the core dump while continuing to allow the guest to run; otherwise, the guest is suspended during the dump. VIR_DUMP_RESET flag forces reset of the guest after dump. The above three flags are mutually exclusive.

Additionally, if `flags` includes VIR_DUMP_BYPASS_CACHE, then libvirt will attempt to bypass the file system cache while creating the file, or fail if it cannot do so for the given system; this can allow less pressure on file system cache, but also risks slowing saves to NFS.

domain
  a domain object
to
  path for the core file
dumpformat
  format of domain memory's dump (one of virDomainCoreDumpFormat enum)
flags
  bitwise-OR of virDomainCoreDumpFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | core-dump | -

### `virDomainCreate`

    int	virDomainCreate			(virDomainPtr domain)

Launch a defined domain. If the call succeeds the domain moves from the defined to the running domains pools. The domain will be paused only if restoring from managed state created from a paused domain. For more control, see virDomainCreateWithFlags().

domain
  pointer to a defined domain
Returns
  0 in case of success, -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | start | -

### `virDomainCreateLinux`

    virDomainPtr	virDomainCreateLinux	(virConnectPtr conn,
    					 const char * xmlDesc,
    					 unsigned int flags)

Deprecated after 0.4.6. Renamed to virDomainCreateXML() providing identical functionality. This existing name will be left indefinitely for API compatibility.

conn
  pointer to the hypervisor connection
xmlDesc
  string containing an XML description of the domain
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  a new domain object or NULL in case of failure

### `virDomainCreateWithFiles`

    int	virDomainCreateWithFiles	(virDomainPtr domain,
    					 unsigned int nfiles,
    					 int * files,
    					 unsigned int flags)

Launch a defined domain. If the call succeeds the domain moves from the defined to the running domains pools.

`files` provides an array of file descriptors which will be made available to the 'init' process of the guest. The file handles exposed to the guest will be renumbered to start from 3 (ie immediately following stderr). This is only supported for guests which use container based virtualization technology.

If the VIR_DOMAIN_START_PAUSED flag is set, or if the guest domain has a managed save image that requested paused state (see virDomainManagedSave()) the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using virDomainResume(). In all other cases, the guest domain will be running.

If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest domain will be automatically destroyed when the virConnectPtr object is finally released. This will also happen if the client application crashes / loses its connection to the libvirtd daemon. Any domains marked for auto destroy will block attempts at migration, save-to-file, or snapshots.

If the VIR_DOMAIN_START_BYPASS_CACHE flag is set, and there is a managed save file for this domain (created by virDomainManagedSave()), then libvirt will attempt to bypass the file system cache while restoring the file, or fail if it cannot do so for the given system; this can allow less pressure on file system cache, but also risks slowing loads from NFS.

If the VIR_DOMAIN_START_FORCE_BOOT flag is set, then any managed save file for this domain is discarded, and the domain boots from scratch.

If `flags` includes VIR_DOMAIN_START_RESET_NVRAM, then libvirt will discard any existing NVRAM file and re-initialize NVRAM from the pristine template.

domain
  pointer to a defined domain
nfiles
  number of file descriptors passed
files
  list of file descriptors passed
flags
  bitwise-OR of supported virDomainCreateFlags
Returns
  0 in case of success, -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | start | -

### `virDomainCreateWithFlags`

    int	virDomainCreateWithFlags	(virDomainPtr domain,
    					 unsigned int flags)

Launch a defined domain. If the call succeeds the domain moves from the defined to the running domains pools.

If the VIR_DOMAIN_START_PAUSED flag is set, or if the guest domain has a managed save image that requested paused state (see virDomainManagedSave()) the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using virDomainResume(). In all other cases, the guest domain will be running.

If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest domain will be automatically destroyed when the virConnectPtr object is finally released. This will also happen if the client application crashes / loses its connection to the libvirtd daemon. Any domains marked for auto destroy will block attempts at migration. Hypervisors may also block save-to-file, or snapshots.

If the VIR_DOMAIN_START_BYPASS_CACHE flag is set, and there is a managed save file for this domain (created by virDomainManagedSave()), then libvirt will attempt to bypass the file system cache while restoring the file, or fail if it cannot do so for the given system; this can allow less pressure on file system cache, but also risks slowing loads from NFS.

If the VIR_DOMAIN_START_FORCE_BOOT flag is set, then any managed save file for this domain is discarded, and the domain boots from scratch.

If `flags` includes VIR_DOMAIN_START_RESET_NVRAM, then libvirt will discard any existing NVRAM file and re-initialize NVRAM from the pristine template.

domain
  pointer to a defined domain
flags
  bitwise-OR of supported virDomainCreateFlags
Returns
  0 in case of success, -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | start | -

### `virDomainCreateXML`

    virDomainPtr	virDomainCreateXML	(virConnectPtr conn,
    					 const char * xmlDesc,
    					 unsigned int flags)

Launch a new guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may require privileged access to the hypervisor. The domain is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted (see virDomainDefineXML() to define persistent domains).

If the VIR_DOMAIN_START_PAUSED flag is set, the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using virDomainResume.

If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest domain will be automatically destroyed when the virConnectPtr object is finally released. This will also happen if the client application crashes / loses its connection to the libvirtd daemon. Any domains marked for auto destroy will block attempts at migration. Hypervisors may also block save-to-file, or snapshots.

If `flags` includes VIR_DOMAIN_START_RESET_NVRAM, then libvirt will discard any existing NVRAM file and re-initialize NVRAM from the pristine template.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
xmlDesc
  string containing an XML description of the domain
flags
  bitwise-OR of supported virDomainCreateFlags
Returns
  a new domain object or NULL in case of failure

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | start | -

### `virDomainCreateXMLWithFiles`

    virDomainPtr	virDomainCreateXMLWithFiles	(virConnectPtr conn,
    						 const char * xmlDesc,
    						 unsigned int nfiles,
    						 int * files,
    						 unsigned int flags)

Launch a new guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may require privileged access to the hypervisor. The domain is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted (see virDomainDefineXML() to define persistent domains).

`files` provides an array of file descriptors which will be made available to the 'init' process of the guest. The file handles exposed to the guest will be renumbered to start from 3 (ie immediately following stderr). This is only supported for guests which use container based virtualization technology.

If the VIR_DOMAIN_START_PAUSED flag is set, the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using virDomainResume.

If the VIR_DOMAIN_START_AUTODESTROY flag is set, the guest domain will be automatically destroyed when the virConnectPtr object is finally released. This will also happen if the client application crashes / loses its connection to the libvirtd daemon. Any domains marked for auto destroy will block attempts at migration. Hypervisors may also block save-to-file, or snapshots.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
xmlDesc
  string containing an XML description of the domain
nfiles
  number of file descriptors passed
files
  list of file descriptors passed
flags
  bitwise-OR of supported virDomainCreateFlags
Returns
  a new domain object or NULL in case of failure

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | start | -

### `virDomainDefineXML`

    virDomainPtr	virDomainDefineXML	(virConnectPtr conn,
    					 const char * xml)

Define a domain, but does not start it. This definition is persistent, until explicitly undefined with virDomainUndefine(). A previous definition for this domain with the same UUID and name would be overridden if it already exists.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
xml
  the XML description for the domain, preferably in UTF-8
Returns
  NULL in case of error, a pointer to the domain otherwise

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | -

### `virDomainDefineXMLFlags`

    virDomainPtr	virDomainDefineXMLFlags	(virConnectPtr conn,
    					 const char * xml,
    					 unsigned int flags)

Defines a domain, but does not start it. This definition is persistent, until explicitly undefined with virDomainUndefine(). A previous definition for this domain with the same UUID and name would be overridden if it already exists.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
xml
  the XML description for the domain, preferably in UTF-8
flags
  bitwise OR of the virDomainDefineFlags constants
Returns
  NULL in case of error, a pointer to the domain otherwise

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | -

### `virDomainDelIOThread`

    int	virDomainDelIOThread		(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 unsigned int flags)

Dynamically delete an IOThread from the domain. The `iothread_id` to be deleted must not have a resource associated with it and can be any of the currently valid IOThread ID's.

Note that this call can fail if the underlying virtualization hypervisor does not support it or if reducing the number is arbitrarily limited. This function requires privileged access to the hypervisor.

`flags` may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG. Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects a running domain and may fail if domain is not alive. If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed.

domain
  a domain object
iothread_id
  the specific IOThread ID value to delete
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainDestroy`

    int	virDomainDestroy		(virDomainPtr domain)

Destroy the domain object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor. This does not free the associated virDomainPtr object. This function may require privileged access.

virDomainDestroy first requests that a guest terminate (e.g. SIGTERM), then waits for it to comply. After a reasonable timeout, if the guest still exists, virDomainDestroy will forcefully terminate the guest (e.g. SIGKILL) if necessary (which may produce undesirable results, for example unflushed disk cache in the guest). To avoid this possibility, it's recommended to instead call virDomainDestroyFlags, sending the VIR_DOMAIN_DESTROY_GRACEFUL flag.

If the domain is transient and has any snapshot metadata (see virDomainSnapshotNum()), then that metadata will automatically be deleted when the domain quits.

domain
  a domain object
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | stop | -

### `virDomainDestroyFlags`

    int	virDomainDestroyFlags		(virDomainPtr domain,
    					 unsigned int flags)

Destroy the domain object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor. This does not free the associated virDomainPtr object. This function may require privileged access.

Calling this function with no `flags` set (equal to zero) is equivalent to calling virDomainDestroy, and after a reasonable timeout will forcefully terminate the guest (e.g. SIGKILL) if necessary (which may produce undesirable results, for example unflushed disk cache in the guest). Including VIR_DOMAIN_DESTROY_GRACEFUL in the flags will prevent the forceful termination of the guest, and virDomainDestroyFlags will instead return an error if the guest doesn't terminate by the end of the timeout; at that time, the management application can decide if calling again without VIR_DOMAIN_DESTROY_GRACEFUL is appropriate.

If VIR_DOMAIN_DESTROY_REMOVE_LOGS flag is set then domain specific logs will be deleted as well if there are any. Note that not all deployments are be supported. For example in case of QEMU driver this flags is noop if virtlogd is not used for handling QEMU process output.

Another alternative which may produce cleaner results for the guest's disks is to use virDomainShutdown() instead, but that depends on guest support (some hypervisor/guest combinations may ignore the shutdown request).

domain
  a domain object
flags
  bitwise-OR of virDomainDestroyFlagsValues
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | stop | -

### `virDomainDetachDevice`

    int	virDomainDetachDevice		(virDomainPtr domain,
    					 const char * xml)

This is an equivalent of virDomainDetachDeviceFlags() when called with `flags` parameter set to VIR_DOMAIN_AFFECT_LIVE.

See virDomainDetachDeviceFlags() for more details.

domain
  pointer to domain object
xml
  pointer to XML description of one device
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainDetachDeviceAlias`

    int	virDomainDetachDeviceAlias	(virDomainPtr domain,
    					 const char * alias,
    					 unsigned int flags)

Detach a virtual device from a domain, using the alias to specify the device. The value of `flags` should be either VIR_DOMAIN_AFFECT_CURRENT, or a bitwise-or of values from VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CURRENT, although hypervisors vary in which flags are supported.

In contrast to virDomainDetachDeviceFlags() this API is asynchronous - it returns immediately after sending the detach request to the hypervisor. It's caller's responsibility to wait for VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event to signal actual device removal or for VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED to signal rejected device removal.

domain
  pointer to a domain object
alias
  device alias
flags
  bitwise-OR of virDomainDeviceModifyFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainDetachDeviceFlags`

    int	virDomainDetachDeviceFlags	(virDomainPtr domain,
    					 const char * xml,
    					 unsigned int flags)

Detach a virtual device from a domain, using the flags parameter to control how the device is detached. VIR_DOMAIN_AFFECT_CURRENT specifies that the device allocation is removed based on current domain state. VIR_DOMAIN_AFFECT_LIVE specifies that the device shall be deallocated from the active domain instance only and is not from the persisted domain configuration. VIR_DOMAIN_AFFECT_CONFIG specifies that the device shall be deallocated from the persisted domain configuration only. Note that the target hypervisor must return an error if unable to satisfy flags. E.g. the hypervisor driver will return failure if LIVE is specified but it only supports removing the persisted device allocation.

Some hypervisors may prevent this operation if there is a current block job running operation on the device being detached; in that case, use virDomainBlockJobAbort() to stop the block job first.

Beware that depending on the hypervisor and device type, detaching a device from a running domain may be asynchronous. That is, calling virDomainDetachDeviceFlags may just request device removal while the device is actually removed later (in cooperation with a guest OS). Previously, this fact was ignored and the device could have been removed from domain configuration before it was actually removed by the hypervisor causing various failures on subsequent operations. To check whether the device was successfully removed, either recheck domain configuration using virDomainGetXMLDesc() or add a handler for the VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED event. In case the device is already gone when virDomainDetachDeviceFlags returns, the event is delivered before this API call ends. To help existing clients work better in most cases, this API will try to transform an asynchronous device removal that finishes shortly after the request into a synchronous removal. In other words, this API may wait a bit for the removal to complete in case it was not synchronous.

Be aware that hotplug changes might not persist across a domain going into S4 state (also known as hibernation) unless you also modify the persistent domain definition.

The supplied XML description of the device should be as specific as its definition in the domain XML. The set of attributes used to match the device are internal to the drivers. Using a partial definition, or attempting to detach a device that is not present in the domain XML, but shares some specific attributes with one that is present, may lead to unexpected results.

domain
  pointer to domain object
xml
  pointer to XML description of one device
flags
  bitwise-OR of virDomainDeviceModifyFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainFDAssociate`

    int	virDomainFDAssociate		(virDomainPtr domain,
    					 const char * name,
    					 unsigned int nfds,
    					 int * fds,
    					 unsigned int flags)

Associate the FDs in `fd` with `domain` under `name`. The FDs are associated as long as the connection used to associated exists and are disposed of afterwards. FD may still be kept open by the hypervisor for as long as it's needed.

Security labelling (e.g. via the selinux) may be applied on the passed FDs when required for usage by the VM. By default libvirt does not restore the seclabels on the FDs afterwards to avoid keeping it open unnecessarily.

Restoring of the security label can be requested by passing either VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_RESTORE for a best-effort attempt to restore the security label after use. Requesting the restore of security label will require that the file descriptors are kept open for the whole time they are used by the hypervisor, or other additional overhead.

In certain cases usage of the fd group would imply read-only access. Passing VIR_DOMAIN_FD_ASSOCIATE_SECLABEL_WRITABLE in `flags` ensures that a writable security label is picked in case when the file represented by the fds may be used in write mode.

domain
  a domain object
name
  name for the file descriptor group
nfds
  number of fds in `fds`
fds
  file descriptors to associate with domain
flags
  optional flags; bitwise-OR of supported virDomainFDAssociateFlags
Returns
  0 on success, -1 on error.

### `virDomainFSFreeze`

    int	virDomainFSFreeze		(virDomainPtr dom,
    					 const char ** mountpoints,
    					 unsigned int nmountpoints,
    					 unsigned int flags)

Freeze specified filesystems within the guest (hence guest agent may be required depending on hypervisor used). If `mountpoints` is NULL and `nmountpoints` is 0, every mounted filesystem on the guest is frozen. In some environments (e.g. QEMU guest with guest agent which doesn't support mountpoints argument), `mountpoints` may need to be NULL.

dom
  a domain object
mountpoints
  list of mount points to be frozen
nmountpoints
  the number of mount points specified in `mountpoints`
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  the number of frozen filesystems on success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | fs-freeze | -

### `virDomainFSInfoFree`

    void	virDomainFSInfoFree		(virDomainFSInfoPtr info)

Frees all the memory occupied by `info`.

info
  pointer to a FSInfo object

### `virDomainFSThaw`

    int	virDomainFSThaw			(virDomainPtr dom,
    					 const char ** mountpoints,
    					 unsigned int nmountpoints,
    					 unsigned int flags)

Thaw specified filesystems within the guest. If `mountpoints` is NULL and `nmountpoints` is 0, every mounted filesystem on the guest is thawed. In some drivers (e.g. QEMU driver), `mountpoints` may need to be NULL.

dom
  a domain object
mountpoints
  list of mount points to be thawed
nmountpoints
  the number of mount points specified in `mountpoints`
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  the number of thawed filesystems on success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | fs-freeze | -

### `virDomainFSTrim`

    int	virDomainFSTrim			(virDomainPtr dom,
    					 const char * mountPoint,
    					 unsigned long long minimum,
    					 unsigned int flags)

Calls FITRIM within the guest (hence guest agent may be required depending on hypervisor used). Either call it on each mounted filesystem (`mountPoint` is NULL) or just on specified `mountPoint`. `minimum` hints that free ranges smaller than this may be ignored (this is a hint and the guest may not respect it). By increasing this value, the fstrim operation will complete more quickly for filesystems with badly fragmented free space, although not all blocks will be discarded. If `minimum` is not zero, the command may fail.

dom
  a domain object
mountPoint
  which mount point to trim
minimum
  Minimum contiguous free range to discard in bytes
flags
  extra flags, not used yet, so callers should always pass 0
Returns
  0 on success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | fs-trim | -

### `virDomainFree`

    int	virDomainFree			(virDomainPtr domain)

Free the domain object. The running instance is kept alive. The data structure is freed and should not be used thereafter.

domain
  a domain object
Returns
  0 in case of success and -1 in case of failure.

### `virDomainGetAutostart`

    int	virDomainGetAutostart		(virDomainPtr domain,
    					 int * autostart)

Provides a boolean value indicating whether the domain configured to be automatically started when the host machine boots.

domain
  a domain object
autostart
  the value returned
Returns
  -1 in case of error, 0 in case of success

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetBlkioParameters`

    int	virDomainGetBlkioParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)

Get all blkio parameters. On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value.

As a special case, calling with `params` as NULL and `nparams` as 0 on input will cause `nparams` on output to contain the number of parameters supported by the hypervisor. The caller should then allocate `params` array, i.e. (sizeof(`sizeofvirTypedParameter` * `nparams`) bytes and call the API again.

See virDomainGetMemoryParameters() for an equivalent usage example.

This function may require privileged access to the hypervisor. This function expects the caller to allocate the `params`.

domain
  pointer to domain object
params
  pointer to blkio parameter object (return value, allocated by the caller)
nparams
  pointer to number of blkio parameters; input and output
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetBlockInfo`

    int	virDomainGetBlockInfo		(virDomainPtr domain,
    					 const char * disk,
    					 virDomainBlockInfoPtr info,
    					 unsigned int flags)

Extract information about a domain's block device.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

For QEMU domains, the allocation and physical virDomainBlockInfo values returned will generally be the same, except when using a non raw, block backing device, such as qcow2 for an active domain. When the persistent domain is not active, QEMU will return the default which is the same value for allocation and physical.

Active QEMU domains can return an allocation value which is more representative of the currently used blocks by the device compared to the physical size of the device. Applications can use/monitor the allocation value with the understanding that if the domain becomes inactive during an attempt to get the value, the default values will be returned. Thus, the application should check after the call for the domain being inactive if the values are the same. Optionally, the application could be watching for a shutdown event and then ignore any values received afterwards. This can be an issue when a domain is being migrated and the exact timing of the domain being made inactive and check of the allocation value results the default being returned. For a transient domain in the similar situation, this call will return -1 and an error message indicating the "domain is not running".

The following is some pseudo code illustrating the call sequence:

    ...
    virDomainPtr dom;
    virDomainBlockInfo info;
    char *device;
    ...
    // Either get a list of all domains or a specific domain
    // via a virDomainLookupBy*() call.
    //
    // It's also required to fill in the device pointer, but that's
    // specific to the implementation. For the purposes of this example
    // a qcow2 backed device name string would need to be provided.
    ...
    // If the following call is made on a persistent domain with a
    // qcow2 block backed block device, then it's possible the returned
    // allocation equals the physical value. In that case, the domain
    // that may have been active prior to calling has become inactive,
    // such as is the case during a domain migration. Thus once we
    // get data returned, check for active domain when the values are
    // the same.
    if (virDomainGetBlockInfo(dom, device, &info, 0) < 0)
        goto failure;
    if (info.allocation == info.physical) {
        // If the domain is no longer active,
        // then the defaults are being returned.
        if (!virDomainIsActive())
                goto ignore_return;
    }
    // Do something with the allocation and physical values
    ...

domain
  a domain object
disk
  path to the block device, or device shorthand
info
  pointer to a virDomainBlockInfo structure allocated by the user
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetBlockIoTune`

    int	virDomainGetBlockIoTune		(virDomainPtr dom,
    					 const char * disk,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)

Get all block IO tunable parameters for a given device. On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value.

As a special case, calling with `params` as NULL and `nparams` as 0 on input will cause `nparams` on output to contain the number of parameters supported by the hypervisor, either for the given `disk` (note that block devices of different types might support different parameters), or if `disk` is NULL, for all possible disks. The caller should then allocate `params` array, i.e. (sizeof(`sizeofvirTypedParameter` * `nparams`) bytes and call the API again. See virDomainGetMemoryParameters() for more details.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or the device target shorthand (the <target dev='...'/> sub-element, such as "xvda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk. This parameter cannot be NULL unless `nparams` is 0 on input.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
params
  Pointer to blkio parameter object (return value, allocated by the caller)
nparams
  Pointer to number of blkio parameters
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetBlockJobInfo`

    int	virDomainGetBlockJobInfo	(virDomainPtr dom,
    					 const char * disk,
    					 virDomainBlockJobInfoPtr info,
    					 unsigned int flags)

Request block job information for the given disk. If an operation is active `info` will be updated with the current progress. The units used for the bandwidth field of `info` depends on `flags`. If `flags` includes VIR_DOMAIN_BLOCK_JOB_INFO_BANDWIDTH_BYTES, bandwidth is in bytes/second (although this mode can risk failure due to overflow, depending on both client and server word size); otherwise, the value is rounded up to MiB/s.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the <target dev='...'/> sub-element, such as "vda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

In cases when libvirt can't determine actual progress of the block job from the underlying hypervisor due to corner cases such as the job wasn't yet fully initialized, or finalized and thus the progress can't be queried, libvirt reports 'cur = 0, end = 1'.

For jobs requiring finalizing via qemuDomainBlockJobAbort() with VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT flag which reached synchronised phase, but were empty, or the progress can't be determined libvirt returns 'cur = 1, end = 1'.

Users thus should not consider any data where 'end = 1' as absolute progress value.

Applications looking for a reliable and low-overhead way to determine whether a block job already finished or reached synchronised phase should register a handler for the VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2 event instead of polling this API.

Note that the progress reported for blockjobs corresponding to a pull-mode backup don't report progress of the backup but rather usage of temporary space required for the backup.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
info
  pointer to a virDomainBlockJobInfo structure
flags
  bitwise-OR of virDomainBlockJobInfoFlags
Returns
  -1 in case of failure, 0 when nothing found, 1 when info was found.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetCPUStats`

    int	virDomainGetCPUStats		(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 unsigned int nparams,
    					 int start_cpu,
    					 unsigned int ncpus,
    					 unsigned int flags)

Get statistics relating to CPU usage attributable to a single domain (in contrast to the statistics returned by virNodeGetCPUStats() for all processes on the host). `dom` must be running (an inactive domain has no attributable cpu usage). On input, `params` must contain at least `nparams` * `ncpus` entries, allocated by the caller.

If `start_cpu` is -1, then `ncpus` must be 1, and the returned results reflect the statistics attributable to the entire domain (such as user and system time for the process as a whole). Otherwise, `start_cpu` represents which cpu to start with, and `ncpus` represents how many consecutive processors to query, with statistics attributable per processor (such as per-cpu usage). If `ncpus` is larger than the number of cpus available to query, then the trailing part of the array will be unpopulated.

The remote driver imposes a limit of 128 `ncpus` and 16 `nparams`; the number of parameters per cpu should not exceed 16, but if you have a host with more than 128 CPUs, your program should split the request into multiple calls.

As special cases, if `params` is NULL and `nparams` is 0 and `ncpus` is 1, and the return value will be how many statistics are available for the given `start_cpu`. This number may be different for `start_cpu` of -1 than for any non-negative value, but will be the same for all non-negative `start_cpu`. Likewise, if `params` is NULL and `nparams` is 0 and `ncpus` is 0, the number of cpus available to query is returned. From the host perspective, this would typically match the cpus member of virNodeGetInfo(), but might be less due to host cpu hotplug.

For now, `flags` is unused, and the statistics all relate to the usage from the host perspective. It is possible that a future version will support a flag that queries the cpu usage from the guest's perspective, where the maximum cpu to query would be related to virDomainGetVcpusFlags() rather than virNodeGetInfo(). An individual guest vcpu cannot be reliably mapped back to a specific host cpu unless a single-processor vcpu pinning was used, but when `start_cpu` is -1, any difference in usage between a host and guest perspective would serve as a measure of hypervisor overhead.

Typical use sequence is below.

getting total stats: set start_cpu as -1, ncpus 1

    virDomainGetCPUStats(dom, NULL, 0, -1, 1, 0); // nparams
    params = calloc(nparams, sizeof(virTypedParameter))
    virDomainGetCPUStats(dom, params, nparams, -1, 1, 0); // total stats.

getting per-cpu stats:

    virDomainGetCPUStats(dom, NULL, 0, 0, 0, 0); // ncpus
    virDomainGetCPUStats(dom, NULL, 0, 0, 1, 0); // nparams
    params = calloc(ncpus * nparams, sizeof(virTypedParameter));
    virDomainGetCPUStats(dom, params, nparams, 0, ncpus, 0); // per-cpu stats

domain
  domain to query
params
  array to populate on output
nparams
  number of parameters per cpu
start_cpu
  which cpu to start with, or -1 for summary
ncpus
  how many cpus to query
flags
  bitwise-OR of virTypedParameterFlags
Returns
  -1 on failure, or the number of statistics that were populated per cpu on success (this will be less than the total number of populated `params`, unless `ncpus` was 1; and may be less than `nparams`). The populated parameters start at each stride of `nparams`, which means the results may be discontiguous; any unpopulated parameters will be zeroed on success (this includes skipped elements if `nparams` is too large, and tail elements if `ncpus` is too large). The caller is responsible for freeing any returned string parameters.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetConnect`

    virConnectPtr	virDomainGetConnect	(virDomainPtr dom)

Provides the connection pointer associated with a domain. The reference counter on the connection is not increased by this call.

dom
  pointer to a domain
Returns
  the virConnectPtr or NULL in case of failure.

### `virDomainGetControlInfo`

    int	virDomainGetControlInfo		(virDomainPtr domain,
    					 virDomainControlInfoPtr info,
    					 unsigned int flags)

Extract details about current state of control interface to a domain.

domain
  a domain object
info
  pointer to a virDomainControlInfo structure allocated by the user
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetDiskErrors`

    int	virDomainGetDiskErrors		(virDomainPtr dom,
    					 virDomainDiskErrorPtr errors,
    					 unsigned int maxerrors,
    					 unsigned int flags)

The function populates `errors` array with all disks that encountered an I/O error. Disks with no error will not be returned in the `errors` array. Each disk is identified by its target (the dev attribute of target subelement in domain XML), such as "vda", and accompanied with the error that was seen on it. The caller is also responsible for calling free() on each disk name returned.

In a special case when `errors` is NULL and `maxerrors` is 0, the function returns preferred size of `errors` that the caller should use to get all disk errors.

Since calling virDomainGetDiskErrors(dom, NULL, 0, 0) to get preferred size of `errors` array and getting the errors are two separate operations, new disks may be hotplugged to the domain and new errors may be encountered between the two calls. Thus, this function may not return all disk errors because the supplied array is not large enough. Such errors may, however, be detected by listening to domain events.

dom
  a domain object
errors
  array to populate on output
maxerrors
  size of `errors` array
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  number of disks with errors filled in the `errors` array or -1 on error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetEmulatorPinInfo`

    int	virDomainGetEmulatorPinInfo	(virDomainPtr domain,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)

Query the CPU affinity setting of all emulator threads of domain, store it in cpumap.

domain
  pointer to domain object, or NULL for Domain0
cpumap
  pointer to a bit map of real CPUs for all emulator threads of this domain (in 8-bit bytes) (OUT) There is only one cpumap for all emulator threads. Must not be NULL.
maplen
  the number of bytes in one cpumap, from 1 up to size of CPU map. Must be positive.
flags
  bitwise-OR of virDomainModificationImpact Must not be VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CONFIG concurrently.
Returns
  1 in case of success, 0 in case of no emulator threads are pined to pcpus, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetFSInfo`

    int	virDomainGetFSInfo		(virDomainPtr dom,
    					 virDomainFSInfoPtr ** info,
    					 unsigned int flags)

Get a list of mapping information for each mounted file systems within the specified guest and the disks.

dom
  a domain object
info
  a pointer to a variable to store an array of mount points information
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  the number of returned mount points, or -1 in case of error. On success, the array of the information is stored into `info`. The caller is responsible for calling virDomainFSInfoFree() on each array element, then calling free() on `info`. On error, `info` is set to NULL.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | fs-freeze | -

### `virDomainGetGuestInfo`

    int	virDomainGetGuestInfo		(virDomainPtr domain,
    					 unsigned int types,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)

Queries the guest agent for the various information about the guest system. The reported data depends on the guest agent implementation. The information is returned as an array of typed parameters containing the individual parameters. The parameter name for each information field consists of a dot-separated string containing the name of the requested group followed by a group-specific description of the statistic value.

The information groups are enabled using the `types` parameter which is a binary-OR of enum virDomainGuestInfoTypes. The following groups are available (although not necessarily implemented for each hypervisor):

VIR_DOMAIN_GUEST_INFO_USERS: returns information about users that are currently logged in within the guest domain. The typed parameter keys are in this format:

       "user.count" - the number of active users on this domain as an
                      unsigned int
       "user.<num>.name" - username of the user as a string
       "user.<num>.domain" - domain of the user as a string (may only be
                             present on certain guest types)
       "user.<num>.login-time" - the login time of a user in milliseconds
                                 since the epoch as unsigned long long

VIR_DOMAIN_GUEST_INFO_OS: Return information about the operating system running within the guest. The typed parameter keys are in this format:

       "os.id" - a string identifying the operating system
       "os.name" - the name of the operating system, suitable for presentation
                   to a user, as a string
       "os.pretty-name" - a pretty name for the operating system, suitable for
                          presentation to a user, as a string
       "os.version" - the version of the operating system suitable for
                      presentation to a user, as a string
       "os.version-id" - the version id of the operating system suitable for
                         processing by scripts, as a string
       "os.kernel-release" - the release of the operating system kernel, as a
                             string
       "os.kernel-version" - the version of the operating system kernel, as a
                             string
       "os.machine" - the machine hardware name as a string
       "os.variant" - a specific variant or edition of the operating system
                      suitable for presentation to a user, as a string
       "os.variant-id" - the id for a specific variant or edition of the
                         operating system, as a string

VIR_DOMAIN_GUEST_INFO_TIMEZONE: Returns information about the timezone within the domain. The typed parameter keys are in this format:

       "timezone.name" - the name of the timezone as a string
       "timezone.offset" - the offset to UTC in seconds as an int

VIR_DOMAIN_GUEST_INFO_FILESYSTEM: Returns information about the filesystems within the domain. The typed parameter keys are in this format:

       "fs.count" - the number of filesystems defined on this domain
                    as an unsigned int
       "fs.<num>.mountpoint" - the path to the mount point for the filesystem
       "fs.<num>.name" - device name in the guest (e.g. "sda1")
       "fs.<num>.fstype" - the type of filesystem
       "fs.<num>.total-bytes" - the total size of the filesystem
       "fs.<num>.used-bytes" - the number of bytes used in the filesystem
       "fs.<num>.disk.count" - the number of disks targeted by this filesystem
       "fs.<num>.disk.<num>.alias" - the device alias of the disk (e.g. sda)
       "fs.<num>.disk.<num>.serial" - the serial number of the disk
       "fs.<num>.disk.<num>.device" - the device node of the disk

VIR_DOMAIN_GUEST_INFO_DISKS: Returns information about the disks within the domain. The typed parameter keys are in this format:

       "disk.count" - the number of disks defined on this domain
                       as an unsigned int
       "disk.<num>.name" - device node (Linux) or device UNC (Windows)
       "disk.<num>.partition" - whether this is a partition or disk
       "disk.<num>.dependency.count" - the number of device dependencies
                       e.g. for LVs of the LVM this will
                       hold the list of PVs, for LUKS encrypted volume this will
                       contain the disk where the volume is placed. (Linux)
       "disk.<num>.dependency.<num>.name" - a dependency
       "disk.<num>.serial" - optional disk serial number (as string)
       "disk.<num>.alias" - the device alias of the disk (e.g. sda)
       "disk.<num>.guest_alias" - optional alias assigned to the disk, on Linux
                       this is a name assigned by device mapper

VIR_DOMAIN_GUEST_INFO_HOSTNAME: Returns information about the hostname of the domain. The typed parameter keys are in this format:

       "hostname" - the hostname of the domain

VIR_DOMAIN_GUEST_INFO_INTERFACES: Returns information about the interfaces within the domain. The typed parameter keys are in this format:

       "if.count" - the number of interfaces defined on this domain
       "if.<num>.name" - name in the guest (e.g. ``eth0``) for interface <num>
       "if.<num>.hwaddr" - hardware address in the guest for interface <num>
       "if.<num>.addr.count - the number of IP addresses of interface <num>
       "if.<num>.addr.<num1>.type" - the IP address type of addr <num1> (e.g. ipv4)
       "if.<num>.addr.<num1>.addr" - the IP address of addr <num1>
       "if.<num>.addr.<num1>.prefix" - the prefix of IP address of addr <num1>

Using 0 for `types` returns all information groups supported by the given hypervisor.

This API requires the VM to run. The caller is responsible for calling virTypedParamsFree to free memory returned in `params`.

domain
  pointer to domain object
types
  types of information to return, binary-OR of virDomainGuestInfoTypes
params
  location to store the guest info parameters
nparams
  number of items in `params`
flags
  currently unused, set to 0
Returns
  0 on success, -1 on error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainGetGuestVcpus`

    int	virDomainGetGuestVcpus		(virDomainPtr domain,
    					 virTypedParameterPtr * params,
    					 unsigned int * nparams,
    					 unsigned int flags)

Queries the guest agent for state and information regarding vCPUs from guest's perspective. The reported data depends on the guest agent implementation.

Reported fields stored in `params`: 'vcpus': string containing bitmap representing vCPU ids as reported by the guest 'online': string containing bitmap representing online vCPUs as reported by the guest agent. 'offlinable': string containing bitmap representing ids of vCPUs that can be offlined

This API requires the VM to run. The caller is responsible for calling virTypedParamsFree to free memory returned in `params`.

domain
  pointer to domain object
params
  pointer that will be filled with an array of typed parameters
nparams
  pointer filled with number of elements in `params`
flags
  currently unused, callers shall pass 0
Returns
  0 on success, -1 on error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainGetHostname`

    char *	virDomainGetHostname		(virDomainPtr domain,
    					 unsigned int flags)

Get the hostname for that domain. If no hostname is found, then an error is raised with VIR_ERR_NO_HOSTNAME code.

Dependent on hypervisor and `flags` used, this may require a guest agent to be available.

domain
  a domain object
flags
  bitwise-OR of virDomainGetHostnameFlags
Returns
  the hostname which must be freed by the caller, or NULL if there was an error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainGetID`

    unsigned int	virDomainGetID		(virDomainPtr domain)

Get the hypervisor ID number for the domain

domain
  a domain object
Returns
  the domain ID number or (unsigned int) -1 in case of error

### `virDomainGetIOThreadInfo`

    int	virDomainGetIOThreadInfo	(virDomainPtr dom,
    					 virDomainIOThreadInfoPtr ** info,
    					 unsigned int flags)

Fetch IOThreads of an active domain including the cpumap information to determine on which CPU the IOThread has affinity to run.

dom
  a domain object
info
  pointer to an array of virDomainIOThreadInfo structures (OUT)
flags
  bitwise-OR of virDomainModificationImpact Must not be VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CONFIG concurrently.
Returns
  the number of IOThreads or -1 in case of error. On success, the array of information is stored into `info`. The caller is responsible for calling virDomainIOThreadInfoFree() on each array element, then calling free() on `info`. On error, `info` is set to NULL.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetInfo`

    int	virDomainGetInfo		(virDomainPtr domain,
    					 virDomainInfoPtr info)

Extract information about a domain. Note that if the connection used to get the domain is limited only a partial set of the information can be extracted.

domain
  a domain object
info
  pointer to a virDomainInfo structure allocated by the user
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetInterfaceParameters`

    int	virDomainGetInterfaceParameters	(virDomainPtr domain,
    					 const char * device,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)

Get all interface parameters. On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value.

As a special case, calling with `params` as NULL and `nparams` as 0 on input will cause `nparams` on output to contain the number of parameters supported by the hypervisor. The caller should then allocate `params` array, i.e. (sizeof(`sizeofvirTypedParameter` * `nparams`) bytes and call the API again. See virDomainGetMemoryParameters() for an equivalent usage example.

This function may require privileged access to the hypervisor. This function expects the caller to allocate the `params`.

domain
  pointer to domain object
device
  the interface name or mac address
params
  pointer to interface parameter objects (return value, allocated by the caller)
nparams
  pointer to number of interface parameter; input and output
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetJobInfo`

    int	virDomainGetJobInfo		(virDomainPtr domain,
    					 virDomainJobInfoPtr info)

Extract information about progress of a background job on a domain. Will return an error if the domain is not active.

This function returns a limited amount of information in comparison to virDomainGetJobStats().

domain
  a domain object
info
  pointer to a virDomainJobInfo structure allocated by the user
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetJobStats`

    int	virDomainGetJobStats		(virDomainPtr domain,
    					 int * type,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)

Extract information about progress of a background job on a domain. Will return an error if the domain is not active. The function returns a superset of progress information provided by virDomainGetJobInfo. Possible fields returned in `params` are defined by VIR_DOMAIN_JOB_* macros and new fields will likely be introduced in the future so callers may receive fields that they do not understand in case they talk to a newer server.

When `flags` contains VIR_DOMAIN_JOB_STATS_COMPLETED, the function will return statistics about a recently completed job. Specifically, this flag may be used to query statistics of a completed incoming pre-copy migration (statistics for post-copy migration are only available on the source host). Statistics of a completed job are automatically destroyed once read (unless the VIR_DOMAIN_JOB_STATS_COMPLETED_KEEP is used as well) or when libvirtd is restarted. Note that time information returned for completed migrations may be completely irrelevant unless both source and destination hosts have synchronized time (i.e., NTP daemon is running on both of them). The statistics of a completed job can also be obtained by listening to a VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event (on the source host in case of a migration job).

domain
  a domain object
type
  where to store the job type (one of virDomainJobType)
params
  where to store job statistics
nparams
  number of items in `params`
flags
  bitwise-OR of virDomainGetJobStatsFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetLaunchSecurityInfo`

    int	virDomainGetLaunchSecurityInfo	(virDomainPtr domain,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)

Get the launch security info. In case of the SEV guest, this will return the launch measurement.

domain
  a domain object
params
  where to store security info
nparams
  number of items in `params`
flags
  currently used, set to 0.
Returns
  -1 in case of failure, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetMaxMemory`

    unsigned long	virDomainGetMaxMemory	(virDomainPtr domain)

Retrieve the maximum amount of physical memory allocated to a domain. If domain is NULL, then this get the amount of memory reserved to Domain0 i.e. the domain where the application runs.

domain
  a domain object or NULL
Returns
  the memory size in kibibytes (blocks of 1024 bytes), or 0 in case of error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetMaxVcpus`

    int	virDomainGetMaxVcpus		(virDomainPtr domain)

Provides the maximum number of virtual CPUs supported for the guest VM. If the guest is inactive, this is basically the same as virConnectGetMaxVcpus(). If the guest is running this will reflect the maximum number of virtual CPUs the guest was booted with. For more details, see virDomainGetVcpusFlags().

domain
  pointer to domain object
Returns
  the maximum of virtual CPU or -1 in case of error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetMemoryParameters`

    int	virDomainGetMemoryParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)

Get all memory parameters. On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value.

As a special case, calling with `params` as NULL and `nparams` as 0 on input will cause `nparams` on output to contain the number of parameters supported by the hypervisor. The caller should then allocate `params` array, i.e. (sizeof(`sizeofvirTypedParameter` * `nparams`) bytes and call the API again.

Here is a sample code snippet:

    if (virDomainGetMemoryParameters(dom, NULL, &nparams, 0) == 0 &&
        nparams != 0) {
        if ((params = malloc(sizeof(*params) * nparams)) == NULL)
            goto error;
        memset(params, 0, sizeof(*params) * nparams);
        if (virDomainGetMemoryParameters(dom, params, &nparams, 0))
            goto error;
    }

This function may require privileged access to the hypervisor. This function expects the caller to allocate the `params`.

domain
  pointer to domain object
params
  pointer to memory parameter object (return value, allocated by the caller)
nparams
  pointer to number of memory parameters; input and output
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetMessages`

    int	virDomainGetMessages		(virDomainPtr domain,
    					 char *** msgs,
    					 unsigned int flags)

Fetch a list of all messages recorded against the VM and store them into `msgs` array which is allocated upon successful return and is NULL terminated. The caller is responsible for freeing `msgs` when no longer needed.

If `flags` is zero then all messages are reported. The virDomainMessageType constants can be used to restrict results to certain types of message.

Note it is hypervisor dependent whether messages are available for shutoff guests, or running guests, or both. Thus a client should be prepared to re-fetch messages when a guest transitions between running and shutoff states.

domain
  a domain object
msgs
  pointer to a variable to store messages
flags
  zero or more virDomainMessageType flags
Returns
  number of messages stored in `msgs`, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetMetadata`

    char *	virDomainGetMetadata		(virDomainPtr domain,
    					 int type,
    					 const char * uri,
    					 unsigned int flags)

Retrieves the appropriate domain element given by `type`. If VIR_DOMAIN_METADATA_ELEMENT is requested parameter `uri` must be set to the name of the namespace the requested elements belong to, otherwise must be NULL.

If an element of the domain XML is not present, the resulting error will be VIR_ERR_NO_DOMAIN_METADATA. This method forms a shortcut for seeing information from virDomainSetMetadata() without having to go through virDomainGetXMLDesc().

`flags` controls whether the live domain or persistent configuration will be queried.

domain
  a domain object
type
  type of metadata, from virDomainMetadataType
uri
  XML namespace identifier
flags
  bitwise-OR of virDomainModificationImpact
Returns
  the metadata string on success (caller must free), or NULL in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetName`

    const char *	virDomainGetName	(virDomainPtr domain)

Get the public name for that domain

domain
  a domain object
Returns
  a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the domain object.

### `virDomainGetNumaParameters`

    int	virDomainGetNumaParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams,
    					 unsigned int flags)

Get all numa parameters. On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value.

As a special case, calling with `params` as NULL and `nparams` as 0 on input will cause `nparams` on output to contain the number of parameters supported by the hypervisor. The caller should then allocate `params` array, i.e. (sizeof(`sizeofvirTypedParameter` * `nparams`) bytes and call the API again.

See virDomainGetMemoryParameters() for an equivalent usage example.

This function may require privileged access to the hypervisor. This function expects the caller to allocate the `params`.

domain
  pointer to domain object
params
  pointer to numa parameter object (return value, allocated by the caller)
nparams
  pointer to number of numa parameters
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetOSType`

    char *	virDomainGetOSType		(virDomainPtr domain)

Get the type of domain operation system.

domain
  a domain object
Returns
  the new string or NULL in case of error, the string must be freed by the caller.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetPerfEvents`

    int	virDomainGetPerfEvents		(virDomainPtr domain,
    					 virTypedParameterPtr * params,
    					 int * nparams,
    					 unsigned int flags)

Get all Linux perf events setting. Possible fields returned in `params` are defined by VIR_PERF_EVENT_* macros and new fields will likely be introduced in the future.

Linux perf events are performance analyzing tool in Linux.

domain
  a domain object
params
  where to store perf events setting
nparams
  number of items in `params`
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  -1 in case of failure, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetSchedulerParameters`

    int	virDomainGetSchedulerParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int * nparams)

Get all scheduler parameters. On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value. `nparams` cannot be 0.

It is hypervisor specific whether this returns the live or persistent state; for more control, use virDomainGetSchedulerParametersFlags().

domain
  pointer to domain object
params
  pointer to scheduler parameter objects (return value)
nparams
  pointer to number of scheduler parameter objects (this value should generally be as large as the returned value nparams of virDomainGetSchedulerType()); input and output
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetSchedulerParametersFlags`

    int	virDomainGetSchedulerParametersFlags	(virDomainPtr domain,
    						 virTypedParameterPtr params,
    						 int * nparams,
    						 unsigned int flags)

Get all scheduler parameters. On input, `nparams` gives the size of the `params` array; on output, `nparams` gives how many slots were filled with parameter information, which might be less but will not exceed the input value. `nparams` cannot be 0.

The value of `flags` can be exactly VIR_DOMAIN_AFFECT_CURRENT, VIR_DOMAIN_AFFECT_LIVE, or VIR_DOMAIN_AFFECT_CONFIG.

Here is a sample code snippet:

    char *ret = virDomainGetSchedulerType(dom, &nparams);
    if (ret && nparams != 0) {
        if ((params = malloc(sizeof(*params) * nparams)) == NULL)
            goto error;
        memset(params, 0, sizeof(*params) * nparams);
        if (virDomainGetSchedulerParametersFlags(dom, params, &nparams, 0))
            goto error;
    }

domain
  pointer to domain object
params
  pointer to scheduler parameter object (return value)
nparams
  pointer to number of scheduler parameter (this value should be same than the returned value nparams of virDomainGetSchedulerType()); input and output
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetSchedulerType`

    char *	virDomainGetSchedulerType	(virDomainPtr domain,
    					 int * nparams)

Get the scheduler type and the number of scheduler parameters.

domain
  pointer to domain object
nparams
  pointer to number of scheduler parameters, can be NULL (return value)
Returns
  NULL in case of error. The caller must free the returned string.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetSecurityLabel`

    int	virDomainGetSecurityLabel	(virDomainPtr domain,
    					 virSecurityLabelPtr seclabel)

Extract security label of an active domain. The 'label' field in the `seclabel` argument will be initialized to the empty string if the domain is not running under a security model.

domain
  a domain object
seclabel
  pointer to a virSecurityLabel structure
Returns
  0 in case of success, -1 in case of failure

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetSecurityLabelList`

    int	virDomainGetSecurityLabelList	(virDomainPtr domain,
    					 virSecurityLabelPtr * seclabels)

Extract the security labels of an active domain. The 'label' field in the `seclabels` argument will be initialized to the empty string if the domain is not running under a security model.

domain
  a domain object
seclabels
  will be auto-allocated and filled with domains' security labels. Caller must free memory on return.
Returns
  number of elements in `seclabels` on success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetState`

    int	virDomainGetState		(virDomainPtr domain,
    					 int * state,
    					 int * reason,
    					 unsigned int flags)

Extract domain state. Each state can be accompanied with a reason (if known) which led to the state.

domain
  a domain object
state
  returned state of the domain (one of virDomainState)
reason
  returned reason which led to `state` (one of virDomain*Reason corresponding to the current state); it is allowed to be NULL
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetTime`

    int	virDomainGetTime		(virDomainPtr dom,
    					 long long * seconds,
    					 unsigned int * nseconds,
    					 unsigned int flags)

Extract information about guest time and store it into `seconds` and `nseconds`. The `seconds` represents the number of seconds since the UNIX Epoch of 1970-01-01 00:00:00 in UTC.

Please note that some hypervisors may require guest agent to be configured and running in order to run this API.

dom
  a domain object
seconds
  domain's time in seconds
nseconds
  the nanosecond part of `seconds`
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 on success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainGetUUID`

    int	virDomainGetUUID		(virDomainPtr domain,
    					 unsigned char * uuid)

Get the UUID for a domain

domain
  a domain object
uuid
  pointer to a VIR_UUID_BUFLEN bytes array
Returns
  -1 in case of error, 0 in case of success

### `virDomainGetUUIDString`

    int	virDomainGetUUIDString		(virDomainPtr domain,
    					 char * buf)

Get the UUID for a domain as string. For more information about UUID see RFC4122.

domain
  a domain object
buf
  pointer to a VIR_UUID_STRING_BUFLEN bytes array
Returns
  -1 in case of error, 0 in case of success

### `virDomainGetVcpuPinInfo`

    int	virDomainGetVcpuPinInfo		(virDomainPtr domain,
    					 int ncpumaps,
    					 unsigned char * cpumaps,
    					 int maplen,
    					 unsigned int flags)

Query the CPU affinity setting of all virtual CPUs of domain, store it in cpumaps.

domain
  pointer to domain object, or NULL for Domain0
ncpumaps
  the number of cpumap (listed first to match virDomainGetVcpus)
cpumaps
  pointer to a bit map of real CPUs for all vcpus of this domain (in 8-bit bytes) (OUT) It's assumed there is <ncpumaps> cpumap in cpumaps array. The memory allocated to cpumaps must be (ncpumaps * maplen) bytes (ie: calloc(ncpumaps, maplen)). One cpumap inside cpumaps has the format described in virDomainPinVcpu() API. Must not be NULL.
maplen
  the number of bytes in one cpumap, from 1 up to size of CPU map. Must be positive.
flags
  bitwise-OR of virDomainModificationImpact Must not be VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CONFIG concurrently.
Returns
  the number of virtual CPUs in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetVcpus`

    int	virDomainGetVcpus		(virDomainPtr domain,
    					 virVcpuInfoPtr info,
    					 int maxinfo,
    					 unsigned char * cpumaps,
    					 int maplen)

Extract information about virtual CPUs of domain, store it in info array and also in cpumaps if this pointer isn't NULL. This call may fail on an inactive domain.

See also virDomainGetVcpuPinInfo for querying just cpumaps, including on an inactive domain.

domain
  pointer to domain object, or NULL for Domain0
info
  pointer to an array of virVcpuInfo structures (OUT)
maxinfo
  number of structures in info array
cpumaps
  pointer to a bit map of real CPUs for all vcpus of this domain (in 8-bit bytes) (OUT) If cpumaps is NULL, then no cpumap information is returned by the API. It's assumed there is <maxinfo> cpumap in cpumaps array. The memory allocated to cpumaps must be (maxinfo * maplen) bytes (ie: calloc(maxinfo, maplen)). One cpumap inside cpumaps has the format described in virDomainPinVcpu() API.
maplen
  number of bytes in one cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). Must be zero when cpumaps is NULL and positive when it is non-NULL.
Returns
  the number of info filled in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainGetVcpusFlags`

    int	virDomainGetVcpusFlags		(virDomainPtr domain,
    					 unsigned int flags)

Query the number of virtual CPUs used by the domain. Note that this call may fail if the underlying virtualization hypervisor does not support it. This function may require privileged access to the hypervisor.

If `flags` includes VIR_DOMAIN_AFFECT_LIVE, this will query a running domain (which will fail if domain is not active); if it includes VIR_DOMAIN_AFFECT_CONFIG, this will query the XML description of the domain. It is an error to set both flags. If neither flag is set (that is, VIR_DOMAIN_AFFECT_CURRENT), then the configuration queried depends on whether the domain is currently running.

If `flags` includes VIR_DOMAIN_VCPU_MAXIMUM, then the maximum virtual CPU limit is queried. Otherwise, this call queries the current virtual CPU count.

If `flags` includes VIR_DOMAIN_VCPU_GUEST, then the state of the processors is queried in the guest instead of the hypervisor. This flag is only usable on live domains. Guest agent may be needed for this flag to be available.

domain
  pointer to domain object, or NULL for Domain0
flags
  bitwise-OR of virDomainVcpuFlags
Returns
  the number of vCPUs in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -
domain | write | VIR_DOMAIN_VCPU_GUEST

### `virDomainGetXMLDesc`

    char *	virDomainGetXMLDesc		(virDomainPtr domain,
    					 unsigned int flags)

Provide an XML description of the domain. The description may be reused later to relaunch the domain with virDomainCreateXML().

No security-sensitive data will be included unless `flags` contains VIR_DOMAIN_XML_SECURE; this flag is rejected on read-only connections. If `flags` includes VIR_DOMAIN_XML_INACTIVE, then the XML represents the configuration that will be used on the next boot of a persistent domain; otherwise, the configuration represents the currently running domain. If `flags` contains VIR_DOMAIN_XML_UPDATE_CPU, then the portion of the domain XML describing CPU capabilities is modified to match actual capabilities of the host.

If `flags` contains VIR_DOMAIN_XML_MIGRATABLE, the XML is altered to assist in migrations, since the source and destination may be running different libvirt versions. This may include trimming redundant or default information that might confuse an older recipient, or exposing internal details that aid a newer recipient; this flag is rejected on read-only connections, and the resulting XML might not validate against the schema, so it is mainly for internal use.

domain
  a domain object
flags
  bitwise-OR of virDomainXMLFlags
Returns
  a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. The caller must free() the returned value.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -
domain | read-secure | VIR_DOMAIN_XML_SECURE
domain | read-secure | VIR_DOMAIN_XML_MIGRATABLE

### `virDomainHasManagedSaveImage`

    int	virDomainHasManagedSaveImage	(virDomainPtr dom,
    					 unsigned int flags)

Check if a domain has a managed save image as created by virDomainManagedSave(). Note that any running domain should not have such an image, as it should have been removed on restart.

dom
  pointer to the domain
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 if no image is present, 1 if an image is present, and -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainIOThreadInfoFree`

    void	virDomainIOThreadInfoFree	(virDomainIOThreadInfoPtr info)

Frees the memory used by `info`.

info
  pointer to a virDomainIOThreadInfo object

### `virDomainInjectNMI`

    int	virDomainInjectNMI		(virDomainPtr domain,
    					 unsigned int flags)

Send NMI to the guest

domain
  pointer to domain object, or NULL for Domain0
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | inject-nmi | -

### `virDomainInterfaceAddresses`

    int	virDomainInterfaceAddresses	(virDomainPtr dom,
    					 virDomainInterfacePtr ** ifaces,
    					 unsigned int source,
    					 unsigned int flags)

Return a pointer to the allocated array of pointers to interfaces present in given domain along with their IP and MAC addresses. Note that single interface can have multiple or even 0 IP addresses.

This API dynamically allocates the virDomainInterfacePtr struct based on how many interfaces domain `dom` has, usually there's 1:1 correlation. The count of the interfaces is returned as the return value.

If `source` is VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE, the DHCP lease file associated with any virtual networks will be examined to obtain the interface addresses. This only returns data for interfaces which are connected to virtual networks managed by libvirt.

If `source` is VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT, a configured guest agent is needed for successful return from this API. Moreover, if guest agent is used then the interface name is the one seen by guest OS. To match such interface with the one from `dom` XML use MAC address or IP range.

If `source` is VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP, the host ARP table will be check to obtain the interface addresses. As the arp cache refreshes in time, the returned ip address may be unreachable. Depending on the route table config of the guest, the returned mac address may be duplicated.

Note that for some `source` values some pieces of returned `ifaces` might be unset (e.g. VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP does not set IP address prefix as ARP table does not have any notion of that).

`ifaces->name` and `ifaces->hwaddr` are never NULL.

The caller *must* free `ifaces` when no longer needed. Usual use case looks like this:

    virDomainInterfacePtr *ifaces = NULL;
    int ifaces_count = 0;
    size_t i, j;
    virDomainPtr dom = ... obtain a domain here ...;

    if ((ifaces_count = virDomainInterfaceAddresses(dom, &ifaces,
             VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE)) < 0)
        goto cleanup;

... do something with returned values, for example:

    for (i = 0; i < ifaces_count; i++) {
        printf("name: %s", ifaces[i]->name);
        if (ifaces[i]->hwaddr)
            printf(" hwaddr: %s", ifaces[i]->hwaddr);

        for (j = 0; j < ifaces[i]->naddrs; j++) {
            virDomainIPAddressPtr ip_addr = ifaces[i]->addrs + j;
            printf("[addr: %s prefix: %d type: %d]",
                   ip_addr->addr, ip_addr->prefix, ip_addr->type);
        }
        printf("\n");
    }

    cleanup:
        if (ifaces && ifaces_count > 0)
            for (i = 0; i < ifaces_count; i++)
                virDomainInterfaceFree(ifaces[i]);
        free(ifaces);

dom
  domain object
ifaces
  pointer to an array of pointers pointing to interface objects
source
  one of the virDomainInterfaceAddressesSource constants
flags
  currently unused, pass zero
Returns
  the number of interfaces on success, -1 in case of error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -
domain | write |

### `virDomainInterfaceFree`

    void	virDomainInterfaceFree		(virDomainInterfacePtr iface)

Free the interface object. The data structure is freed and should not be used thereafter. If `iface` is NULL, then this method has no effect.

iface
  an interface object

### `virDomainInterfaceStats`

    int	virDomainInterfaceStats		(virDomainPtr dom,
    					 const char * device,
    					 virDomainInterfaceStatsPtr stats,
    					 size_t size)

This function returns network interface stats for interfaces attached to the domain.

The `device` parameter is the network interface either by name or MAC address.

Domains may have more than one network interface. To get stats for each you should make multiple calls to this function.

Individual fields within the stats structure may be returned as -1, which indicates that the hypervisor does not support that particular statistic.

The returned stats are from domain's point of view.

Please note, for an unmanaged ethernet type, returned stats might have RX/TX swapped.

dom
  pointer to the domain object
device
  the interface name or MAC address
stats
  network interface stats (returned)
size
  size of stats structure
Returns
  0 in case of success or -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainIsActive`

    int	virDomainIsActive		(virDomainPtr dom)

Determine if the domain is currently running

dom
  pointer to the domain object
Returns
  1 if running, 0 if inactive, -1 on error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainIsPersistent`

    int	virDomainIsPersistent		(virDomainPtr dom)

Determine if the domain has a persistent configuration which means it will still exist after shutting down

dom
  pointer to the domain object
Returns
  1 if persistent, 0 if transient, -1 on error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainIsUpdated`

    int	virDomainIsUpdated		(virDomainPtr dom)

Determine if the domain has been updated.

dom
  pointer to the domain object
Returns
  1 if updated, 0 if not, -1 on error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainListGetStats`

    int	virDomainListGetStats		(virDomainPtr * doms,
    					 unsigned int stats,
    					 virDomainStatsRecordPtr ** retStats,
    					 unsigned int flags)

Query statistics for domains provided by `doms`. Note that all domains in `doms` must share the same connection.

Report statistics of various parameters for a running VM according to `stats` field. The statistics are returned as an array of structures for each queried domain. The structure contains an array of typed parameters containing the individual statistics. The typed parameter name for each statistic field consists of a dot-separated string containing name of the requested group followed by a group specific description of the statistic value.

The statistic groups are enabled using the `stats` parameter which is a binary-OR of enum virDomainStatsTypes. The stats groups are documented in virConnectGetAllDomainStats.

Using 0 for `stats` returns all stats groups supported by the given hypervisor.

Specifying VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS as `flags` makes the function return error in case some of the stat types in `stats` were not recognized by the daemon. However, even with this flag, a hypervisor may omit individual fields within a known group if the information is not available; as an extreme example, a supported group may produce zero fields for offline domains if the statistics are meaningful only for a running domain.

Passing VIR_CONNECT_GET_ALL_DOMAINS_STATS_NOWAIT in `flags` means when libvirt is unable to fetch stats for any of the domains (for whatever reason) only a subset of statistics is returned for the domain. That subset being statistics that don't involve querying the underlying hypervisor.

Note that any of the domain list filtering flags in `flags` may be rejected by this function.

doms
  NULL terminated array of domains
stats
  stats to return, binary-OR of virDomainStatsTypes
retStats
  Pointer that will be filled with the array of returned stats
flags
  extra flags; binary-OR of virConnectGetAllDomainStatsFlags
Returns
  the count of returned statistics structures on success, -1 on error. The requested data are returned in the `retStats` parameter. The returned array should be freed by the caller. See virDomainStatsRecordListFree. Note that the count of returned stats may be less than the domain count provided via `doms`.

### `virDomainLookupByID`

    virDomainPtr	virDomainLookupByID	(virConnectPtr conn,
    					 int id)

Try to find a domain based on the hypervisor ID number Note that this won't work for inactive domains which have an ID of -1, in that case a lookup based on the Name or UUID need to be done instead.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
id
  the domain ID number
Returns
  a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | getattr | -

### `virDomainLookupByName`

    virDomainPtr	virDomainLookupByName	(virConnectPtr conn,
    					 const char * name)

Try to lookup a domain on the given hypervisor based on its name.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
name
  name for the domain
Returns
  a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | getattr | -

### `virDomainLookupByUUID`

    virDomainPtr	virDomainLookupByUUID	(virConnectPtr conn,
    					 const unsigned char * uuid)

Try to lookup a domain on the given hypervisor based on its UUID.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
uuid
  the raw UUID for the domain
Returns
  a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | getattr | -

### `virDomainLookupByUUIDString`

    virDomainPtr	virDomainLookupByUUIDString	(virConnectPtr conn,
    						 const char * uuidstr)

Try to lookup a domain on the given hypervisor based on its UUID.

virDomainFree should be used to free the resources after the domain object is no longer needed.

conn
  pointer to the hypervisor connection
uuidstr
  the string UUID for the domain
Returns
  a new domain object or NULL in case of failure. If the domain cannot be found, then VIR_ERR_NO_DOMAIN error is raised.

### `virDomainManagedSave`

    int	virDomainManagedSave		(virDomainPtr dom,
    					 unsigned int flags)

This method will suspend a domain and save its memory contents to a file on disk. After the call, if successful, the domain is not listed as running anymore. The difference from virDomainSave() is that libvirt is keeping track of the saved state itself, and will reuse it once the domain is being restarted (automatically or via an explicit libvirt call). As a result any running domain is sure to not have a managed saved image. This also implies that managed save only works on persistent domains, since the domain must still exist in order to use virDomainCreate() to restart it.

If `flags` includes VIR_DOMAIN_SAVE_BYPASS_CACHE, then libvirt will attempt to bypass the file system cache while creating the file, or fail if it cannot do so for the given system; this can allow less pressure on file system cache, but also risks slowing saves to NFS.

Normally, the managed saved state will remember whether the domain was running or paused, and start will resume to the same state. Specifying VIR_DOMAIN_SAVE_RUNNING or VIR_DOMAIN_SAVE_PAUSED in `flags` will override the default saved into the file. These two flags are mutually exclusive.

dom
  pointer to the domain
flags
  bitwise-OR of virDomainSaveRestoreFlags
Returns
  0 in case of success or -1 in case of failure

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | hibernate | -

### `virDomainManagedSaveDefineXML`

    int	virDomainManagedSaveDefineXML	(virDomainPtr domain,
    					 const char * dxml,
    					 unsigned int flags)

This updates the definition of a domain stored in a saved state file.

`dxml` can be used to alter host-specific portions of the domain XML that will be used on the next start of the domain. For example, it is possible to alter the backing filename that is associated with a disk device.

Normally, the saved state file will remember whether the domain was running or paused, and restore defaults to the same state. Specifying VIR_DOMAIN_SAVE_RUNNING or VIR_DOMAIN_SAVE_PAUSED in `flags` will override the default saved into the file; omitting both leaves the file's default unchanged. These two flags are mutually exclusive.

domain
  a domain object
dxml
  XML config for adjusting guest xml used on restore
flags
  bitwise-OR of virDomainSaveRestoreFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | hibernate | -

### `virDomainManagedSaveGetXMLDesc`

    char *	virDomainManagedSaveGetXMLDesc	(virDomainPtr domain,
    					 unsigned int flags)

This method will extract the XML description of the managed save state file of a domain.

No security-sensitive data will be included unless `flags` contains VIR_DOMAIN_SAVE_IMAGE_XML_SECURE; this flag is rejected on read-only connections.

domain
  a domain object
flags
  bitwise-OR of supported virDomainSaveImageXMLFlags
Returns
  a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. The caller must free() the returned value.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -
domain | read-secure | VIR_DOMAIN_SAVE_IMAGE_XML_SECURE

### `virDomainManagedSaveRemove`

    int	virDomainManagedSaveRemove	(virDomainPtr dom,
    					 unsigned int flags)

Remove any managed save image for this domain.

dom
  pointer to the domain
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, and -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | hibernate | -

### `virDomainMemoryPeek`

    int	virDomainMemoryPeek		(virDomainPtr dom,
    					 unsigned long long start,
    					 size_t size,
    					 void * buffer,
    					 unsigned int flags)

This function allows you to read the contents of a domain's memory.

The memory which is read is controlled by the 'start', 'size' and 'flags' parameters.

If 'flags' is VIR_MEMORY_VIRTUAL then the 'start' and 'size' parameters are interpreted as virtual memory addresses for whichever task happens to be running on the domain at the moment. Although this sounds haphazard it is in fact what you want in order to read Linux kernel state, because it ensures that pointers in the kernel image can be interpreted coherently.

'buffer' is the return buffer and must be at least 'size' bytes. 'size' may be 0 to test if the call would succeed.

NB. The remote driver imposes a 64K byte limit on 'size'. For your program to be able to work reliably over a remote connection you should split large requests to <= 65536 bytes. However, with 0.9.13 this RPC limit has been raised to 1M byte. Starting with version 1.0.6 the RPC limit has been raised again. Now large requests up to 16M byte are supported.

dom
  pointer to the domain object
start
  start of memory to peek
size
  size of memory to peek
buffer
  return buffer (must be at least size bytes)
flags
  bitwise-OR of virDomainMemoryFlags
Returns
  0 in case of success or -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | mem-read | -

### `virDomainMemoryStats`

    int	virDomainMemoryStats		(virDomainPtr dom,
    					 virDomainMemoryStatPtr stats,
    					 unsigned int nr_stats,
    					 unsigned int flags)

This function provides memory statistics for the domain.

Up to 'nr_stats' elements of 'stats' will be populated with memory statistics from the domain. Only statistics supported by the domain, the driver, and this version of libvirt will be returned.

Memory Statistics:

VIR_DOMAIN_MEMORY_STAT_SWAP_IN: The total amount of data read from swap space (in kb). VIR_DOMAIN_MEMORY_STAT_SWAP_OUT: The total amount of memory written out to swap space (in kb). VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT: The number of page faults that required disk IO to service. VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT: The number of page faults serviced without disk IO. VIR_DOMAIN_MEMORY_STAT_UNUSED: The amount of memory which is not being used for any purpose (in kb). VIR_DOMAIN_MEMORY_STAT_AVAILABLE: The total amount of memory available to the domain's OS (in kb). VIR_DOMAIN_MEMORY_STAT_USABLE: How much the balloon can be inflated without pushing the guest system to swap, corresponds to 'Available' in /proc/meminfo VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON: Current balloon value (in kb). VIR_DOMAIN_MEMORY_STAT_LAST_UPDATE Timestamp of the last statistic VIR_DOMAIN_MEMORY_STAT_DISK_CACHES Memory that can be reclaimed without additional I/O, typically disk caches (in kb). VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGALLOC The number of successful huge page allocations from inside the domain VIR_DOMAIN_MEMORY_STAT_HUGETLB_PGFAIL The number of failed huge page allocations from inside the domain

dom
  pointer to the domain object
stats
  nr_stats-sized array of stat structures (returned)
nr_stats
  number of memory statistics requested
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  The number of stats provided or -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainMigrate`

    virDomainPtr	virDomainMigrate	(virDomainPtr domain,
    					 virConnectPtr dconn,
    					 unsigned long flags,
    					 const char * dname,
    					 const char * uri,
    					 unsigned long bandwidth)

Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host).

This function is similar to virDomainMigrate3, but it only supports a fixed set of parameters: `dname` corresponds to VIR_MIGRATE_PARAM_DEST_NAME, `uri` is VIR_MIGRATE_PARAM_URI, and `bandwidth` is VIR_MIGRATE_PARAM_BANDWIDTH.

virDomainFree should be used to free the resources after the returned domain object is no longer needed.

domain
  a domain object
dconn
  destination host (a connection object)
flags
  bitwise-OR of virDomainMigrateFlags
dname
  (optional) rename domain to this at destination
uri
  (optional) dest hostname/URI as seen from the source host
bandwidth
  (optional) specify migration bandwidth limit in MiB/s
Returns
  the new domain object if the migration was successful, or NULL in case of error. Note that the new domain object exists in the scope of the destination connection (dconn).

### `virDomainMigrate2`

    virDomainPtr	virDomainMigrate2	(virDomainPtr domain,
    					 virConnectPtr dconn,
    					 const char * dxml,
    					 unsigned long flags,
    					 const char * dname,
    					 const char * uri,
    					 unsigned long bandwidth)

Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host).

This function is similar to virDomainMigrate3, but it only supports a fixed set of parameters: `dxml` corresponds to VIR_MIGRATE_PARAM_DEST_XML, `dname` is VIR_MIGRATE_PARAM_DEST_NAME, `uri` is VIR_MIGRATE_PARAM_URI, and `bandwidth` is VIR_MIGRATE_PARAM_BANDWIDTH.

virDomainFree should be used to free the resources after the returned domain object is no longer needed.

domain
  a domain object
dconn
  destination host (a connection object)
dxml
  (optional) XML config for launching guest on target
flags
  bitwise-OR of virDomainMigrateFlags
dname
  (optional) rename domain to this at destination
uri
  (optional) dest hostname/URI as seen from the source host
bandwidth
  (optional) specify migration bandwidth limit in MiB/s
Returns
  the new domain object if the migration was successful, or NULL in case of error. Note that the new domain object exists in the scope of the destination connection (dconn).

### `virDomainMigrate3`

    virDomainPtr	virDomainMigrate3	(virDomainPtr domain,
    					 virConnectPtr dconn,
    					 virTypedParameterPtr params,
    					 unsigned int nparams,
    					 unsigned int flags)

Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host).

See VIR_MIGRATE_PARAM_* and virDomainMigrateFlags for detailed description of accepted migration parameters and flags.

See virDomainMigrateFlags documentation for description of individual flags.

VIR_MIGRATE_TUNNELLED and VIR_MIGRATE_PEER2PEER are not supported by this API, use virDomainMigrateToURI3 instead.

There are many limitations on migration imposed by the underlying technology - for example it may not be possible to migrate between different processors even with the same architecture, or between different types of hypervisor.

virDomainFree should be used to free the resources after the returned domain object is no longer needed.

domain
  a domain object
dconn
  destination host (a connection object)
params
  (optional) migration parameters
nparams
  (optional) number of migration parameters in `params`
flags
  bitwise-OR of virDomainMigrateFlags
Returns
  the new domain object if the migration was successful, or NULL in case of error. Note that the new domain object exists in the scope of the destination connection (dconn).

### `virDomainMigrateGetCompressionCache`

    int	virDomainMigrateGetCompressionCache	(virDomainPtr domain,
    						 unsigned long long * cacheSize,
    						 unsigned int flags)

Gets current size of the cache (in bytes) used for compressing repeatedly transferred memory pages during live migration.

domain
  a domain object
cacheSize
  return value of current size of the cache (in bytes)
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | migrate | -

### `virDomainMigrateGetMaxDowntime`

    int	virDomainMigrateGetMaxDowntime	(virDomainPtr domain,
    					 unsigned long long * downtime,
    					 unsigned int flags)

Gets current maximum tolerable time for which the domain may be paused at the end of live migration.

domain
  a domain object
downtime
  return value of the maximum tolerable downtime for live migration, in milliseconds
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | migrate | -

### `virDomainMigrateGetMaxSpeed`

    int	virDomainMigrateGetMaxSpeed	(virDomainPtr domain,
    					 unsigned long * bandwidth,
    					 unsigned int flags)

Get the current maximum bandwidth (in MiB/s) that will be used if the domain is migrated. Not all hypervisors will support a bandwidth limit. When VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY is set in `flags`, this API gets the current maximum bandwidth for the post-copy phase of the migration.

domain
  a domain object
bandwidth
  return value of current migration bandwidth limit in MiB/s
flags
  bitwise-OR of virDomainMigrateMaxSpeedFlags
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | migrate | -

### `virDomainMigrateSetCompressionCache`

    int	virDomainMigrateSetCompressionCache	(virDomainPtr domain,
    						 unsigned long long cacheSize,
    						 unsigned int flags)

Sets size of the cache (in bytes) used for compressing repeatedly transferred memory pages during live migration. It's supposed to be called while the domain is being live-migrated as a reaction to migration progress and increasing number of compression cache misses obtained from virDomainGetJobStats.

domain
  a domain object
cacheSize
  size of the cache (in bytes) used for compression
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | migrate | -

### `virDomainMigrateSetMaxDowntime`

    int	virDomainMigrateSetMaxDowntime	(virDomainPtr domain,
    					 unsigned long long downtime,
    					 unsigned int flags)

Sets maximum tolerable time for which the domain is allowed to be paused at the end of live migration. It's supposed to be called while the domain is being live-migrated as a reaction to migration progress.

domain
  a domain object
downtime
  maximum tolerable downtime for live migration, in milliseconds
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | migrate | -

### `virDomainMigrateSetMaxSpeed`

    int	virDomainMigrateSetMaxSpeed	(virDomainPtr domain,
    					 unsigned long bandwidth,
    					 unsigned int flags)

The maximum bandwidth (in MiB/s) that will be used to do migration can be specified with the bandwidth parameter. Not all hypervisors will support a bandwidth cap. When VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY is set in `flags`, this API sets the maximum bandwidth for the post-copy phase of the migration.

domain
  a domain object
bandwidth
  migration bandwidth limit in MiB/s
flags
  bitwise-OR of virDomainMigrateMaxSpeedFlags
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | migrate | -

### `virDomainMigrateStartPostCopy`

    int	virDomainMigrateStartPostCopy	(virDomainPtr domain,
    					 unsigned int flags)

Starts post-copy migration. This function has to be called while migration (initiated with VIR_MIGRATE_POSTCOPY flag) is in progress.

Traditional pre-copy migration iteratively walks through guest memory pages and migrates those that changed since the previous iteration. The iterative phase stops when the number of dirty pages is low enough so that the virtual CPUs can be paused, all dirty pages transferred to the destination, where the virtual CPUs are unpaused, and all this can happen within a predefined downtime period. It's clear that this process may never converge if downtime is too short and/or the guest keeps changing a lot of memory pages.

When migration is switched to post-copy mode, the virtual CPUs are paused immediately, only a minimum set of pages is transferred, and the CPUs are unpaused on destination. The source keeps sending all remaining memory pages to the destination while the guest is already running there. Whenever the guest tries to read a memory page which has not been migrated yet, the hypervisor has to tell the source to transfer that page in a priority channel. To minimize such page faults, it is a good idea to run at least one iteration of pre-copy migration before switching to post-copy.

Post-copy migration is guaranteed to converge since each page is transferred at most once no matter how fast it changes. On the other hand once the guest is running on the destination host, the migration can no longer be rolled back because none of the hosts has complete state. If this happens, libvirt will leave the domain paused on the source host with VIR_DOMAIN_PAUSED_POSTCOPY_FAILED reason. The domain on the destination host will remain running with VIR_DOMAIN_RUNNING_POSTCOPY_FAILED reason. It's up to the upper layer to decide what to do in such case. Because of this, libvirt will refuse to cancel post-copy migration via virDomainAbortJobFlags unless it is called with VIR_DOMAIN_ABORT_JOB_POSTCOPY, in which case the post-copy migration will be paused.

Failed post-copy migration can be recovered once the cause for the failure (e.g., a network issue) is resolved by repeating the migration with an additional VIR_MIGRATE_POSTCOPY_RESUME flag. This will recreate the connection and resume migration from the point where it failed. This step can be repeated in case the migration breaks again.

The following domain life cycle events are emitted during post-copy migration: VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY (on the source) -- migration entered post-copy mode. VIR_DOMAIN_EVENT_RESUMED_POSTCOPY (on the destination) -- the guest is running on the destination host while some of its memory pages still remain on the source host; neither the source nor the destination host contain a complete guest state from this point until migration finishes. VIR_DOMAIN_EVENT_RESUMED_MIGRATED (on the destination), VIR_DOMAIN_EVENT_STOPPED_MIGRATED (on the source) -- migration finished successfully and the destination host holds a complete guest state. VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY_FAILED (on the source), VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED (on the destination) -- emitted when migration fails in post-copy mode and it's unclear whether any of the hosts has a complete guest state. Virtual CPUs on the destination are still running.

The progress of a post-copy migration can be monitored normally using virDomainGetJobStats on the source host. Fetching statistics of a completed post-copy migration can also be done on the source host (by calling virDomainGetJobStats or listening to VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event, but (in contrast to pre-copy migration) the statistics are not available on the destination host. Thus, VIR_DOMAIN_EVENT_ID_JOB_COMPLETED event is the only way of getting statistics of a completed post-copy migration of a transient domain (because the domain is removed after migration and there's no domain to run virDomainGetJobStats on).

domain
  a domain object
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | migrate | -

### `virDomainMigrateToURI`

    int	virDomainMigrateToURI		(virDomainPtr domain,
    					 const char * duri,
    					 unsigned long flags,
    					 const char * dname,
    					 unsigned long bandwidth)

Migrate the domain object from its current host to the destination host given by duri.

This function is similar to virDomainMigrateToURI3, but it only supports a fixed set of parameters: `dname` corresponds to VIR_MIGRATE_PARAM_DEST_NAME, and `bandwidth` corresponds to VIR_MIGRATE_PARAM_BANDWIDTH.

The operation of this API hinges on the VIR_MIGRATE_PEER2PEER flag.

If the VIR_MIGRATE_PEER2PEER flag IS set, the `duri` parameter must be a valid libvirt connection URI, by which the source libvirt driver can connect to the destination libvirt. In other words, `duri` corresponds to `dconnuri` of virDomainMigrateToURI3.

If the VIR_MIGRATE_PEER2PEER flag is NOT set, the `duri` parameter takes a hypervisor specific URI used to initiate the migration. In this case `duri` corresponds to VIR_MIGRATE_PARAM_URI of virDomainMigrateToURI3.

domain
  a domain object
duri
  mandatory URI for the destination host
flags
  bitwise-OR of virDomainMigrateFlags
dname
  (optional) rename domain to this at destination
bandwidth
  (optional) specify migration bandwidth limit in MiB/s
Returns
  0 if the migration succeeded, -1 upon error.

### `virDomainMigrateToURI2`

    int	virDomainMigrateToURI2		(virDomainPtr domain,
    					 const char * dconnuri,
    					 const char * miguri,
    					 const char * dxml,
    					 unsigned long flags,
    					 const char * dname,
    					 unsigned long bandwidth)

Migrate the domain object from its current host to the destination host given by `dconnuri`.

This function is similar to virDomainMigrateToURI3, but it only supports a fixed set of parameters: `miguri` corresponds to VIR_MIGRATE_PARAM_URI, `dxml` is VIR_MIGRATE_PARAM_DEST_XML, `dname` is VIR_MIGRATE_PARAM_DEST_NAME, and `bandwidth` corresponds to VIR_MIGRATE_PARAM_BANDWIDTH.

The operation of this API hinges on the VIR_MIGRATE_PEER2PEER flag.

If the VIR_MIGRATE_PEER2PEER flag IS set, the `dconnuri` parameter must be a valid libvirt connection URI, by which the source libvirt driver can connect to the destination libvirt. In other words, `dconnuri` has the same semantics as in virDomainMigrateToURI3.

If the VIR_MIGRATE_PEER2PEER flag is NOT set, the `dconnuri` must be NULL and the `miguri` parameter takes a hypervisor specific URI used to initiate the migration. In this case `miguri` corresponds to VIR_MIGRATE_PARAM_URI of virDomainMigrateToURI3.

domain
  a domain object
dconnuri
  (optional) URI for target libvirtd if `flags` includes VIR_MIGRATE_PEER2PEER
miguri
  (optional) URI for invoking the migration, not if `flags` includs VIR_MIGRATE_TUNNELLED
dxml
  (optional) XML config for launching guest on target
flags
  bitwise-OR of virDomainMigrateFlags
dname
  (optional) rename domain to this at destination
bandwidth
  (optional) specify migration bandwidth limit in MiB/s
Returns
  0 if the migration succeeded, -1 upon error.

### `virDomainMigrateToURI3`

    int	virDomainMigrateToURI3		(virDomainPtr domain,
    					 const char * dconnuri,
    					 virTypedParameterPtr params,
    					 unsigned int nparams,
    					 unsigned int flags)

Migrate the domain object from its current host to the destination host given by URI.

See VIR_MIGRATE_PARAM_* and virDomainMigrateFlags for detailed description of accepted migration parameters and flags.

The operation of this API hinges on the VIR_MIGRATE_PEER2PEER flag.

If the VIR_MIGRATE_PEER2PEER flag is set, the `dconnuri` parameter must be a valid libvirt connection URI, by which the source libvirt daemon can connect to the destination libvirt.

If the VIR_MIGRATE_PEER2PEER flag is NOT set, then `dconnuri` must be NULL and VIR_MIGRATE_PARAM_URI migration parameter must be filled in with hypervisor specific URI used to initiate the migration. The uri_transports element of the hypervisor capabilities XML includes supported URI schemes. This is called "direct" migration. Not all hypervisors support this mode of migration, so if the VIR_MIGRATE_PEER2PEER flag is not set, then it may be necessary to use the alternative virDomainMigrate3 API providing an explicit virConnectPtr for the destination host.

There are many limitations on migration imposed by the underlying technology - for example it may not be possible to migrate between different processors even with the same architecture, or between different types of hypervisor.

domain
  a domain object
dconnuri
  (optional) URI for target libvirtd if `flags` includes VIR_MIGRATE_PEER2PEER
params
  (optional) migration parameters
nparams
  (optional) number of migration parameters in `params`
flags
  bitwise-OR of virDomainMigrateFlags
Returns
  0 if the migration succeeded, -1 upon error.

### `virDomainOpenChannel`

    int	virDomainOpenChannel		(virDomainPtr dom,
    					 const char * name,
    					 virStreamPtr st,
    					 unsigned int flags)

This opens the host interface associated with a channel device on a guest, if the host interface is supported. If `name` is given, it can match either the device alias (e.g. "channel0"), or the virtio target name (e.g. "org.qemu.guest_agent.0"). If `name` is omitted, then the first channel is opened. The channel is associated with the passed in `st` stream, which should have been opened in non-blocking mode for bi-directional I/O.

By default, when `flags` is 0, the open will fail if libvirt detects that the channel is already in use by another client; passing VIR_DOMAIN_CHANNEL_FORCE will cause libvirt to forcefully remove the other client prior to opening this channel.

dom
  a domain object
name
  the channel name, or NULL
st
  a stream to associate with the channel
flags
  bitwise-OR of virDomainChannelFlags
Returns
  0 if the channel was opened, -1 on error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | open-device | -

### `virDomainOpenConsole`

    int	virDomainOpenConsole		(virDomainPtr dom,
    					 const char * dev_name,
    					 virStreamPtr st,
    					 unsigned int flags)

This opens the backend associated with a console, serial or parallel port device on a guest, if the backend is supported. If the `dev_name` is omitted, then the first console or serial device is opened. The console is associated with the passed in `st` stream, which should have been opened in non-blocking mode for bi-directional I/O.

By default, when `flags` is 0, the open will fail if libvirt detects that the console is already in use by another client; passing VIR_DOMAIN_CONSOLE_FORCE will cause libvirt to forcefully remove the other client prior to opening this console.

If flag VIR_DOMAIN_CONSOLE_SAFE the console is opened only in the case where the hypervisor driver supports safe (mutually exclusive) console handling.

Older servers did not support either flag, and also did not forbid simultaneous clients on a console, with potentially confusing results. When passing `flags` of 0 in order to support a wider range of server versions, it is up to the client to ensure mutual exclusion.

dom
  a domain object
dev_name
  the console, serial or parallel port device alias, or NULL
st
  a stream to associate with the console
flags
  bitwise-OR of virDomainConsoleFlags
Returns
  0 if the console was opened, -1 on error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | open-device | -

### `virDomainOpenGraphics`

    int	virDomainOpenGraphics		(virDomainPtr dom,
    					 unsigned int idx,
    					 int fd,
    					 unsigned int flags)

This will attempt to connect the file descriptor `fd`, to the graphics backend of `dom`. If `dom` has multiple graphics backends configured, then `idx` will determine which one is opened, starting from `idx` 0.

To disable any authentication, pass the VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH constant for `flags`.

The caller should use an anonymous socketpair to open `fd` before invocation.

This method can only be used when connected to a local libvirt hypervisor, over a UNIX domain socket. Attempts to use this method over a TCP connection will always fail

dom
  pointer to domain object
idx
  index of graphics config to open
fd
  file descriptor to attach graphics to
flags
  bitwise-OR of virDomainOpenGraphicsFlags
Returns
  0 on success, -1 on failure

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | open-graphics | -

### `virDomainOpenGraphicsFD`

    int	virDomainOpenGraphicsFD		(virDomainPtr dom,
    					 unsigned int idx,
    					 unsigned int flags)

This will create a socket pair connected to the graphics backend of `dom`. One end of the socket will be returned on success, and the other end is handed to the hypervisor. If `dom` has multiple graphics backends configured, then `idx` will determine which one is opened, starting from `idx` 0.

To disable any authentication, pass the VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH constant for `flags`.

This method can only be used when connected to a local libvirt hypervisor, over a UNIX domain socket. Attempts to use this method over a TCP connection will always fail.

dom
  pointer to domain object
idx
  index of graphics config to open
flags
  bitwise-OR of virDomainOpenGraphicsFlags
Returns
  an fd on success, -1 on failure

### `virDomainPMSuspendForDuration`

    int	virDomainPMSuspendForDuration	(virDomainPtr dom,
    					 unsigned int target,
    					 unsigned long long duration,
    					 unsigned int flags)

Attempt to have the guest enter the given `target` power management suspension level. If `duration` is non-zero, also schedule the guest to resume normal operation after that many seconds, if nothing else has resumed it earlier. Some hypervisors require that `duration` be 0, for an indefinite suspension.

Dependent on hypervisor used, this may require a guest agent to be available, e.g. QEMU.

Beware that at least for QEMU, the domain's process will be terminated when VIR_NODE_SUSPEND_TARGET_DISK is used and a new process will be launched when libvirt is asked to wake up the domain. As a result of this, any runtime changes, such as device hotplug or memory settings, are lost unless such changes were made with VIR_DOMAIN_AFFECT_CONFIG flag.

dom
  a domain object
target
  a value from virNodeSuspendTarget
duration
  duration in seconds to suspend, or 0 for indefinite
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 on success, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | pm-control | -

### `virDomainPMWakeup`

    int	virDomainPMWakeup		(virDomainPtr dom,
    					 unsigned int flags)

Inject a wakeup into the guest that previously used virDomainPMSuspendForDuration, rather than waiting for the previously requested duration (if any) to elapse.

dom
  a domain object
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 on success, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | pm-control | -

### `virDomainPinEmulator`

    int	virDomainPinEmulator		(virDomainPtr domain,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)

Dynamically change the real CPUs which can be allocated to all emulator threads. This function may require privileged access to the hypervisor.

`flags` may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG. Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects a running domain and may fail if domain is not alive. If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed. Not all hypervisors can support all flag combinations.

See also virDomainGetEmulatorPinInfo for querying this information.

domain
  pointer to domain object, or NULL for Domain0
cpumap
  pointer to a bit map of real CPUs (in 8-bit bytes) (IN) Each bit set to 1 means that corresponding CPU is usable. Bytes are stored in little-endian order: CPU0-7, 8-15... In each byte, lowest CPU number is least significant bit.
maplen
  number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen < size, missing bytes are set to zero. If maplen > size, failure code is returned.
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainPinIOThread`

    int	virDomainPinIOThread		(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)

Dynamically change the real CPUs which can be allocated to an IOThread. This function may require privileged access to the hypervisor.

`flags` may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG. Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects a running domain and may fail if domain is not alive. If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed. Not all hypervisors can support all flag combinations.

See also virDomainGetIOThreadInfo for querying this information.

domain
  a domain object
iothread_id
  the IOThread ID to set the CPU affinity
cpumap
  pointer to a bit map of real CPUs (in 8-bit bytes) (IN) Each bit set to 1 means that corresponding CPU is usable. Bytes are stored in little-endian order: CPU0-7, 8-15... In each byte, lowest CPU number is least significant bit.
maplen
  number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen < size, missing bytes are set to zero. If maplen > size, failure code is returned.
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainPinVcpu`

    int	virDomainPinVcpu		(virDomainPtr domain,
    					 unsigned int vcpu,
    					 unsigned char * cpumap,
    					 int maplen)

Dynamically change the real CPUs which can be allocated to a virtual CPU. This function may require privileged access to the hypervisor.

This command only changes the runtime configuration of the domain, so can only be called on an active domain.

domain
  pointer to domain object, or NULL for Domain0
vcpu
  virtual CPU number
cpumap
  pointer to a bit map of real CPUs (in 8-bit bytes) (IN) Each bit set to 1 means that corresponding CPU is usable. Bytes are stored in little-endian order: CPU0-7, 8-15... In each byte, lowest CPU number is least significant bit.
maplen
  number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen < size, missing bytes are set to zero. If maplen > size, failure code is returned.
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainPinVcpuFlags`

    int	virDomainPinVcpuFlags		(virDomainPtr domain,
    					 unsigned int vcpu,
    					 unsigned char * cpumap,
    					 int maplen,
    					 unsigned int flags)

Dynamically change the real CPUs which can be allocated to a virtual CPU. This function may require privileged access to the hypervisor.

`flags` may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG. Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects a running domain and may fail if domain is not alive. If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed. Not all hypervisors can support all flag combinations.

See also virDomainGetVcpuPinInfo for querying this information.

domain
  pointer to domain object, or NULL for Domain0
vcpu
  virtual CPU number
cpumap
  pointer to a bit map of real CPUs (in 8-bit bytes) (IN) Each bit set to 1 means that corresponding CPU is usable. Bytes are stored in little-endian order: CPU0-7, 8-15... In each byte, lowest CPU number is least significant bit.
maplen
  number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen < size, missing bytes are set to zero. If maplen > size, failure code is returned.
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainReboot`

    int	virDomainReboot			(virDomainPtr domain,
    					 unsigned int flags)

Reboot a domain, the domain object is still usable thereafter, but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request. Additionally, the hypervisor may check and support the domain 'on_reboot' XML setting resulting in a domain that shuts down instead of rebooting.

If `flags` is set to zero, then the hypervisor will choose the method of shutdown it considers best. To have greater control pass one or more of the virDomainRebootFlagValues. The order in which the hypervisor tries each shutdown method is undefined, and a hypervisor is not required to support all methods.

To use guest agent (VIR_DOMAIN_REBOOT_GUEST_AGENT) the domain XML must have <channel> configured.

Due to implementation limitations in some drivers (the qemu driver, for instance) it is not advised to migrate or save a guest that is rebooting as a result of this API. Migrating such a guest can lead to a plain shutdown on the destination.

domain
  a domain object
flags
  bitwise-OR of virDomainRebootFlagValues
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | init-control | -
domain | write | VIR_DOMAIN_REBOOT_GUEST_AGENT

### `virDomainRef`

    int	virDomainRef			(virDomainPtr domain)

Increment the reference count on the domain. For each additional call to this method, there shall be a corresponding call to virDomainFree to release the reference count, once the caller no longer needs the reference to this object.

This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using a domain would increment the reference count.

domain
  the domain to hold a reference on
Returns
  0 in case of success and -1 in case of failure.

### `virDomainRename`

    int	virDomainRename			(virDomainPtr dom,
    					 const char * new_name,
    					 unsigned int flags)

Rename a domain. New domain name is specified in the second argument. Depending on each driver implementation it may be required that domain is in a specific state.

There might be some attributes and/or elements in domain XML that if no value provided at XML defining time, libvirt will derive their value from the domain name. These are not updated by this API. Users are strongly advised to change these after the rename was successful.

dom
  pointer to the domain object
new_name
  new domain name
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 if successfully renamed, -1 on error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | -

### `virDomainReset`

    int	virDomainReset			(virDomainPtr domain,
    					 unsigned int flags)

Reset a domain immediately without any guest OS shutdown. Reset emulates the power reset button on a machine, where all hardware sees the RST line set and reinitializes internal state.

Note that there is a risk of data loss caused by reset without any guest OS shutdown.

domain
  a domain object
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | reset | -

### `virDomainRestore`

    int	virDomainRestore		(virConnectPtr conn,
    					 const char * from)

This method will restore a domain saved to disk by virDomainSave().

See virDomainRestoreFlags() for more control.

conn
  pointer to the hypervisor connection
from
  path to the input file
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | start | -
domain | write | -

### `virDomainRestoreFlags`

    int	virDomainRestoreFlags		(virConnectPtr conn,
    					 const char * from,
    					 const char * dxml,
    					 unsigned int flags)

This method will restore a domain saved to disk by virDomainSave().

If the hypervisor supports it, `dxml` can be used to alter host-specific portions of the domain XML that will be used when restoring an image. For example, it is possible to alter the backing filename that is associated with a disk device, in order to prepare for file renaming done as part of backing up the disk device while the domain is stopped.

If `flags` includes VIR_DOMAIN_SAVE_BYPASS_CACHE, then libvirt will attempt to bypass the file system cache while restoring the file, or fail if it cannot do so for the given system; this can allow less pressure on file system cache, but also risks slowing restores from NFS.

Normally, the saved state file will remember whether the domain was running or paused, and restore defaults to the same state. Specifying VIR_DOMAIN_SAVE_RUNNING or VIR_DOMAIN_SAVE_PAUSED in `flags` will override the default read from the file. These two flags are mutually exclusive.

If `flags` includes VIR_DOMAIN_SAVE_RESET_NVRAM, then libvirt will discard any existing NVRAM file and re-initialize NVRAM from the pristine template.

conn
  pointer to the hypervisor connection
from
  path to the input file
dxml
  (optional) XML config for adjusting guest xml used on restore
flags
  bitwise-OR of virDomainSaveRestoreFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | start | -
domain | write | -

### `virDomainRestoreParams`

    int	virDomainRestoreParams		(virConnectPtr conn,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

This method extends virDomainRestoreFlags by adding parameters. For now, VIR_DOMAIN_SAVE_PARAM_FILE is required but this requirement may be lifted in the future.

conn
  pointer to the hypervisor connection
params
  restore parameters
nparams
  number of restore parameters
flags
  bitwise-OR of virDomainSaveRestoreFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | start | -
domain | write | -

### `virDomainResume`

    int	virDomainResume			(virDomainPtr domain)

Resume a suspended domain, the process is restarted from the state where it was frozen by calling virDomainSuspend(). This function may require privileged access Moreover, resume may not be supported if domain is in some special state like VIR_DOMAIN_PMSUSPENDED.

domain
  a domain object
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | suspend | -

### `virDomainSave`

    int	virDomainSave			(virDomainPtr domain,
    					 const char * to)

This method will suspend a domain and save its memory contents to a file on disk. After the call, if successful, the domain is not listed as running anymore (this ends the life of a transient domain). Use virDomainRestore() to restore a domain after saving.

See virDomainSaveFlags() and virDomainSaveParams() for more control. Also, a save file can be inspected or modified slightly with virDomainSaveImageGetXMLDesc() and virDomainSaveImageDefineXML().

domain
  a domain object
to
  path for the output file
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | hibernate | -

### `virDomainSaveFlags`

    int	virDomainSaveFlags		(virDomainPtr domain,
    					 const char * to,
    					 const char * dxml,
    					 unsigned int flags)

This method will suspend a domain and save its memory contents to a file on disk. After the call, if successful, the domain is not listed as running anymore (this ends the life of a transient domain). Use virDomainRestore() to restore a domain after saving.

If the hypervisor supports it, `dxml` can be used to alter host-specific portions of the domain XML that will be used when restoring an image. For example, it is possible to alter the backing filename that is associated with a disk device, in order to prepare for file renaming done as part of backing up the disk device while the domain is stopped.

If `flags` includes VIR_DOMAIN_SAVE_BYPASS_CACHE, then libvirt will attempt to bypass the file system cache while creating the file, or fail if it cannot do so for the given system; this can allow less pressure on file system cache, but also risks slowing saves to NFS.

Normally, the saved state file will remember whether the domain was running or paused, and restore defaults to the same state. Specifying VIR_DOMAIN_SAVE_RUNNING or VIR_DOMAIN_SAVE_PAUSED in `flags` will override what state gets saved into the file. These two flags are mutually exclusive.

A save file can be inspected or modified slightly with virDomainSaveImageGetXMLDesc() and virDomainSaveImageDefineXML().

Some hypervisors may prevent this operation if there is a current block job running; in that case, use virDomainBlockJobAbort() to stop the block job first.

domain
  a domain object
to
  path for the output file
dxml
  (optional) XML config for adjusting guest xml used on restore
flags
  bitwise-OR of virDomainSaveRestoreFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | hibernate | -

### `virDomainSaveImageDefineXML`

    int	virDomainSaveImageDefineXML	(virConnectPtr conn,
    					 const char * file,
    					 const char * dxml,
    					 unsigned int flags)

This updates the definition of a domain stored in a saved state file. `file` must be a file created previously by virDomainSave() or virDomainSaveFlags().

`dxml` can be used to alter host-specific portions of the domain XML that will be used when restoring an image. For example, it is possible to alter the backing filename that is associated with a disk device, to match renaming done as part of backing up the disk device while the domain is stopped.

Normally, the saved state file will remember whether the domain was running or paused, and restore defaults to the same state. Specifying VIR_DOMAIN_SAVE_RUNNING or VIR_DOMAIN_SAVE_PAUSED in `flags` will override the default saved into the file; omitting both leaves the file's default unchanged. These two flags are mutually exclusive.

conn
  pointer to the hypervisor connection
file
  path to saved state file
dxml
  XML config for adjusting guest xml used on restore
flags
  bitwise-OR of virDomainSaveRestoreFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | hibernate | -

### `virDomainSaveImageGetXMLDesc`

    char *	virDomainSaveImageGetXMLDesc	(virConnectPtr conn,
    					 const char * file,
    					 unsigned int flags)

This method will extract the XML describing the domain at the time a saved state file was created. `file` must be a file created previously by virDomainSave() or virDomainSaveFlags().

No security-sensitive data will be included unless `flags` contains VIR_DOMAIN_SAVE_IMAGE_XML_SECURE.

conn
  pointer to the hypervisor connection
file
  path to saved state file
flags
  bitwise-OR of supported virDomainSaveImageXMLFlags
Returns
  a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. The caller must free() the returned value.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSaveParams`

    int	virDomainSaveParams		(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

This method extends virDomainSaveFlags by adding parameters. If VIR_DOMAIN_SAVE_PARAM_FILE is not provided then a managed save is performed (see virDomainManagedSave).

domain
  a domain object
params
  save parameters
nparams
  number of save parameters
flags
  bitwise-OR of virDomainSaveRestoreFlags
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | hibernate | -

### `virDomainScreenshot`

    char *	virDomainScreenshot		(virDomainPtr domain,
    					 virStreamPtr stream,
    					 unsigned int screen,
    					 unsigned int flags)

Take a screenshot of current domain console as a stream. The image format is hypervisor specific. Moreover, some hypervisors supports multiple displays per domain. These can be distinguished by `screen` argument.

This call sets up a stream; subsequent use of stream API is necessary to transfer actual data, determine how much data is successfully transferred, and detect any errors.

The screen ID is the sequential number of screen. In case of multiple graphics cards, heads are enumerated before devices, e.g. having two graphics cards, both with four heads, screen ID 5 addresses the second head on the second card.

domain
  a domain object
stream
  stream to use as output
screen
  monitor ID to take screenshot from
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  a string representing the mime-type of the image format, or NULL upon error. The caller must free() the returned value.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | screenshot | -

### `virDomainSendKey`

    int	virDomainSendKey		(virDomainPtr domain,
    					 unsigned int codeset,
    					 unsigned int holdtime,
    					 unsigned int * keycodes,
    					 int nkeycodes,
    					 unsigned int flags)

Send key(s) to the guest.

domain
  pointer to domain object, or NULL for Domain0
codeset
  the code set of keycodes, from virKeycodeSet
holdtime
  the duration (in milliseconds) that the keys will be held
keycodes
  array of keycodes
nkeycodes
  number of keycodes, up to VIR_DOMAIN_SEND_KEY_MAX_KEYS
flags
  extra flags; not used yet, so callers should always pass 0
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | send-input | -

### `virDomainSendProcessSignal`

    int	virDomainSendProcessSignal	(virDomainPtr domain,
    					 long long pid_value,
    					 unsigned int signum,
    					 unsigned int flags)

Send a signal to the designated process in the guest

The signal numbers must be taken from the virDomainProcessSignal enum. These will be translated to the corresponding signal number for the guest OS, by the guest agent delivering the signal. If there is no mapping from virDomainProcessSignal to the native OS signals, this API will report an error.

If `pid_value` is an integer greater than zero, it is treated as a process ID. If `pid_value` is an integer less than zero, it is treated as a process group ID. All the `pid_value` numbers are from the container/guest namespace. The value zero is not valid.

Not all hypervisors will support sending signals to arbitrary processes or process groups. If this API is implemented the minimum requirement is to be able to use `pid_value` == 1 (i.e. kill init). No other value is required to be supported.

If the `signum` is VIR_DOMAIN_PROCESS_SIGNAL_NOP then this API will simply report whether the process is running in the container/guest.

domain
  pointer to domain object
pid_value
  a positive integer process ID, or negative integer process group ID
signum
  a signal from the virDomainProcessSignal enum
flags
  currently unused, pass 0
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | send-signal | -

### `virDomainSetAutostart`

    int	virDomainSetAutostart		(virDomainPtr domain,
    					 int autostart)

Configure the domain to be automatically started when the host machine boots.

domain
  a domain object
autostart
  whether the domain should be automatically started 0 or 1
Returns
  -1 in case of error, 0 in case of success

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetBlkioParameters`

    int	virDomainSetBlkioParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Change all or a subset of the blkio tunables. This function may require privileged access to the hypervisor.

domain
  pointer to domain object
params
  pointer to blkio parameter objects
nparams
  number of blkio parameters (this value can be the same or less than the number of parameters supported)
flags
  bitwise-OR of virDomainModificationImpact
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetBlockIoTune`

    int	virDomainSetBlockIoTune		(virDomainPtr dom,
    					 const char * disk,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Change all or a subset of the per-device block IO tunables.

The `disk` parameter is either an unambiguous source name of the block device (the <source file='...'/> sub-element, such as "/path/to/image"), or the device target shorthand (the <target dev='...'/> sub-element, such as "xvda"). Valid names can be found by calling virDomainGetXMLDesc() and inspecting elements within //domain/devices/disk.

dom
  pointer to domain object
disk
  path to the block device, or device shorthand
params
  Pointer to blkio parameter objects
nparams
  Number of blkio parameters (this value can be the same or less than the number of parameters supported)
flags
  bitwise-OR of virDomainModificationImpact
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetBlockThreshold`

    int	virDomainSetBlockThreshold	(virDomainPtr domain,
    					 const char * dev,
    					 unsigned long long threshold,
    					 unsigned int flags)

Set the threshold level for delivering the VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD if the device or backing chain element described by `dev` is written beyond the set threshold level. The threshold level is unset once the event fires. The event might not be delivered at all if libvirtd was not running at the moment when the threshold was reached. Note that if the threshold level is reached for a top level image, the event is emitted for `dev` corresponding to the disk target, and may also be reported with `dev` corresponding to the disk target with an index corresponding to the 'index' attribute of 'source' in the live VM XML if the attribute is present.

`dev` can either be a disk target name (vda, sda) or disk target with index ( vda[4]). Without the index the top image in the backing chain will have the threshold set. The index corresponds to the 'index' attribute reported in the live VM XML for 'backingStore' or 'source' elements of a disk. If index is given the threshold is set for the corresponding image.

In case when `dev` does not contain index the VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD event may be emitted twice, once for the disk device target without index and once containing the index.

Note that the threshold event can be registered also for destinations of a 'virDomainBlockCopy' destination by using the 'index' of the 'mirror' source.

Hypervisors report the last written sector of an image in the bulk stats API (virConnectGetAllDomainStats/virDomainListGetStats) as "block.<num>.allocation" in the VIR_DOMAIN_STATS_BLOCK group. The current threshold value is reported as "block.<num>.threshold".

This event allows to use thin-provisioned storage which needs management tools to grow it without the need for polling of the data.

domain
  pointer to domain object
dev
  string specifying the block device or backing chain element
threshold
  threshold in bytes when to fire the event
flags
  currently unused, callers should pass 0
Returns
  0 if the operation has started, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetGuestVcpus`

    int	virDomainSetGuestVcpus		(virDomainPtr domain,
    					 const char * cpumap,
    					 int state,
    					 unsigned int flags)

Sets state of individual vcpus described by `cpumap` via guest agent. Other vcpus are not modified.

This API requires the VM to run. Various hypervisors or guest agent implementation may limit to operate on just 1 vCPU per call.

`cpumap` is a list of vCPU numbers. Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2'). The '-' denotes the range and the '^' denotes exclusive. The expression is sequentially evaluated, so "0-15,^8" is identical to "9-14,0-7,15" but not identical to "^8,0-15".

Note that OSes (notably Linux) may require vCPU 0 to stay online to support low-level features a S3 sleep.

domain
  pointer to domain object
cpumap
  text representation of a bitmap of vcpus to set
state
  0 to disable/1 to enable cpus described by `cpumap`
flags
  currently unused, callers shall pass 0
Returns
  0 on success, -1 on error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetIOThreadParams`

    int	virDomainSetIOThreadParams	(virDomainPtr domain,
    					 unsigned int iothread_id,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Dynamically set IOThread parameters to the domain. It is left up to the underlying virtual hypervisor to determine the valid range for an `iothread_id`, determining whether the `iothread_id` already exists, and determining the validity of the provided param values.

See VIR_DOMAIN_IOTHREAD_* for detailed description of accepted IOThread parameters.

Since the purpose of this API is to dynamically modify the IOThread `flags` should only include the VIR_DOMAIN_AFFECT_CURRENT and/or VIR_DOMAIN_AFFECT_LIVE virDomainMemoryModFlags. Setting other flags may cause errors from the hypervisor.

Note that this call can fail if the underlying virtualization hypervisor does not support it or does not support setting the provided values.

This function requires privileged access to the hypervisor.

domain
  a domain object
iothread_id
  the specific IOThread ID value to add
params
  pointer to IOThread parameter objects
nparams
  number of IOThread parameters
flags
  bitwise-OR of virDomainModificationImpact and virTypedParameterFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetInterfaceParameters`

    int	virDomainSetInterfaceParameters	(virDomainPtr domain,
    					 const char * device,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Change a subset or all parameters of interface; currently this includes bandwidth parameters. The value of `flags` should be either VIR_DOMAIN_AFFECT_CURRENT, or a bitwise-or of values VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CONFIG, although hypervisors vary in which flags are supported.

This function may require privileged access to the hypervisor.

domain
  pointer to domain object
device
  the interface name or mac address
params
  pointer to interface parameter objects
nparams
  number of interface parameter (this value can be the same or less than the number of parameters supported)
flags
  bitwise-OR of virDomainModificationImpact
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetLaunchSecurityState`

    int	virDomainSetLaunchSecurityState	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Set a launch security secret in the guest's memory. The guest must be in a paused state, e.g. in state VIR_DOMIAN_PAUSED as reported by virDomainGetState. On success, the guest can be transitioned to a running state. On failure, the guest should be destroyed.

A basic guest attestation process can be achieved by: - Start a secure guest in the paused state by passing VIR_DOMAIN_START_PAUSED to one of the virDomainCreate APIs - Retrieve the guest launch measurement with virDomainGetLaunchSecurityInfo - Verify launch measurement and generate a secret for the guest - Set the secret in the guest's memory with virDomainSetLaunchSecurityState - Start running the guest with virDomainResume

See VIR_DOMAIN_LAUNCH_SECURITY_* for a detailed description of accepted launch security parameters.

domain
  a domain object
params
  pointer to launch security parameter objects
nparams
  number of launch security parameters
flags
  currently used, set to 0.
Returns
  -1 in case of failure, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetLifecycleAction`

    int	virDomainSetLifecycleAction	(virDomainPtr domain,
    					 unsigned int type,
    					 unsigned int action,
    					 unsigned int flags)

Changes the actions of lifecycle events for domain represented as <on_$type>$action</on_$type> in the domain XML.

QEMU driver has a limitation that if all lifecycle events are set to destroy when the domain is started, it's not possible to change any action for running domain.

domain
  pointer to domain object
type
  the lifecycle type from virDomainLifecycle
action
  the action type from virDomainLifecycleAction
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 on success, -1 on failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetMaxMemory`

    int	virDomainSetMaxMemory		(virDomainPtr domain,
    					 unsigned long memory)

Dynamically change the maximum amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function may require privileged access to the hypervisor.

This command is hypervisor-specific for whether active, persistent, or both configurations are changed; for more control, use virDomainSetMemoryFlags().

domain
  a domain object or NULL
memory
  the memory size in kibibytes (blocks of 1024 bytes)
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetMemory`

    int	virDomainSetMemory		(virDomainPtr domain,
    					 unsigned long memory)

Dynamically change the target amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function may require privileged access to the hypervisor.

This command is hypervisor-specific for whether active, persistent, or both configurations are changed; for more control, use virDomainSetMemoryFlags().

domain
  a domain object or NULL
memory
  the memory size in kibibytes (blocks of 1024 bytes)
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetMemoryFlags`

    int	virDomainSetMemoryFlags		(virDomainPtr domain,
    					 unsigned long memory,
    					 unsigned int flags)

Dynamically change the target amount of physical memory allocated to a domain. If domain is NULL, then this change the amount of memory reserved to Domain0 i.e. the domain where the application runs. This function may require privileged access to the hypervisor.

`flags` may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG. Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects a running domain and will fail if domain is not active. If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed. If VIR_DOMAIN_MEM_MAXIMUM is set, the change affects domain's maximum memory size rather than current memory size. Not all hypervisors can support all flag combinations.

domain
  a domain object or NULL
memory
  the memory size in kibibytes (blocks of 1024 bytes)
flags
  bitwise-OR of virDomainMemoryModFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetMemoryParameters`

    int	virDomainSetMemoryParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Change all or a subset of the memory tunables. This function may require privileged access to the hypervisor.

Possible values for all *_limit memory tunables are in range from 0 to VIR_DOMAIN_MEMORY_PARAM_UNLIMITED.

domain
  pointer to domain object
params
  pointer to memory parameter objects
nparams
  number of memory parameter (this value can be the same or less than the number of parameters supported)
flags
  bitwise-OR of virDomainModificationImpact
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetMemoryStatsPeriod`

    int	virDomainSetMemoryStatsPeriod	(virDomainPtr domain,
    					 int period,
    					 unsigned int flags)

Dynamically change the domain memory balloon driver statistics collection period. Use 0 to disable and a positive value to enable.

`flags` may include VIR_DOMAIN_AFFECT_LIVE or VIR_DOMAIN_AFFECT_CONFIG. Both flags may be set. If VIR_DOMAIN_AFFECT_LIVE is set, the change affects a running domain and will fail if domain is not active. If VIR_DOMAIN_AFFECT_CONFIG is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed.

Not all hypervisors can support all flag combinations.

domain
  a domain object or NULL
period
  the period in seconds for stats collection
flags
  bitwise-OR of virDomainMemoryModFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetMetadata`

    int	virDomainSetMetadata		(virDomainPtr domain,
    					 int type,
    					 const char * metadata,
    					 const char * key,
    					 const char * uri,
    					 unsigned int flags)

Sets the appropriate domain element given by `type` to the value of `metadata`. A `type` of VIR_DOMAIN_METADATA_DESCRIPTION is free-form text; VIR_DOMAIN_METADATA_TITLE is free-form, but no newlines are permitted, and should be short (although the length is not enforced). For these two options `key` and `uri` are irrelevant and must be set to NULL.

For type VIR_DOMAIN_METADATA_ELEMENT `metadata` must be well-formed XML belonging to namespace defined by `uri` with local name `key`.

Passing NULL for `metadata` says to remove that element from the domain XML (passing the empty string leaves the element present).

The resulting metadata will be present in virDomainGetXMLDesc(), as well as quick access through virDomainGetMetadata().

`flags` controls whether the live domain, persistent configuration, or both will be modified.

domain
  a domain object
type
  type of metadata, from virDomainMetadataType
metadata
  new metadata text
key
  XML namespace key, or NULL
uri
  XML namespace URI, or NULL
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 on success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetNumaParameters`

    int	virDomainSetNumaParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Change all or a subset of the numa tunables. This function may require privileged access to the hypervisor.

Changing live configuration may be possible only in some cases. For instance, for QEMU driver the mode (VIR_DOMAIN_NUMA_MODE) can not be changed, and changing the nodeset (VIR_DOMAIN_NUMA_NODESET) is possible only for VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE mode.

Changing persistent configuration does not pose such limitations.

domain
  pointer to domain object
params
  pointer to numa parameter objects
nparams
  number of numa parameters (this value can be the same or less than the number of parameters supported)
flags
  bitwise-OR of virDomainModificationImpact
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetPerfEvents`

    int	virDomainSetPerfEvents		(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams,
    					 unsigned int flags)

Enable or disable the particular list of Linux perf events you care about. The `params` argument should contain any subset of VIR_PERF_EVENT_ macros.

Linux perf events are performance analyzing tool in Linux.

domain
  a domain object
params
  pointer to perf events parameter object
nparams
  number of perf event parameters (this value can be the same less than the number of parameters supported)
flags
  bitwise-OR of virDomainModificationImpact
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetSchedulerParameters`

    int	virDomainSetSchedulerParameters	(virDomainPtr domain,
    					 virTypedParameterPtr params,
    					 int nparams)

Change all or a subset or the scheduler parameters. It is hypervisor-specific whether this sets live, persistent, or both settings; for more control, use virDomainSetSchedulerParametersFlags.

domain
  pointer to domain object
params
  pointer to scheduler parameter objects
nparams
  number of scheduler parameter objects (this value can be the same or less than the returned value nparams of virDomainGetSchedulerType)
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | read | -

### `virDomainSetSchedulerParametersFlags`

    int	virDomainSetSchedulerParametersFlags	(virDomainPtr domain,
    						 virTypedParameterPtr params,
    						 int nparams,
    						 unsigned int flags)

Change a subset or all scheduler parameters. The value of `flags` should be either VIR_DOMAIN_AFFECT_CURRENT, or a bitwise-or of values from VIR_DOMAIN_AFFECT_LIVE and VIR_DOMAIN_AFFECT_CURRENT, although hypervisors vary in which flags are supported.

domain
  pointer to domain object
params
  pointer to scheduler parameter objects
nparams
  number of scheduler parameter objects (this value can be the same or less than the returned value nparams of virDomainGetSchedulerType)
flags
  bitwise-OR of virDomainModificationImpact
Returns
  -1 in case of error, 0 in case of success.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetTime`

    int	virDomainSetTime		(virDomainPtr dom,
    					 long long seconds,
    					 unsigned int nseconds,
    					 unsigned int flags)

When a domain is suspended or restored from a file the domain's OS has no idea that there was a big gap in the time. Depending on how long the gap was, NTP might not be able to resynchronize the guest.

This API tries to set guest time to the given value. The time to set (`seconds` and `nseconds`) should be in seconds relative to the Epoch of 1970-01-01 00:00:00 in UTC.

Please note that some hypervisors may require guest agent to be configured and running in order to be able to run this API.

dom
  a domain object
seconds
  time to set
nseconds
  the nanosecond part of `seconds`
flags
  bitwise-OR of virDomainSetTimeFlags
Returns
  0 on success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | set-time | -

### `virDomainSetUserPassword`

    int	virDomainSetUserPassword	(virDomainPtr dom,
    					 const char * user,
    					 const char * password,
    					 unsigned int flags)

Sets the `user` password to the value specified by `password`. If `flags` contain VIR_DOMAIN_PASSWORD_ENCRYPTED, the password is assumed to be encrypted by the method required by the guest OS.

Please note that some hypervisors may require guest agent to be configured and running in order to be able to run this API.

dom
  a domain object
user
  the username that will get a new password
password
  the password to set
flags
  bitwise-OR of virDomainSetUserPasswordFlags
Returns
  0 on success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | set-password | -

### `virDomainSetVcpu`

    int	virDomainSetVcpu		(virDomainPtr domain,
    					 const char * vcpumap,
    					 int state,
    					 unsigned int flags)

Enables/disables individual vcpus described by `vcpumap` in the hypervisor.

Various hypervisor implementations may limit to operate on just 1 hotpluggable entity (which may contain multiple vCPUs on certain platforms).

Note that OSes and hypervisors may require vCPU 0 to stay online.

domain
  pointer to domain object
vcpumap
  text representation of a bitmap of vcpus to set
state
  0 to disable/1 to enable cpus described by `vcpumap`
flags
  bitwise-OR of virDomainModificationImpact
Returns
  0 on success, -1 on error.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG

### `virDomainSetVcpus`

    int	virDomainSetVcpus		(virDomainPtr domain,
    					 unsigned int nvcpus)

Dynamically change the number of virtual CPUs used by the domain. Note that this call may fail if the underlying virtualization hypervisor does not support it or if growing the number is arbitrarily limited. This function may require privileged access to the hypervisor.

Note that if this call is executed before the guest has finished booting, the guest may fail to process the change.

This command only changes the runtime configuration of the domain, so can only be called on an active domain. It is hypervisor-dependent whether it also affects persistent configuration; for more control, use virDomainSetVcpusFlags().

domain
  pointer to domain object, or NULL for Domain0
nvcpus
  the new number of virtual CPUs for this domain
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainSetVcpusFlags`

    int	virDomainSetVcpusFlags		(virDomainPtr domain,
    					 unsigned int nvcpus,
    					 unsigned int flags)

Dynamically change the number of virtual CPUs used by the domain. Note that this call may fail if the underlying virtualization hypervisor does not support it or if growing the number is arbitrarily limited. This function may require privileged access to the hypervisor.

`flags` may include VIR_DOMAIN_AFFECT_LIVE to affect a running domain (which may fail if domain is not active), or VIR_DOMAIN_AFFECT_CONFIG to affect the next boot via the XML description of the domain. Both flags may be set. If neither flag is specified (that is, `flags` is VIR_DOMAIN_AFFECT_CURRENT), then an inactive domain modifies persistent setup, while an active domain is hypervisor-dependent on whether just live or both live and persistent state is changed.

Note that if this call is executed before the guest has finished booting, the guest may fail to process the change.

If `flags` includes VIR_DOMAIN_VCPU_MAXIMUM, then VIR_DOMAIN_AFFECT_LIVE must be clear, and only the maximum virtual CPU limit is altered; generally, this value must be less than or equal to virConnectGetMaxVcpus(). Otherwise, this call affects the current virtual CPU limit, which must be less than or equal to the maximum limit. Note that hypervisors may not allow changing the maximum vcpu count if processor topology is specified.

If `flags` includes VIR_DOMAIN_VCPU_GUEST, then the state of processors is modified inside the guest instead of the hypervisor. This flag can only be used with live guests and is incompatible with VIR_DOMAIN_VCPU_MAXIMUM. The usage of this flag may require a guest agent configured.

Not all hypervisors can support all flag combinations.

domain
  pointer to domain object, or NULL for Domain0
nvcpus
  the new number of virtual CPUs for this domain, must be at least 1
flags
  bitwise-OR of virDomainVcpuFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG
domain | write | VIR_DOMAIN_VCPU_GUEST

### `virDomainShutdown`

    int	virDomainShutdown		(virDomainPtr domain)

Shutdown a domain, the domain object is still usable thereafter, but the domain OS is being stopped. Note that the guest OS may ignore the request. Additionally, the hypervisor may check and support the domain 'on_poweroff' XML setting resulting in a domain that reboots instead of shutting down. For guests that react to a shutdown request, the differences from virDomainDestroy() are that the guests disk storage will be in a stable state rather than having the (virtual) power cord pulled, and this command returns as soon as the shutdown request is issued rather than blocking until the guest is no longer running.

If the domain is transient and has any snapshot metadata (see virDomainSnapshotNum()), then that metadata will automatically be deleted when the domain quits.

domain
  a domain object
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | init-control | -

### `virDomainShutdownFlags`

    int	virDomainShutdownFlags		(virDomainPtr domain,
    					 unsigned int flags)

Shutdown a domain, the domain object is still usable thereafter but the domain OS is being stopped. Note that the guest OS may ignore the request. Additionally, the hypervisor may check and support the domain 'on_poweroff' XML setting resulting in a domain that reboots instead of shutting down. For guests that react to a shutdown request, the differences from virDomainDestroy() are that the guest's disk storage will be in a stable state rather than having the (virtual) power cord pulled, and this command returns as soon as the shutdown request is issued rather than blocking until the guest is no longer running.

If the domain is transient and has any snapshot metadata (see virDomainSnapshotNum()), then that metadata will automatically be deleted when the domain quits.

If `flags` is set to zero, then the hypervisor will choose the method of shutdown it considers best. To have greater control pass one or more of the virDomainShutdownFlagValues. The order in which the hypervisor tries each shutdown method is undefined, and a hypervisor is not required to support all methods.

To use guest agent (VIR_DOMAIN_SHUTDOWN_GUEST_AGENT) the domain XML must have <channel> configured.

domain
  a domain object
flags
  bitwise-OR of virDomainShutdownFlagValues
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | init-control | -
domain | write | VIR_DOMAIN_SHUTDOWN_GUEST_AGENT

### `virDomainStartDirtyRateCalc`

    int	virDomainStartDirtyRateCalc	(virDomainPtr domain,
    					 int seconds,
    					 unsigned int flags)

Calculate the current domain's memory dirty rate in next `seconds`. The calculated dirty rate information is available by calling virConnectGetAllDomainStats.

domain
  a domain object
seconds
  specified calculating time in seconds
flags
  bitwise-OR of supported virDomainDirtyRateCalcFlags
Returns
  0 in case of success, -1 otherwise.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -

### `virDomainStatsRecordListFree`

    void	virDomainStatsRecordListFree	(virDomainStatsRecordPtr * stats)

Convenience function to free a list of domain stats returned by virDomainListGetStats and virConnectGetAllDomainStats.

stats
  NULL terminated array of virDomainStatsRecords to free

### `virDomainSuspend`

    int	virDomainSuspend		(virDomainPtr domain)

Suspends an active domain, the process is frozen without further access to CPU resources and I/O but the memory used by the domain at the hypervisor level will stay allocated. Use virDomainResume() to reactivate the domain. This function may require privileged access. Moreover, suspend may not be supported if domain is in some special state like VIR_DOMAIN_PMSUSPENDED.

domain
  a domain object
Returns
  0 in case of success and -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | suspend | -

### `virDomainUndefine`

    int	virDomainUndefine		(virDomainPtr domain)

Undefine a domain. If the domain is running, it's converted to transient domain, without stopping it. If the domain is inactive, the domain configuration is removed.

If the domain has a managed save image (see virDomainHasManagedSaveImage()), or if it is inactive and has any snapshot metadata (see virDomainSnapshotNum()) or checkpoint metadata (see virDomainListAllCheckpoints()), then the undefine will fail. See virDomainUndefineFlags() for more control.

domain
  pointer to a defined domain
Returns
  0 in case of success, -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | delete | -

### `virDomainUndefineFlags`

    int	virDomainUndefineFlags		(virDomainPtr domain,
    					 unsigned int flags)

Undefine a domain. If the domain is running, it's converted to transient domain, without stopping it. If the domain is inactive, the domain configuration is removed.

If the domain has a managed save image (see virDomainHasManagedSaveImage()), then including VIR_DOMAIN_UNDEFINE_MANAGED_SAVE in `flags` will also remove that file, and omitting the flag will cause the undefine process to fail.

If the domain is inactive and has any snapshot metadata (see virDomainSnapshotNum()), then including VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA in `flags` will also remove that metadata. Omitting the flag will cause the undefine of an inactive domain with snapshots to fail. Active domains will retain snapshot metadata until the (now-transient) domain halts, regardless of whether this flag is present. On hypervisors that support snapshots, but where snapshots do not use libvirt metadata, this flag has no effect.

If the domain is inactive and has any checkpoint metadata (see virDomainListAllCheckpoints()), then including VIR_DOMAIN_UNDEFINE_CHECKPOINTS_METADATA in `flags` will also remove that metadata. Omitting the flag will cause the undefine of an inactive domain with checkpoints to fail. Active domains will retain checkpoint metadata until the (now-transient) domain halts, regardless of whether this flag is present. On hypervisors that support checkpoints, but where checkpoints do not use libvirt metadata, this flag has no effect.

If the domain has any nvram specified, the undefine process will fail unless VIR_DOMAIN_UNDEFINE_KEEP_NVRAM is specified, or if VIR_DOMAIN_UNDEFINE_NVRAM is specified to remove the nvram file.

domain
  pointer to a defined domain
flags
  bitwise-OR of supported virDomainUndefineFlagsValues
Returns
  0 in case of success, -1 in case of error

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | delete | -

### `virDomainUpdateDeviceFlags`

    int	virDomainUpdateDeviceFlags	(virDomainPtr domain,
    					 const char * xml,
    					 unsigned int flags)

Change a virtual device on a domain, using the flags parameter to control how the device is changed. VIR_DOMAIN_AFFECT_CURRENT specifies that the device change is made based on current domain state. VIR_DOMAIN_AFFECT_LIVE specifies that the device shall be changed on the active domain instance only and is not added to the persisted domain configuration. VIR_DOMAIN_AFFECT_CONFIG specifies that the device shall be changed on the persisted domain configuration only. Note that the target hypervisor must return an error if unable to satisfy flags. E.g. the hypervisor driver will return failure if LIVE is specified but it only supports modifying the persisted device allocation.

This method is used for actions such changing CDROM/Floppy device media, altering the graphics configuration such as password, reconfiguring the NIC device backend connectivity, etc.

The supplied XML description of the device should contain all the information that is found in the corresponding domain XML. Leaving out any piece of information may be treated as a request for its removal, which may be denied. For instance, when users want to change CDROM media only for live XML, they must provide live disk XML as found in the corresponding live domain XML with only the disk path changed.

domain
  pointer to domain object
xml
  pointer to XML description of one device
flags
  bitwise-OR of virDomainDeviceModifyFlags
Returns
  0 in case of success, -1 in case of failure.

##### Access control parameter checks

Object | Permission | Condition
--- | --- | ---
domain | write | -
domain | save | !VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE
domain | save | VIR_DOMAIN_AFFECT_CONFIG