~serge-hallyn/ubuntu/raring/libvirt/libvirt-hugepages

« back to all changes in this revision

Viewing changes to docs/html/libvirt-libvirt.html

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-13 15:44:12 UTC
  • mfrom: (1.2.13)
  • Revision ID: package-import@ubuntu.com-20120513154412-fgmn5sxqdzgnzlx3
Tags: 0.9.12-0ubuntu1
* New upstream version:
  * Synchronize with debian packaging:
    - debian/control: Update build depends.
    - debian/libvirt-bin.postrm: Cleanup /var/log/libvirt
      on purge.
    - Bump standards verson (no changes).
    - debian/patches/Don-t-fail-if-we-can-t-setup-avahi.patch: Added
  * Dropped patches:
    - debian/patches/Debianize-libvirt-guests.patch
    - debian/patches/rewrite-lxc-controller-eof-handling-yet-again
    - debian/patches/ubuntu/libnl13.patch
    - debian/patches/ubuntu/fix-lxc-startup-error.patch
    - debian/patches/ubuntu/fix-bridge-fd.patch
    - debian/patches/ubuntu/skip-labelling-network-disks.patch
    - debian/patches/ubuntu/xen-xend-shutdown-detection.patch
    - debian/patches/ubuntu/xen-config-no-vfb-for-hvm.patch
    - debian/patches/debian/Disable-daemon-start-test.patch
    - debian/patches/debian/Disable-gnulib-s-test-nonplocking-pipe.sh.patch
    - debian/patches/ubuntu/9006-default-config-test-case.patch
    - debian/patches/fix-block-migration.patch
    - debian/patches/ubuntu/9022-qemu-unescape-HMP-commands-before-converting-them-to.patch
    - debian/patches/ubuntu/9023-qemu-change-rbd-auth_supported-separation-character-.patch
    - debian/patches/ubuntu/9024-qemu-allow-snapshotting-of-sheepdog-and-rbd-disks.patch
    - debian/patches/9025-qemu-change-rbd-auth_supported-separation-character-.patch
    - debian/patches/ubuntu/arm-gcc-workaround.patch
  * Rediffed:
    - debian/patches/Allow-libvirt-group-to-access-the-socket.patch
    - debian/patches/Disable-failing-virnetsockettest.patch
    - debian/patches/dnsmasq-as-priv-user
    - debian/patches/9002-better_default_uri_virsh.patch
  * debian/control: Add libnl-route-3-dev ass a build depends.
  * debian/patches/libnl3-build-fix.patch: Fix build with libnl3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#define <a href="#VIR_COPY_CPUMAP">VIR_COPY_CPUMAP</a>
8
8
#define <a href="#VIR_CPU_MAPLEN">VIR_CPU_MAPLEN</a>
9
9
#define <a href="#VIR_CPU_USABLE">VIR_CPU_USABLE</a>
 
10
#define <a href="#VIR_DOMAIN_BANDWIDTH_IN_AVERAGE">VIR_DOMAIN_BANDWIDTH_IN_AVERAGE</a>
 
11
#define <a href="#VIR_DOMAIN_BANDWIDTH_IN_BURST">VIR_DOMAIN_BANDWIDTH_IN_BURST</a>
 
12
#define <a href="#VIR_DOMAIN_BANDWIDTH_IN_PEAK">VIR_DOMAIN_BANDWIDTH_IN_PEAK</a>
 
13
#define <a href="#VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE">VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE</a>
 
14
#define <a href="#VIR_DOMAIN_BANDWIDTH_OUT_BURST">VIR_DOMAIN_BANDWIDTH_OUT_BURST</a>
 
15
#define <a href="#VIR_DOMAIN_BANDWIDTH_OUT_PEAK">VIR_DOMAIN_BANDWIDTH_OUT_PEAK</a>
10
16
#define <a href="#VIR_DOMAIN_BLKIO_DEVICE_WEIGHT">VIR_DOMAIN_BLKIO_DEVICE_WEIGHT</a>
11
17
#define <a href="#VIR_DOMAIN_BLKIO_FIELD_LENGTH">VIR_DOMAIN_BLKIO_FIELD_LENGTH</a>
12
18
#define <a href="#VIR_DOMAIN_BLKIO_WEIGHT">VIR_DOMAIN_BLKIO_WEIGHT</a>
26
32
#define <a href="#VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES">VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES</a>
27
33
#define <a href="#VIR_DOMAIN_BLOCK_STATS_WRITE_REQ">VIR_DOMAIN_BLOCK_STATS_WRITE_REQ</a>
28
34
#define <a href="#VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES">VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES</a>
 
35
#define <a href="#VIR_DOMAIN_CPU_STATS_CPUTIME">VIR_DOMAIN_CPU_STATS_CPUTIME</a>
 
36
#define <a href="#VIR_DOMAIN_CPU_STATS_SYSTEMTIME">VIR_DOMAIN_CPU_STATS_SYSTEMTIME</a>
 
37
#define <a href="#VIR_DOMAIN_CPU_STATS_USERTIME">VIR_DOMAIN_CPU_STATS_USERTIME</a>
29
38
#define <a href="#VIR_DOMAIN_EVENT_CALLBACK">VIR_DOMAIN_EVENT_CALLBACK</a>
30
39
#define <a href="#VIR_DOMAIN_MEMORY_FIELD_LENGTH">VIR_DOMAIN_MEMORY_FIELD_LENGTH</a>
31
40
#define <a href="#VIR_DOMAIN_MEMORY_HARD_LIMIT">VIR_DOMAIN_MEMORY_HARD_LIMIT</a>
33
42
#define <a href="#VIR_DOMAIN_MEMORY_PARAM_UNLIMITED">VIR_DOMAIN_MEMORY_PARAM_UNLIMITED</a>
34
43
#define <a href="#VIR_DOMAIN_MEMORY_SOFT_LIMIT">VIR_DOMAIN_MEMORY_SOFT_LIMIT</a>
35
44
#define <a href="#VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT">VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT</a>
 
45
#define <a href="#VIR_DOMAIN_NUMA_MODE">VIR_DOMAIN_NUMA_MODE</a>
 
46
#define <a href="#VIR_DOMAIN_NUMA_NODESET">VIR_DOMAIN_NUMA_NODESET</a>
36
47
#define <a href="#VIR_DOMAIN_SCHEDULER_CAP">VIR_DOMAIN_SCHEDULER_CAP</a>
37
48
#define <a href="#VIR_DOMAIN_SCHEDULER_CPU_SHARES">VIR_DOMAIN_SCHEDULER_CPU_SHARES</a>
38
49
#define <a href="#VIR_DOMAIN_SCHEDULER_LIMIT">VIR_DOMAIN_SCHEDULER_LIMIT</a>
84
95
typedef struct _virDomain <a href="#virDomain">virDomain</a>
85
96
typedef struct _virDomainBlockInfo <a href="#virDomainBlockInfo">virDomainBlockInfo</a>
86
97
typedef <a href="libvirt-libvirt.html#virDomainBlockInfo">virDomainBlockInfo</a> * <a name="virDomainBlockInfoPtr" id="virDomainBlockInfoPtr">virDomainBlockInfoPtr</a>
 
98
typedef enum <a href="#virDomainBlockJobAbortFlags">virDomainBlockJobAbortFlags</a>
87
99
typedef unsigned long long <a name="virDomainBlockJobCursor" id="virDomainBlockJobCursor">virDomainBlockJobCursor</a>
88
100
typedef struct _virDomainBlockJobInfo <a href="#virDomainBlockJobInfo">virDomainBlockJobInfo</a>
89
101
typedef <a href="libvirt-libvirt.html#virDomainBlockJobInfo">virDomainBlockJobInfo</a> * <a name="virDomainBlockJobInfoPtr" id="virDomainBlockJobInfoPtr">virDomainBlockJobInfoPtr</a>
90
102
typedef enum <a href="#virDomainBlockJobType">virDomainBlockJobType</a>
 
103
typedef enum <a href="#virDomainBlockRebaseFlags">virDomainBlockRebaseFlags</a>
 
104
typedef enum <a href="#virDomainBlockResizeFlags">virDomainBlockResizeFlags</a>
91
105
typedef <a href="libvirt-libvirt.html#virDomainBlockStatsStruct">virDomainBlockStatsStruct</a> * <a name="virDomainBlockStatsPtr" id="virDomainBlockStatsPtr">virDomainBlockStatsPtr</a>
92
106
typedef struct _virDomainBlockStats <a href="#virDomainBlockStatsStruct">virDomainBlockStatsStruct</a>
93
107
typedef enum <a href="#virDomainBlockedReason">virDomainBlockedReason</a>
 
108
typedef enum <a href="#virDomainConsoleFlags">virDomainConsoleFlags</a>
94
109
typedef struct _virDomainControlInfo <a href="#virDomainControlInfo">virDomainControlInfo</a>
95
110
typedef <a href="libvirt-libvirt.html#virDomainControlInfo">virDomainControlInfo</a> * <a name="virDomainControlInfoPtr" id="virDomainControlInfoPtr">virDomainControlInfoPtr</a>
96
111
typedef enum <a href="#virDomainControlState">virDomainControlState</a>
97
112
typedef enum <a href="#virDomainCoreDumpFlags">virDomainCoreDumpFlags</a>
98
113
typedef enum <a href="#virDomainCrashedReason">virDomainCrashedReason</a>
99
114
typedef enum <a href="#virDomainCreateFlags">virDomainCreateFlags</a>
 
115
typedef enum <a href="#virDomainDestroyFlagsValues">virDomainDestroyFlagsValues</a>
100
116
typedef enum <a href="#virDomainDeviceModifyFlags">virDomainDeviceModifyFlags</a>
 
117
typedef struct _virDomainDiskError <a href="#virDomainDiskError">virDomainDiskError</a>
 
118
typedef enum <a href="#virDomainDiskErrorCode">virDomainDiskErrorCode</a>
 
119
typedef <a href="libvirt-libvirt.html#virDomainDiskError">virDomainDiskError</a> * <a name="virDomainDiskErrorPtr" id="virDomainDiskErrorPtr">virDomainDiskErrorPtr</a>
101
120
typedef enum <a href="#virDomainEventDefinedDetailType">virDomainEventDefinedDetailType</a>
102
121
typedef struct _virDomainEventGraphicsAddress <a href="#virDomainEventGraphicsAddress">virDomainEventGraphicsAddress</a>
103
122
typedef <a href="libvirt-libvirt.html#virDomainEventGraphicsAddress">virDomainEventGraphicsAddress</a> * <a name="virDomainEventGraphicsAddressPtr" id="virDomainEventGraphicsAddressPtr">virDomainEventGraphicsAddressPtr</a>
114
133
typedef enum <a href="#virDomainEventStartedDetailType">virDomainEventStartedDetailType</a>
115
134
typedef enum <a href="#virDomainEventStoppedDetailType">virDomainEventStoppedDetailType</a>
116
135
typedef enum <a href="#virDomainEventSuspendedDetailType">virDomainEventSuspendedDetailType</a>
 
136
typedef enum <a href="#virDomainEventTrayChangeReason">virDomainEventTrayChangeReason</a>
117
137
typedef enum <a href="#virDomainEventType">virDomainEventType</a>
118
138
typedef enum <a href="#virDomainEventUndefinedDetailType">virDomainEventUndefinedDetailType</a>
119
139
typedef enum <a href="#virDomainEventWatchdogAction">virDomainEventWatchdogAction</a>
129
149
typedef <a href="libvirt-libvirt.html#virDomainMemoryStatStruct">virDomainMemoryStatStruct</a> * <a name="virDomainMemoryStatPtr" id="virDomainMemoryStatPtr">virDomainMemoryStatPtr</a>
130
150
typedef struct _virDomainMemoryStat <a href="#virDomainMemoryStatStruct">virDomainMemoryStatStruct</a>
131
151
typedef enum <a href="#virDomainMemoryStatTags">virDomainMemoryStatTags</a>
 
152
typedef enum <a href="#virDomainMetadataType">virDomainMetadataType</a>
132
153
typedef enum <a href="#virDomainMigrateFlags">virDomainMigrateFlags</a>
133
154
typedef enum <a href="#virDomainModificationImpact">virDomainModificationImpact</a>
134
155
typedef enum <a href="#virDomainNostateReason">virDomainNostateReason</a>
 
156
typedef enum <a href="#virDomainNumatuneMemMode">virDomainNumatuneMemMode</a>
135
157
typedef enum <a href="#virDomainOpenGraphicsFlags">virDomainOpenGraphicsFlags</a>
 
158
typedef enum <a href="#virDomainPMSuspendedReason">virDomainPMSuspendedReason</a>
136
159
typedef enum <a href="#virDomainPausedReason">virDomainPausedReason</a>
137
160
typedef <a href="libvirt-libvirt.html#virDomain">virDomain</a> * <a name="virDomainPtr" id="virDomainPtr">virDomainPtr</a>
 
161
typedef enum <a href="#virDomainRebootFlagValues">virDomainRebootFlagValues</a>
138
162
typedef enum <a href="#virDomainRunningReason">virDomainRunningReason</a>
139
163
typedef enum <a href="#virDomainSaveRestoreFlags">virDomainSaveRestoreFlags</a>
 
164
typedef enum <a href="#virDomainShutdownFlagValues">virDomainShutdownFlagValues</a>
140
165
typedef enum <a href="#virDomainShutdownReason">virDomainShutdownReason</a>
141
166
typedef enum <a href="#virDomainShutoffReason">virDomainShutoffReason</a>
142
167
typedef struct _virDomainSnapshot <a href="#virDomainSnapshot">virDomainSnapshot</a>
161
186
typedef <a href="libvirt-libvirt.html#virNWFilter">virNWFilter</a> * <a name="virNWFilterPtr" id="virNWFilterPtr">virNWFilterPtr</a>
162
187
typedef struct _virNetwork <a href="#virNetwork">virNetwork</a>
163
188
typedef <a href="libvirt-libvirt.html#virNetwork">virNetwork</a> * <a name="virNetworkPtr" id="virNetworkPtr">virNetworkPtr</a>
 
189
typedef enum <a href="#virNetworkXMLFlags">virNetworkXMLFlags</a>
164
190
typedef struct _virNodeCPUStats <a href="#virNodeCPUStats">virNodeCPUStats</a>
165
191
typedef <a href="libvirt-libvirt.html#virNodeCPUStats">virNodeCPUStats</a> * <a name="virNodeCPUStatsPtr" id="virNodeCPUStatsPtr">virNodeCPUStatsPtr</a>
166
192
typedef struct _virNodeDevice <a href="#virNodeDevice">virNodeDevice</a>
194
220
typedef struct _virStorageVolInfo <a href="#virStorageVolInfo">virStorageVolInfo</a>
195
221
typedef <a href="libvirt-libvirt.html#virStorageVolInfo">virStorageVolInfo</a> * <a name="virStorageVolInfoPtr" id="virStorageVolInfoPtr">virStorageVolInfoPtr</a>
196
222
typedef <a href="libvirt-libvirt.html#virStorageVol">virStorageVol</a> * <a name="virStorageVolPtr" id="virStorageVolPtr">virStorageVolPtr</a>
 
223
typedef enum <a href="#virStorageVolResizeFlags">virStorageVolResizeFlags</a>
197
224
typedef enum <a href="#virStorageVolType">virStorageVolType</a>
 
225
typedef enum <a href="#virStorageVolWipeAlgorithm">virStorageVolWipeAlgorithm</a>
198
226
typedef struct _virStream <a href="#virStream">virStream</a>
199
227
typedef enum <a href="#virStreamEventType">virStreamEventType</a>
200
228
typedef enum <a href="#virStreamFlags">virStreamFlags</a>
235
263
typedef <a href="#virConnectDomainEventIOErrorReasonCallback">virConnectDomainEventIOErrorReasonCallback</a>
236
264
void    <a href="#virConnectDomainEventIOErrorReasonCallback">virConnectDomainEventIOErrorReasonCallback</a>    (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                        const char * srcPath, <br />                                                    const char * devAlias, <br />                                                   int action, <br />                                                      const char * reason, <br />                                                     void * opaque)
237
265
 
 
266
typedef <a href="#virConnectDomainEventPMSuspendCallback">virConnectDomainEventPMSuspendCallback</a>
 
267
void    <a href="#virConnectDomainEventPMSuspendCallback">virConnectDomainEventPMSuspendCallback</a>    (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int reason, <br />                                              void * opaque)
 
268
 
 
269
typedef <a href="#virConnectDomainEventPMWakeupCallback">virConnectDomainEventPMWakeupCallback</a>
 
270
void    <a href="#virConnectDomainEventPMWakeupCallback">virConnectDomainEventPMWakeupCallback</a>      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int reason, <br />                                              void * opaque)
 
271
 
238
272
typedef <a href="#virConnectDomainEventRTCChangeCallback">virConnectDomainEventRTCChangeCallback</a>
239
273
void    <a href="#virConnectDomainEventRTCChangeCallback">virConnectDomainEventRTCChangeCallback</a>    (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                long long utcoffset, <br />                                             void * opaque)
240
274
 
241
275
int     <a href="#virConnectDomainEventRegister">virConnectDomainEventRegister</a>      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb, <br />                                       void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> freecb)
242
276
int     <a href="#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int eventID, <br />                                             <a href="libvirt-libvirt.html#virConnectDomainEventGenericCallback">virConnectDomainEventGenericCallback</a> cb, <br />                                                 void * opaque, <br />                                           <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> freecb)
 
277
typedef <a href="#virConnectDomainEventTrayChangeCallback">virConnectDomainEventTrayChangeCallback</a>
 
278
void    <a href="#virConnectDomainEventTrayChangeCallback">virConnectDomainEventTrayChangeCallback</a>  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                const char * devAlias, <br />                                           int reason, <br />                                              void * opaque)
 
279
 
243
280
typedef <a href="#virConnectDomainEventWatchdogCallback">virConnectDomainEventWatchdogCallback</a>
244
281
void    <a href="#virConnectDomainEventWatchdogCallback">virConnectDomainEventWatchdogCallback</a>      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int action, <br />                                              void * opaque)
245
282
 
289
326
int     <a href="#virDomainBlockJobSetSpeed">virDomainBlockJobSetSpeed</a>      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)
290
327
int     <a href="#virDomainBlockPeek">virDomainBlockPeek</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long long offset, <br />                                       size_t size, <br />                                     void * buffer, <br />                                   unsigned int flags)
291
328
int     <a href="#virDomainBlockPull">virDomainBlockPull</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)
 
329
int     <a href="#virDomainBlockRebase">virDomainBlockRebase</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       const char * base, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)
292
330
int     <a href="#virDomainBlockResize">virDomainBlockResize</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long long size, <br />                                         unsigned int flags)
293
331
int     <a href="#virDomainBlockStats">virDomainBlockStats</a>          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a> stats, <br />                                  size_t size)
294
332
int     <a href="#virDomainBlockStatsFlags">virDomainBlockStatsFlags</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)
308
346
int     <a href="#virDomainGetBlockInfo">virDomainGetBlockInfo</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockInfoPtr">virDomainBlockInfoPtr</a> info, <br />                                     unsigned int flags)
309
347
int     <a href="#virDomainGetBlockIoTune">virDomainGetBlockIoTune</a>          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)
310
348
int     <a href="#virDomainGetBlockJobInfo">virDomainGetBlockJobInfo</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockJobInfoPtr">virDomainBlockJobInfoPtr</a> info, <br />                                       unsigned int flags)
 
349
int     <a href="#virDomainGetCPUStats">virDomainGetCPUStats</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     unsigned int nparams, <br />                                    int start_cpu, <br />                                   unsigned int ncpus, <br />                                      unsigned int flags)
311
350
<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>  <a href="#virDomainGetConnect">virDomainGetConnect</a>  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)
312
351
int     <a href="#virDomainGetControlInfo">virDomainGetControlInfo</a>          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virDomainControlInfoPtr">virDomainControlInfoPtr</a> info, <br />                                         unsigned int flags)
 
352
int     <a href="#virDomainGetDiskErrors">virDomainGetDiskErrors</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        <a href="libvirt-libvirt.html#virDomainDiskErrorPtr">virDomainDiskErrorPtr</a> errors, <br />                                   unsigned int maxerrors, <br />                                  unsigned int flags)
313
353
unsigned int    <a href="#virDomainGetID">virDomainGetID</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
314
354
int     <a href="#virDomainGetInfo">virDomainGetInfo</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virDomainInfoPtr">virDomainInfoPtr</a> info)
 
355
int     <a href="#virDomainGetInterfaceParameters">virDomainGetInterfaceParameters</a>  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * device, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)
315
356
int     <a href="#virDomainGetJobInfo">virDomainGetJobInfo</a>          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virDomainJobInfoPtr">virDomainJobInfoPtr</a> info)
316
357
unsigned long   <a href="#virDomainGetMaxMemory">virDomainGetMaxMemory</a>      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
317
358
int     <a href="#virDomainGetMaxVcpus">virDomainGetMaxVcpus</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
318
359
int     <a href="#virDomainGetMemoryParameters">virDomainGetMemoryParameters</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)
 
360
char *  <a href="#virDomainGetMetadata">virDomainGetMetadata</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int type, <br />                                        const char * uri, <br />                                        unsigned int flags)
319
361
const char *    <a href="#virDomainGetName">virDomainGetName</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
 
362
int     <a href="#virDomainGetNumaParameters">virDomainGetNumaParameters</a>    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)
320
363
char *  <a href="#virDomainGetOSType">virDomainGetOSType</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
321
364
int     <a href="#virDomainGetSchedulerParameters">virDomainGetSchedulerParameters</a>  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams)
322
365
int     <a href="#virDomainGetSchedulerParametersFlags">virDomainGetSchedulerParametersFlags</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                             <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                             int * nparams, <br />                                           unsigned int flags)
353
396
int     <a href="#virDomainMigrateToURI2">virDomainMigrateToURI2</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * dconnuri, <br />                                   const char * miguri, <br />                                     const char * dxml, <br />                                       unsigned long flags, <br />                                     const char * dname, <br />                                      unsigned long bandwidth)
354
397
int     <a href="#virDomainOpenConsole">virDomainOpenConsole</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * dev_name, <br />                                   <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> st, <br />                                         unsigned int flags)
355
398
int     <a href="#virDomainOpenGraphics">virDomainOpenGraphics</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int idx, <br />                                        int fd, <br />                                  unsigned int flags)
 
399
int     <a href="#virDomainPMSuspendForDuration">virDomainPMSuspendForDuration</a>      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int target, <br />                                     unsigned long long duration, <br />                                     unsigned int flags)
 
400
int     <a href="#virDomainPMWakeup">virDomainPMWakeup</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int flags)
356
401
int     <a href="#virDomainPinVcpu">virDomainPinVcpu</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int vcpu, <br />                                       unsigned char * cpumap, <br />                                  int maplen)
357
402
int     <a href="#virDomainPinVcpuFlags">virDomainPinVcpuFlags</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int vcpu, <br />                                       unsigned char * cpumap, <br />                                  int maplen, <br />                                      unsigned int flags)
358
403
int     <a href="#virDomainReboot">virDomainReboot</a>                  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)
371
416
int     <a href="#virDomainSetAutostart">virDomainSetAutostart</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int autostart)
372
417
int     <a href="#virDomainSetBlkioParameters">virDomainSetBlkioParameters</a>  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)
373
418
int     <a href="#virDomainSetBlockIoTune">virDomainSetBlockIoTune</a>          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)
 
419
int     <a href="#virDomainSetInterfaceParameters">virDomainSetInterfaceParameters</a>  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * device, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)
374
420
int     <a href="#virDomainSetMaxMemory">virDomainSetMaxMemory</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)
375
421
int     <a href="#virDomainSetMemory">virDomainSetMemory</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)
376
422
int     <a href="#virDomainSetMemoryFlags">virDomainSetMemoryFlags</a>          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory, <br />                                    unsigned int flags)
377
423
int     <a href="#virDomainSetMemoryParameters">virDomainSetMemoryParameters</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)
 
424
int     <a href="#virDomainSetMetadata">virDomainSetMetadata</a>                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int type, <br />                                        const char * metadata, <br />                                   const char * key, <br />                                        const char * uri, <br />                                        unsigned int flags)
 
425
int     <a href="#virDomainSetNumaParameters">virDomainSetNumaParameters</a>    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)
378
426
int     <a href="#virDomainSetSchedulerParameters">virDomainSetSchedulerParameters</a>  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams)
379
427
int     <a href="#virDomainSetSchedulerParametersFlags">virDomainSetSchedulerParametersFlags</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                             <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                             int nparams, <br />                                             unsigned int flags)
380
428
int     <a href="#virDomainSetVcpus">virDomainSetVcpus</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int nvcpus)
381
429
int     <a href="#virDomainSetVcpusFlags">virDomainSetVcpusFlags</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int nvcpus, <br />                                     unsigned int flags)
382
430
int     <a href="#virDomainShutdown">virDomainShutdown</a>              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)
 
431
int     <a href="#virDomainShutdownFlags">virDomainShutdownFlags</a>            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)
383
432
<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a>    <a href="#virDomainSnapshotCreateXML">virDomainSnapshotCreateXML</a>    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     const char * xmlDesc, <br />                                                    unsigned int flags)
384
433
<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a>    <a href="#virDomainSnapshotCurrent">virDomainSnapshotCurrent</a>        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     unsigned int flags)
385
434
int     <a href="#virDomainSnapshotDelete">virDomainSnapshotDelete</a>          (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)
561
610
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>    <a href="#virStorageVolLookupByName">virStorageVolLookupByName</a>      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                                     const char * name)
562
611
<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>    <a href="#virStorageVolLookupByPath">virStorageVolLookupByPath</a>      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     const char * path)
563
612
int     <a href="#virStorageVolRef">virStorageVolRef</a>                (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)
 
613
int     <a href="#virStorageVolResize">virStorageVolResize</a>          (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned long long capacity, <br />                                     unsigned int flags)
564
614
int     <a href="#virStorageVolUpload">virStorageVolUpload</a>          (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     unsigned long long offset, <br />                                       unsigned long long length, <br />                                       unsigned int flags)
565
615
int     <a href="#virStorageVolWipe">virStorageVolWipe</a>              (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int flags)
 
616
int     <a href="#virStorageVolWipePattern">virStorageVolWipePattern</a>        (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int algorithm, <br />                                  unsigned int flags)
566
617
int     <a href="#virStreamAbort">virStreamAbort</a>                    (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream)
567
618
int     <a href="#virStreamEventAddCallback">virStreamEventAddCallback</a>      (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     int events, <br />                                      <a href="libvirt-libvirt.html#virStreamEventCallback">virStreamEventCallback</a> cb, <br />                                     void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)
568
619
typedef <a href="#virStreamEventCallback">virStreamEventCallback</a>
584
635
typedef <a href="#virStreamSourceFunc">virStreamSourceFunc</a>
585
636
int     <a href="#virStreamSourceFunc">virStreamSourceFunc</a>          (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> st, <br />                                         char * data, <br />                                     size_t nbytes, <br />                                   void * opaque)
586
637
 
587
 
</pre><h2>Description</h2><h3><a name="macros" id="macros">Macros</a></h3><h3><a name="LIBVIR_VERSION_NUMBER" id="LIBVIR_VERSION_NUMBER"><code>LIBVIR_VERSION_NUMBER</code></a></h3><pre>#define LIBVIR_VERSION_NUMBER</pre><p>Macro providing the version of the library as version * 1,000,000 + minor * 1000 + micro</p><h3><a name="VIR_COPY_CPUMAP" id="VIR_COPY_CPUMAP"><code>VIR_COPY_CPUMAP</code></a></h3><pre>#define VIR_COPY_CPUMAP</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>() and <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() APIs. <a href="libvirt-libvirt.html#VIR_COPY_CPUMAP">VIR_COPY_CPUMAP</a> macro extract the cpumap of the specified vcpu from cpumaps array and copy it into cpumap to be used later by <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API.</p><h3><a name="VIR_CPU_MAPLEN" id="VIR_CPU_MAPLEN"><code>VIR_CPU_MAPLEN</code></a></h3><pre>#define VIR_CPU_MAPLEN</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. It returns the length (in bytes) required to store the complete CPU map between a single virtual &amp; all physical CPUs of a domain.</p><h3><a name="VIR_CPU_USABLE" id="VIR_CPU_USABLE"><code>VIR_CPU_USABLE</code></a></h3><pre>#define VIR_CPU_USABLE</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>() API. <a href="libvirt-libvirt.html#VIR_CPU_USABLE">VIR_CPU_USABLE</a> macro returns a non zero value (true) if the cpu is usable by the vcpu, and 0 otherwise.</p><h3><a name="VIR_DOMAIN_BLKIO_DEVICE_WEIGHT" id="VIR_DOMAIN_BLKIO_DEVICE_WEIGHT"><code>VIR_DOMAIN_BLKIO_DEVICE_WEIGHT</code></a></h3><pre>#define VIR_DOMAIN_BLKIO_DEVICE_WEIGHT</pre><p>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 ','.</p><h3><a name="VIR_DOMAIN_BLKIO_FIELD_LENGTH" id="VIR_DOMAIN_BLKIO_FIELD_LENGTH"><code>VIR_DOMAIN_BLKIO_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_BLKIO_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virBlkioParameter">virBlkioParameter</a>. Provided for backwards compatibility; <a href="libvirt-libvirt.html#VIR_TYPED_PARAM_FIELD_LENGTH">VIR_TYPED_PARAM_FIELD_LENGTH</a> is the preferred value since 0.9.2.</p><h3><a name="VIR_DOMAIN_BLKIO_WEIGHT" id="VIR_DOMAIN_BLKIO_WEIGHT"><code>VIR_DOMAIN_BLKIO_WEIGHT</code></a></h3><pre>#define VIR_DOMAIN_BLKIO_WEIGHT</pre><p>Macro for the Blkio tunable weight: it represents the io weight the guest can use, as a uint.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the read bytes per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the read I/O operations per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC</pre><p>Macro for the BlockIoTune tunable weight: it represents the total bytes per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the total I/O operations per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the write bytes per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the write I/O operations per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_ERRS" id="VIR_DOMAIN_BLOCK_STATS_ERRS"><code>VIR_DOMAIN_BLOCK_STATS_ERRS</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_ERRS</pre><p>In Xen this returns the mysterious 'oo_req', as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH" id="VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH"><code>VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH</pre><p>Macro providing the field length of parameter names when using <a href="libvirt-libvirt.html#virDomainBlockStatsFlags">virDomainBlockStatsFlags</a>().</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ" id="VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ"><code>VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ</pre><p>Macro represents the total flush requests of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES" id="VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES"><code>VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES</pre><p>Macro represents the total time spend on cache flushing in nano-seconds of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_READ_BYTES" id="VIR_DOMAIN_BLOCK_STATS_READ_BYTES"><code>VIR_DOMAIN_BLOCK_STATS_READ_BYTES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_READ_BYTES</pre><p>Macro represents the total number of read bytes of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_READ_REQ" id="VIR_DOMAIN_BLOCK_STATS_READ_REQ"><code>VIR_DOMAIN_BLOCK_STATS_READ_REQ</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_READ_REQ</pre><p>Macro represents the total read requests of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES" id="VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES"><code>VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES</pre><p>Macro represents the total time spend on cache reads in nano-seconds of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES" id="VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES"><code>VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES</pre><p>Macro represents the total number of write bytes of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_WRITE_REQ" id="VIR_DOMAIN_BLOCK_STATS_WRITE_REQ"><code>VIR_DOMAIN_BLOCK_STATS_WRITE_REQ</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_WRITE_REQ</pre><p>Macro represents the total write requests of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES" id="VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES"><code>VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES</pre><p>Macro represents the total time spend on cache writes in nano-seconds of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_EVENT_CALLBACK" id="VIR_DOMAIN_EVENT_CALLBACK"><code>VIR_DOMAIN_EVENT_CALLBACK</code></a></h3><pre>#define VIR_DOMAIN_EVENT_CALLBACK</pre><p>Used to cast the event specific callback into the generic one for use for virDomainEventRegister</p><h3><a name="VIR_DOMAIN_MEMORY_FIELD_LENGTH" id="VIR_DOMAIN_MEMORY_FIELD_LENGTH"><code>VIR_DOMAIN_MEMORY_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virMemoryParameter">virMemoryParameter</a>. Provided for backwards compatibility; <a href="libvirt-libvirt.html#VIR_TYPED_PARAM_FIELD_LENGTH">VIR_TYPED_PARAM_FIELD_LENGTH</a> is the preferred value since 0.9.2.</p><h3><a name="VIR_DOMAIN_MEMORY_HARD_LIMIT" id="VIR_DOMAIN_MEMORY_HARD_LIMIT"><code>VIR_DOMAIN_MEMORY_HARD_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_HARD_LIMIT</pre><p>Macro for the memory tunable hard_limit: it represents the maximum memory the guest can use, as a ullong.</p><h3><a name="VIR_DOMAIN_MEMORY_MIN_GUARANTEE" id="VIR_DOMAIN_MEMORY_MIN_GUARANTEE"><code>VIR_DOMAIN_MEMORY_MIN_GUARANTEE</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_MIN_GUARANTEE</pre><p>Macro for the memory tunable min_guarantee: it represents the minimum memory guaranteed to be reserved for the guest, as a ullong.</p><h3><a name="VIR_DOMAIN_MEMORY_PARAM_UNLIMITED" id="VIR_DOMAIN_MEMORY_PARAM_UNLIMITED"><code>VIR_DOMAIN_MEMORY_PARAM_UNLIMITED</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_PARAM_UNLIMITED</pre><p>Macro providing the <a href="libvirt-libvirt.html#virMemoryParameter">virMemoryParameter</a> value that indicates "unlimited"</p><h3><a name="VIR_DOMAIN_MEMORY_SOFT_LIMIT" id="VIR_DOMAIN_MEMORY_SOFT_LIMIT"><code>VIR_DOMAIN_MEMORY_SOFT_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_SOFT_LIMIT</pre><p>Macro for the memory tunable soft_limit: it represents the memory upper limit enforced during memory contention, as a ullong.</p><h3><a name="VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT" id="VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT"><code>VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_HARD_LIMIT">VIR_DOMAIN_MEMORY_HARD_LIMIT</a>.</p><h3><a name="VIR_DOMAIN_SCHEDULER_CAP" id="VIR_DOMAIN_SCHEDULER_CAP"><code>VIR_DOMAIN_SCHEDULER_CAP</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_CAP</pre><p>Macro represents the maximum scheduler cap, when using the credit scheduler, as a uint.</p><h3><a name="VIR_DOMAIN_SCHEDULER_CPU_SHARES" id="VIR_DOMAIN_SCHEDULER_CPU_SHARES"><code>VIR_DOMAIN_SCHEDULER_CPU_SHARES</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_CPU_SHARES</pre><p>Macro represents proportional weight of the scheduler used on the host cpu, when using the posix scheduler, as a ullong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_LIMIT" id="VIR_DOMAIN_SCHEDULER_LIMIT"><code>VIR_DOMAIN_SCHEDULER_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_LIMIT</pre><p>Macro represents the scheduler limit value, when using the allocation scheduler, as an llong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_RESERVATION" id="VIR_DOMAIN_SCHEDULER_RESERVATION"><code>VIR_DOMAIN_SCHEDULER_RESERVATION</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_RESERVATION</pre><p>Macro represents the scheduler reservation value, when using the allocation scheduler, as an llong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_SHARES" id="VIR_DOMAIN_SCHEDULER_SHARES"><code>VIR_DOMAIN_SCHEDULER_SHARES</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_SHARES</pre><p>Macro represents the scheduler shares value, when using the allocation scheduler, as an int.</p><h3><a name="VIR_DOMAIN_SCHEDULER_VCPU_PERIOD" id="VIR_DOMAIN_SCHEDULER_VCPU_PERIOD"><code>VIR_DOMAIN_SCHEDULER_VCPU_PERIOD</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_VCPU_PERIOD</pre><p>Macro represents the enforcement period for a quota, in microseconds, when using the posix scheduler, as a ullong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_VCPU_QUOTA" id="VIR_DOMAIN_SCHEDULER_VCPU_QUOTA"><code>VIR_DOMAIN_SCHEDULER_VCPU_QUOTA</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_VCPU_QUOTA</pre><p>Macro represents the maximum bandwidth to be used within a period, when using the posix scheduler, as an llong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_WEIGHT" id="VIR_DOMAIN_SCHEDULER_WEIGHT"><code>VIR_DOMAIN_SCHEDULER_WEIGHT</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_WEIGHT</pre><p>Macro represents the relative weight, when using the credit scheduler, as a uint.</p><h3><a name="VIR_DOMAIN_SCHED_FIELD_LENGTH" id="VIR_DOMAIN_SCHED_FIELD_LENGTH"><code>VIR_DOMAIN_SCHED_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_SCHED_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virSchedParameter">virSchedParameter</a>. Provided for backwards compatibility; <a href="libvirt-libvirt.html#VIR_TYPED_PARAM_FIELD_LENGTH">VIR_TYPED_PARAM_FIELD_LENGTH</a> is the preferred value since 0.9.2.</p><h3><a name="VIR_DOMAIN_SEND_KEY_MAX_KEYS" id="VIR_DOMAIN_SEND_KEY_MAX_KEYS"><code>VIR_DOMAIN_SEND_KEY_MAX_KEYS</code></a></h3><pre>#define VIR_DOMAIN_SEND_KEY_MAX_KEYS</pre><p>Maximum number of keycodes that can be sent in one <a href="libvirt-libvirt.html#virDomainSendKey">virDomainSendKey</a>() call.</p><h3><a name="VIR_GET_CPUMAP" id="VIR_GET_CPUMAP"><code>VIR_GET_CPUMAP</code></a></h3><pre>#define VIR_GET_CPUMAP</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>() and <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() APIs. <a href="libvirt-libvirt.html#VIR_GET_CPUMAP">VIR_GET_CPUMAP</a> macro returns a pointer to the cpumap of the specified vcpu from cpumaps array.</p><h3><a name="VIR_NODEINFO_MAXCPUS" id="VIR_NODEINFO_MAXCPUS"><code>VIR_NODEINFO_MAXCPUS</code></a></h3><pre>#define VIR_NODEINFO_MAXCPUS</pre><p>This macro is to calculate the total number of CPUs supported but not necessary active in the host.</p><h3><a name="VIR_NODE_CPU_STATS_FIELD_LENGTH" id="VIR_NODE_CPU_STATS_FIELD_LENGTH"><code>VIR_NODE_CPU_STATS_FIELD_LENGTH</code></a></h3><pre>#define VIR_NODE_CPU_STATS_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virNodeCPUStats">virNodeCPUStats</a></p><h3><a name="VIR_NODE_CPU_STATS_IDLE" id="VIR_NODE_CPU_STATS_IDLE"><code>VIR_NODE_CPU_STATS_IDLE</code></a></h3><pre>#define VIR_NODE_CPU_STATS_IDLE</pre><p>The cumulative idle CPU time, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_IOWAIT" id="VIR_NODE_CPU_STATS_IOWAIT"><code>VIR_NODE_CPU_STATS_IOWAIT</code></a></h3><pre>#define VIR_NODE_CPU_STATS_IOWAIT</pre><p>The cumulative I/O wait CPU time, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_KERNEL" id="VIR_NODE_CPU_STATS_KERNEL"><code>VIR_NODE_CPU_STATS_KERNEL</code></a></h3><pre>#define VIR_NODE_CPU_STATS_KERNEL</pre><p>Macro for the cumulative CPU time which was spent by the kernel, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_USER" id="VIR_NODE_CPU_STATS_USER"><code>VIR_NODE_CPU_STATS_USER</code></a></h3><pre>#define VIR_NODE_CPU_STATS_USER</pre><p>The cumulative CPU time which was spent by user processes, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_UTILIZATION" id="VIR_NODE_CPU_STATS_UTILIZATION"><code>VIR_NODE_CPU_STATS_UTILIZATION</code></a></h3><pre>#define VIR_NODE_CPU_STATS_UTILIZATION</pre><p>The CPU utilization of a node. The usage value is in percent and 100% represents all CPUs of the node.</p><h3><a name="VIR_NODE_MEMORY_STATS_BUFFERS" id="VIR_NODE_MEMORY_STATS_BUFFERS"><code>VIR_NODE_MEMORY_STATS_BUFFERS</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_BUFFERS</pre><p>Macro for the buffer memory: On Linux, it is only returned in case of <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a>.</p><h3><a name="VIR_NODE_MEMORY_STATS_CACHED" id="VIR_NODE_MEMORY_STATS_CACHED"><code>VIR_NODE_MEMORY_STATS_CACHED</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_CACHED</pre><p>Macro for the cached memory: On Linux, it is only returned in case of <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a>.</p><h3><a name="VIR_NODE_MEMORY_STATS_FIELD_LENGTH" id="VIR_NODE_MEMORY_STATS_FIELD_LENGTH"><code>VIR_NODE_MEMORY_STATS_FIELD_LENGTH</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virNodeMemoryStats">virNodeMemoryStats</a></p><h3><a name="VIR_NODE_MEMORY_STATS_FREE" id="VIR_NODE_MEMORY_STATS_FREE"><code>VIR_NODE_MEMORY_STATS_FREE</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_FREE</pre><p>Macro for the free memory of specified cell: On Linux, it includes buffer and cached memory, in case of <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a>.</p><h3><a name="VIR_NODE_MEMORY_STATS_TOTAL" id="VIR_NODE_MEMORY_STATS_TOTAL"><code>VIR_NODE_MEMORY_STATS_TOTAL</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_TOTAL</pre><p>Macro for the total memory of specified cell: it represents the maximum memory.</p><h3><a name="VIR_SECURITY_DOI_BUFLEN" id="VIR_SECURITY_DOI_BUFLEN"><code>VIR_SECURITY_DOI_BUFLEN</code></a></h3><pre>#define VIR_SECURITY_DOI_BUFLEN</pre><p>Macro providing the maximum length of the <a href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a> doi string.</p><h3><a name="VIR_SECURITY_LABEL_BUFLEN" id="VIR_SECURITY_LABEL_BUFLEN"><code>VIR_SECURITY_LABEL_BUFLEN</code></a></h3><pre>#define VIR_SECURITY_LABEL_BUFLEN</pre><p>Macro providing the maximum length of the <a href="libvirt-libvirt.html#virSecurityLabel">virSecurityLabel</a> label string. Note that this value is based on that used by Labeled NFS.</p><h3><a name="VIR_SECURITY_MODEL_BUFLEN" id="VIR_SECURITY_MODEL_BUFLEN"><code>VIR_SECURITY_MODEL_BUFLEN</code></a></h3><pre>#define VIR_SECURITY_MODEL_BUFLEN</pre><p>Macro providing the maximum length of the <a href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a> model string.</p><h3><a name="VIR_TYPED_PARAM_FIELD_LENGTH" id="VIR_TYPED_PARAM_FIELD_LENGTH"><code>VIR_TYPED_PARAM_FIELD_LENGTH</code></a></h3><pre>#define VIR_TYPED_PARAM_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virTypedParameter">virTypedParameter</a> name</p><h3><a name="VIR_UNUSE_CPU" id="VIR_UNUSE_CPU"><code>VIR_UNUSE_CPU</code></a></h3><pre>#define VIR_UNUSE_CPU</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. USE_CPU macro reset the bit (CPU not usable) of the related cpu in cpumap.</p><h3><a name="VIR_USE_CPU" id="VIR_USE_CPU"><code>VIR_USE_CPU</code></a></h3><pre>#define VIR_USE_CPU</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. USE_CPU macro set the bit (CPU usable) of the related cpu in cpumap.</p><h3><a name="VIR_UUID_BUFLEN" id="VIR_UUID_BUFLEN"><code>VIR_UUID_BUFLEN</code></a></h3><pre>#define VIR_UUID_BUFLEN</pre><p>This macro provides the length of the buffer required for <a href="libvirt-libvirt.html#virDomainGetUUID">virDomainGetUUID</a>()</p><h3><a name="VIR_UUID_STRING_BUFLEN" id="VIR_UUID_STRING_BUFLEN"><code>VIR_UUID_STRING_BUFLEN</code></a></h3><pre>#define VIR_UUID_STRING_BUFLEN</pre><p>This macro provides the length of the buffer required for <a href="libvirt-libvirt.html#virDomainGetUUIDString">virDomainGetUUIDString</a>()</p><h3><a name="_virBlkioParameter" id="_virBlkioParameter"><code>_virBlkioParameter</code></a></h3><pre>#define _virBlkioParameter</pre><p></p><h3><a name="_virMemoryParameter" id="_virMemoryParameter"><code>_virMemoryParameter</code></a></h3><pre>#define _virMemoryParameter</pre><p></p><h3><a name="_virSchedParameter" id="_virSchedParameter"><code>_virSchedParameter</code></a></h3><pre>#define _virSchedParameter</pre><p></p><h3><a name="types" id="types">Types</a></h3><h3><a name="virBlkioParameter" id="virBlkioParameter"><code>virBlkioParameter</code></a></h3><div class="api"><pre>struct virBlkioParameter{
 
638
</pre><h2>Description</h2><h3><a name="macros" id="macros">Macros</a></h3><h3><a name="LIBVIR_VERSION_NUMBER" id="LIBVIR_VERSION_NUMBER"><code>LIBVIR_VERSION_NUMBER</code></a></h3><pre>#define LIBVIR_VERSION_NUMBER</pre><p>Macro providing the version of the library as version * 1,000,000 + minor * 1000 + micro</p><h3><a name="VIR_COPY_CPUMAP" id="VIR_COPY_CPUMAP"><code>VIR_COPY_CPUMAP</code></a></h3><pre>#define VIR_COPY_CPUMAP</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>() and <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() APIs. <a href="libvirt-libvirt.html#VIR_COPY_CPUMAP">VIR_COPY_CPUMAP</a> macro extract the cpumap of the specified vcpu from cpumaps array and copy it into cpumap to be used later by <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API.</p><h3><a name="VIR_CPU_MAPLEN" id="VIR_CPU_MAPLEN"><code>VIR_CPU_MAPLEN</code></a></h3><pre>#define VIR_CPU_MAPLEN</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. It returns the length (in bytes) required to store the complete CPU map between a single virtual &amp; all physical CPUs of a domain.</p><h3><a name="VIR_CPU_USABLE" id="VIR_CPU_USABLE"><code>VIR_CPU_USABLE</code></a></h3><pre>#define VIR_CPU_USABLE</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>() API. <a href="libvirt-libvirt.html#VIR_CPU_USABLE">VIR_CPU_USABLE</a> macro returns a non zero value (true) if the cpu is usable by the vcpu, and 0 otherwise.</p><h3><a name="VIR_DOMAIN_BANDWIDTH_IN_AVERAGE" id="VIR_DOMAIN_BANDWIDTH_IN_AVERAGE"><code>VIR_DOMAIN_BANDWIDTH_IN_AVERAGE</code></a></h3><pre>#define VIR_DOMAIN_BANDWIDTH_IN_AVERAGE</pre><p>Macro represents the inbound average of NIC bandwidth, as a uint.</p><h3><a name="VIR_DOMAIN_BANDWIDTH_IN_BURST" id="VIR_DOMAIN_BANDWIDTH_IN_BURST"><code>VIR_DOMAIN_BANDWIDTH_IN_BURST</code></a></h3><pre>#define VIR_DOMAIN_BANDWIDTH_IN_BURST</pre><p>Macro represents the inbound burst of NIC bandwidth, as a uint.</p><h3><a name="VIR_DOMAIN_BANDWIDTH_IN_PEAK" id="VIR_DOMAIN_BANDWIDTH_IN_PEAK"><code>VIR_DOMAIN_BANDWIDTH_IN_PEAK</code></a></h3><pre>#define VIR_DOMAIN_BANDWIDTH_IN_PEAK</pre><p>Macro represents the inbound peak of NIC bandwidth, as a uint.</p><h3><a name="VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE" id="VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE"><code>VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE</code></a></h3><pre>#define VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE</pre><p>Macro represents the outbound average of NIC bandwidth, as a uint.</p><h3><a name="VIR_DOMAIN_BANDWIDTH_OUT_BURST" id="VIR_DOMAIN_BANDWIDTH_OUT_BURST"><code>VIR_DOMAIN_BANDWIDTH_OUT_BURST</code></a></h3><pre>#define VIR_DOMAIN_BANDWIDTH_OUT_BURST</pre><p>Macro represents the outbound burst of NIC bandwidth, as a uint.</p><h3><a name="VIR_DOMAIN_BANDWIDTH_OUT_PEAK" id="VIR_DOMAIN_BANDWIDTH_OUT_PEAK"><code>VIR_DOMAIN_BANDWIDTH_OUT_PEAK</code></a></h3><pre>#define VIR_DOMAIN_BANDWIDTH_OUT_PEAK</pre><p>Macro represents the outbound peak of NIC bandwidth, as a uint.</p><h3><a name="VIR_DOMAIN_BLKIO_DEVICE_WEIGHT" id="VIR_DOMAIN_BLKIO_DEVICE_WEIGHT"><code>VIR_DOMAIN_BLKIO_DEVICE_WEIGHT</code></a></h3><pre>#define VIR_DOMAIN_BLKIO_DEVICE_WEIGHT</pre><p>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 ','.</p><h3><a name="VIR_DOMAIN_BLKIO_FIELD_LENGTH" id="VIR_DOMAIN_BLKIO_FIELD_LENGTH"><code>VIR_DOMAIN_BLKIO_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_BLKIO_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virBlkioParameter">virBlkioParameter</a>. Provided for backwards compatibility; <a href="libvirt-libvirt.html#VIR_TYPED_PARAM_FIELD_LENGTH">VIR_TYPED_PARAM_FIELD_LENGTH</a> is the preferred value since 0.9.2.</p><h3><a name="VIR_DOMAIN_BLKIO_WEIGHT" id="VIR_DOMAIN_BLKIO_WEIGHT"><code>VIR_DOMAIN_BLKIO_WEIGHT</code></a></h3><pre>#define VIR_DOMAIN_BLKIO_WEIGHT</pre><p>Macro for the Blkio tunable weight: it represents the io weight the guest can use, as a uint.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the read bytes per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the read I/O operations per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC</pre><p>Macro for the BlockIoTune tunable weight: it represents the total bytes per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the total I/O operations per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the write bytes per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC" id="VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC"><code>VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC</pre><p>Macro for the BlockIoTune tunable weight: it repersents the write I/O operations per second permitted through a block device, as a ullong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_ERRS" id="VIR_DOMAIN_BLOCK_STATS_ERRS"><code>VIR_DOMAIN_BLOCK_STATS_ERRS</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_ERRS</pre><p>In Xen this returns the mysterious 'oo_req', as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH" id="VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH"><code>VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_FIELD_LENGTH</pre><p>Macro providing the field length of parameter names when using <a href="libvirt-libvirt.html#virDomainBlockStatsFlags">virDomainBlockStatsFlags</a>().</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ" id="VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ"><code>VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_FLUSH_REQ</pre><p>Macro represents the total flush requests of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES" id="VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES"><code>VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_FLUSH_TOTAL_TIMES</pre><p>Macro represents the total time spend on cache flushing in nano-seconds of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_READ_BYTES" id="VIR_DOMAIN_BLOCK_STATS_READ_BYTES"><code>VIR_DOMAIN_BLOCK_STATS_READ_BYTES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_READ_BYTES</pre><p>Macro represents the total number of read bytes of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_READ_REQ" id="VIR_DOMAIN_BLOCK_STATS_READ_REQ"><code>VIR_DOMAIN_BLOCK_STATS_READ_REQ</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_READ_REQ</pre><p>Macro represents the total read requests of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES" id="VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES"><code>VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_READ_TOTAL_TIMES</pre><p>Macro represents the total time spend on cache reads in nano-seconds of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES" id="VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES"><code>VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES</pre><p>Macro represents the total number of write bytes of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_WRITE_REQ" id="VIR_DOMAIN_BLOCK_STATS_WRITE_REQ"><code>VIR_DOMAIN_BLOCK_STATS_WRITE_REQ</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_WRITE_REQ</pre><p>Macro represents the total write requests of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES" id="VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES"><code>VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES</code></a></h3><pre>#define VIR_DOMAIN_BLOCK_STATS_WRITE_TOTAL_TIMES</pre><p>Macro represents the total time spend on cache writes in nano-seconds of the block device, as an llong.</p><h3><a name="VIR_DOMAIN_CPU_STATS_CPUTIME" id="VIR_DOMAIN_CPU_STATS_CPUTIME"><code>VIR_DOMAIN_CPU_STATS_CPUTIME</code></a></h3><pre>#define VIR_DOMAIN_CPU_STATS_CPUTIME</pre><p>cpu usage in nanoseconds, as a ullong</p><h3><a name="VIR_DOMAIN_CPU_STATS_SYSTEMTIME" id="VIR_DOMAIN_CPU_STATS_SYSTEMTIME"><code>VIR_DOMAIN_CPU_STATS_SYSTEMTIME</code></a></h3><pre>#define VIR_DOMAIN_CPU_STATS_SYSTEMTIME</pre><p>cpu time charged to system instructions in nanoseconds, as a ullong</p><h3><a name="VIR_DOMAIN_CPU_STATS_USERTIME" id="VIR_DOMAIN_CPU_STATS_USERTIME"><code>VIR_DOMAIN_CPU_STATS_USERTIME</code></a></h3><pre>#define VIR_DOMAIN_CPU_STATS_USERTIME</pre><p>cpu time charged to user instructions in nanoseconds, as a ullong</p><h3><a name="VIR_DOMAIN_EVENT_CALLBACK" id="VIR_DOMAIN_EVENT_CALLBACK"><code>VIR_DOMAIN_EVENT_CALLBACK</code></a></h3><pre>#define VIR_DOMAIN_EVENT_CALLBACK</pre><p>Used to cast the event specific callback into the generic one for use for virDomainEventRegister</p><h3><a name="VIR_DOMAIN_MEMORY_FIELD_LENGTH" id="VIR_DOMAIN_MEMORY_FIELD_LENGTH"><code>VIR_DOMAIN_MEMORY_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virMemoryParameter">virMemoryParameter</a>. Provided for backwards compatibility; <a href="libvirt-libvirt.html#VIR_TYPED_PARAM_FIELD_LENGTH">VIR_TYPED_PARAM_FIELD_LENGTH</a> is the preferred value since 0.9.2.</p><h3><a name="VIR_DOMAIN_MEMORY_HARD_LIMIT" id="VIR_DOMAIN_MEMORY_HARD_LIMIT"><code>VIR_DOMAIN_MEMORY_HARD_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_HARD_LIMIT</pre><p>Macro for the memory tunable hard_limit: it represents the maximum memory the guest can use, as a ullong.</p><h3><a name="VIR_DOMAIN_MEMORY_MIN_GUARANTEE" id="VIR_DOMAIN_MEMORY_MIN_GUARANTEE"><code>VIR_DOMAIN_MEMORY_MIN_GUARANTEE</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_MIN_GUARANTEE</pre><p>Macro for the memory tunable min_guarantee: it represents the minimum memory guaranteed to be reserved for the guest, as a ullong.</p><h3><a name="VIR_DOMAIN_MEMORY_PARAM_UNLIMITED" id="VIR_DOMAIN_MEMORY_PARAM_UNLIMITED"><code>VIR_DOMAIN_MEMORY_PARAM_UNLIMITED</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_PARAM_UNLIMITED</pre><p>Macro providing the <a href="libvirt-libvirt.html#virMemoryParameter">virMemoryParameter</a> value that indicates "unlimited"</p><h3><a name="VIR_DOMAIN_MEMORY_SOFT_LIMIT" id="VIR_DOMAIN_MEMORY_SOFT_LIMIT"><code>VIR_DOMAIN_MEMORY_SOFT_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_SOFT_LIMIT</pre><p>Macro for the memory tunable soft_limit: it represents the memory upper limit enforced during memory contention, as a ullong.</p><h3><a name="VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT" id="VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT"><code>VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_MEMORY_SWAP_HARD_LIMIT</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_HARD_LIMIT">VIR_DOMAIN_MEMORY_HARD_LIMIT</a>.</p><h3><a name="VIR_DOMAIN_NUMA_MODE" id="VIR_DOMAIN_NUMA_MODE"><code>VIR_DOMAIN_NUMA_MODE</code></a></h3><pre>#define VIR_DOMAIN_NUMA_MODE</pre><p>Macro for typed parameter name that lists the numa mode of a domain, as an int containing a <a href="libvirt-libvirt.html#virDomainNumatuneMemMode">virDomainNumatuneMemMode</a> value.</p><h3><a name="VIR_DOMAIN_NUMA_NODESET" id="VIR_DOMAIN_NUMA_NODESET"><code>VIR_DOMAIN_NUMA_NODESET</code></a></h3><pre>#define VIR_DOMAIN_NUMA_NODESET</pre><p>Macro for typed parameter name that lists the numa nodeset of a domain, as a string.</p><h3><a name="VIR_DOMAIN_SCHEDULER_CAP" id="VIR_DOMAIN_SCHEDULER_CAP"><code>VIR_DOMAIN_SCHEDULER_CAP</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_CAP</pre><p>Macro represents the maximum scheduler cap, when using the credit scheduler, as a uint.</p><h3><a name="VIR_DOMAIN_SCHEDULER_CPU_SHARES" id="VIR_DOMAIN_SCHEDULER_CPU_SHARES"><code>VIR_DOMAIN_SCHEDULER_CPU_SHARES</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_CPU_SHARES</pre><p>Macro represents proportional weight of the scheduler used on the host cpu, when using the posix scheduler, as a ullong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_LIMIT" id="VIR_DOMAIN_SCHEDULER_LIMIT"><code>VIR_DOMAIN_SCHEDULER_LIMIT</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_LIMIT</pre><p>Macro represents the scheduler limit value, when using the allocation scheduler, as an llong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_RESERVATION" id="VIR_DOMAIN_SCHEDULER_RESERVATION"><code>VIR_DOMAIN_SCHEDULER_RESERVATION</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_RESERVATION</pre><p>Macro represents the scheduler reservation value, when using the allocation scheduler, as an llong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_SHARES" id="VIR_DOMAIN_SCHEDULER_SHARES"><code>VIR_DOMAIN_SCHEDULER_SHARES</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_SHARES</pre><p>Macro represents the scheduler shares value, when using the allocation scheduler, as an int.</p><h3><a name="VIR_DOMAIN_SCHEDULER_VCPU_PERIOD" id="VIR_DOMAIN_SCHEDULER_VCPU_PERIOD"><code>VIR_DOMAIN_SCHEDULER_VCPU_PERIOD</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_VCPU_PERIOD</pre><p>Macro represents the enforcement period for a quota, in microseconds, when using the posix scheduler, as a ullong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_VCPU_QUOTA" id="VIR_DOMAIN_SCHEDULER_VCPU_QUOTA"><code>VIR_DOMAIN_SCHEDULER_VCPU_QUOTA</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_VCPU_QUOTA</pre><p>Macro represents the maximum bandwidth to be used within a period, when using the posix scheduler, as an llong.</p><h3><a name="VIR_DOMAIN_SCHEDULER_WEIGHT" id="VIR_DOMAIN_SCHEDULER_WEIGHT"><code>VIR_DOMAIN_SCHEDULER_WEIGHT</code></a></h3><pre>#define VIR_DOMAIN_SCHEDULER_WEIGHT</pre><p>Macro represents the relative weight, when using the credit scheduler, as a uint.</p><h3><a name="VIR_DOMAIN_SCHED_FIELD_LENGTH" id="VIR_DOMAIN_SCHED_FIELD_LENGTH"><code>VIR_DOMAIN_SCHED_FIELD_LENGTH</code></a></h3><pre>#define VIR_DOMAIN_SCHED_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virSchedParameter">virSchedParameter</a>. Provided for backwards compatibility; <a href="libvirt-libvirt.html#VIR_TYPED_PARAM_FIELD_LENGTH">VIR_TYPED_PARAM_FIELD_LENGTH</a> is the preferred value since 0.9.2.</p><h3><a name="VIR_DOMAIN_SEND_KEY_MAX_KEYS" id="VIR_DOMAIN_SEND_KEY_MAX_KEYS"><code>VIR_DOMAIN_SEND_KEY_MAX_KEYS</code></a></h3><pre>#define VIR_DOMAIN_SEND_KEY_MAX_KEYS</pre><p>Maximum number of keycodes that can be sent in one <a href="libvirt-libvirt.html#virDomainSendKey">virDomainSendKey</a>() call.</p><h3><a name="VIR_GET_CPUMAP" id="VIR_GET_CPUMAP"><code>VIR_GET_CPUMAP</code></a></h3><pre>#define VIR_GET_CPUMAP</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>() and <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() APIs. <a href="libvirt-libvirt.html#VIR_GET_CPUMAP">VIR_GET_CPUMAP</a> macro returns a pointer to the cpumap of the specified vcpu from cpumaps array.</p><h3><a name="VIR_NODEINFO_MAXCPUS" id="VIR_NODEINFO_MAXCPUS"><code>VIR_NODEINFO_MAXCPUS</code></a></h3><pre>#define VIR_NODEINFO_MAXCPUS</pre><p>This macro is to calculate the total number of CPUs supported but not necessary active in the host.</p><h3><a name="VIR_NODE_CPU_STATS_FIELD_LENGTH" id="VIR_NODE_CPU_STATS_FIELD_LENGTH"><code>VIR_NODE_CPU_STATS_FIELD_LENGTH</code></a></h3><pre>#define VIR_NODE_CPU_STATS_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virNodeCPUStats">virNodeCPUStats</a></p><h3><a name="VIR_NODE_CPU_STATS_IDLE" id="VIR_NODE_CPU_STATS_IDLE"><code>VIR_NODE_CPU_STATS_IDLE</code></a></h3><pre>#define VIR_NODE_CPU_STATS_IDLE</pre><p>The cumulative idle CPU time, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_IOWAIT" id="VIR_NODE_CPU_STATS_IOWAIT"><code>VIR_NODE_CPU_STATS_IOWAIT</code></a></h3><pre>#define VIR_NODE_CPU_STATS_IOWAIT</pre><p>The cumulative I/O wait CPU time, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_KERNEL" id="VIR_NODE_CPU_STATS_KERNEL"><code>VIR_NODE_CPU_STATS_KERNEL</code></a></h3><pre>#define VIR_NODE_CPU_STATS_KERNEL</pre><p>Macro for the cumulative CPU time which was spent by the kernel, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_USER" id="VIR_NODE_CPU_STATS_USER"><code>VIR_NODE_CPU_STATS_USER</code></a></h3><pre>#define VIR_NODE_CPU_STATS_USER</pre><p>The cumulative CPU time which was spent by user processes, since the node booting up (in nanoseconds).</p><h3><a name="VIR_NODE_CPU_STATS_UTILIZATION" id="VIR_NODE_CPU_STATS_UTILIZATION"><code>VIR_NODE_CPU_STATS_UTILIZATION</code></a></h3><pre>#define VIR_NODE_CPU_STATS_UTILIZATION</pre><p>The CPU utilization of a node. The usage value is in percent and 100% represents all CPUs of the node.</p><h3><a name="VIR_NODE_MEMORY_STATS_BUFFERS" id="VIR_NODE_MEMORY_STATS_BUFFERS"><code>VIR_NODE_MEMORY_STATS_BUFFERS</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_BUFFERS</pre><p>Macro for the buffer memory: On Linux, it is only returned in case of <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a>.</p><h3><a name="VIR_NODE_MEMORY_STATS_CACHED" id="VIR_NODE_MEMORY_STATS_CACHED"><code>VIR_NODE_MEMORY_STATS_CACHED</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_CACHED</pre><p>Macro for the cached memory: On Linux, it is only returned in case of <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a>.</p><h3><a name="VIR_NODE_MEMORY_STATS_FIELD_LENGTH" id="VIR_NODE_MEMORY_STATS_FIELD_LENGTH"><code>VIR_NODE_MEMORY_STATS_FIELD_LENGTH</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virNodeMemoryStats">virNodeMemoryStats</a></p><h3><a name="VIR_NODE_MEMORY_STATS_FREE" id="VIR_NODE_MEMORY_STATS_FREE"><code>VIR_NODE_MEMORY_STATS_FREE</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_FREE</pre><p>Macro for the free memory of specified cell: On Linux, it includes buffer and cached memory, in case of <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a>.</p><h3><a name="VIR_NODE_MEMORY_STATS_TOTAL" id="VIR_NODE_MEMORY_STATS_TOTAL"><code>VIR_NODE_MEMORY_STATS_TOTAL</code></a></h3><pre>#define VIR_NODE_MEMORY_STATS_TOTAL</pre><p>Macro for the total memory of specified cell: it represents the maximum memory.</p><h3><a name="VIR_SECURITY_DOI_BUFLEN" id="VIR_SECURITY_DOI_BUFLEN"><code>VIR_SECURITY_DOI_BUFLEN</code></a></h3><pre>#define VIR_SECURITY_DOI_BUFLEN</pre><p>Macro providing the maximum length of the <a href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a> doi string.</p><h3><a name="VIR_SECURITY_LABEL_BUFLEN" id="VIR_SECURITY_LABEL_BUFLEN"><code>VIR_SECURITY_LABEL_BUFLEN</code></a></h3><pre>#define VIR_SECURITY_LABEL_BUFLEN</pre><p>Macro providing the maximum length of the <a href="libvirt-libvirt.html#virSecurityLabel">virSecurityLabel</a> label string. Note that this value is based on that used by Labeled NFS.</p><h3><a name="VIR_SECURITY_MODEL_BUFLEN" id="VIR_SECURITY_MODEL_BUFLEN"><code>VIR_SECURITY_MODEL_BUFLEN</code></a></h3><pre>#define VIR_SECURITY_MODEL_BUFLEN</pre><p>Macro providing the maximum length of the <a href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a> model string.</p><h3><a name="VIR_TYPED_PARAM_FIELD_LENGTH" id="VIR_TYPED_PARAM_FIELD_LENGTH"><code>VIR_TYPED_PARAM_FIELD_LENGTH</code></a></h3><pre>#define VIR_TYPED_PARAM_FIELD_LENGTH</pre><p>Macro providing the field length of <a href="libvirt-libvirt.html#virTypedParameter">virTypedParameter</a> name</p><h3><a name="VIR_UNUSE_CPU" id="VIR_UNUSE_CPU"><code>VIR_UNUSE_CPU</code></a></h3><pre>#define VIR_UNUSE_CPU</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. USE_CPU macro reset the bit (CPU not usable) of the related cpu in cpumap.</p><h3><a name="VIR_USE_CPU" id="VIR_USE_CPU"><code>VIR_USE_CPU</code></a></h3><pre>#define VIR_USE_CPU</pre><p>This macro is to be used in conjunction with <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. USE_CPU macro set the bit (CPU usable) of the related cpu in cpumap.</p><h3><a name="VIR_UUID_BUFLEN" id="VIR_UUID_BUFLEN"><code>VIR_UUID_BUFLEN</code></a></h3><pre>#define VIR_UUID_BUFLEN</pre><p>This macro provides the length of the buffer required for <a href="libvirt-libvirt.html#virDomainGetUUID">virDomainGetUUID</a>()</p><h3><a name="VIR_UUID_STRING_BUFLEN" id="VIR_UUID_STRING_BUFLEN"><code>VIR_UUID_STRING_BUFLEN</code></a></h3><pre>#define VIR_UUID_STRING_BUFLEN</pre><p>This macro provides the length of the buffer required for <a href="libvirt-libvirt.html#virDomainGetUUIDString">virDomainGetUUIDString</a>()</p><h3><a name="_virBlkioParameter" id="_virBlkioParameter"><code>_virBlkioParameter</code></a></h3><pre>#define _virBlkioParameter</pre><p></p><h3><a name="_virMemoryParameter" id="_virMemoryParameter"><code>_virMemoryParameter</code></a></h3><pre>#define _virMemoryParameter</pre><p></p><h3><a name="_virSchedParameter" id="_virSchedParameter"><code>_virSchedParameter</code></a></h3><pre>#define _virSchedParameter</pre><p></p><h3><a name="types" id="types">Types</a></h3><h3><a name="virBlkioParameter" id="virBlkioParameter"><code>virBlkioParameter</code></a></h3><div class="api"><pre>struct virBlkioParameter{
588
639
</pre><table><tr><td>char field[VIR_TYPED_PARAM_FIELD_LENGTH]</td><td>field</td><td> : parameter name</td></tr><tr><td>int</td><td>type</td><td> : parameter type, <a href="libvirt-libvirt.html#virTypedParameterType">virTypedParameterType</a></td></tr><tr><td>union {</td></tr><tr><td><table><tr><td>int</td><td>i</td><td> : type is INT</td></tr><tr><td>unsigned int</td><td>ui</td><td> : type is UINT</td></tr><tr><td>long long int</td><td>l</td><td> : type is LLONG</td></tr><tr><td>unsigned long long int</td><td>ul</td><td> : type is ULLONG</td></tr><tr><td>double</td><td>d</td><td> : type is DOUBLE</td></tr><tr><td>char</td><td>b</td><td> : type is BOOLEAN</td></tr><tr><td>char *</td><td>s</td><td> : type is STRING, may not be NULL</td></tr></table></td><td></td></tr><tr><td>}</td><td>value</td><td> : parameter value</td><td></td></tr></table><pre>
589
640
}
590
641
</pre></div><h3><a name="virBlkioParameterType" id="virBlkioParameterType"><code>virBlkioParameterType</code></a></h3><div class="api"><pre>enum virBlkioParameterType {
591
642
</pre><table><tr><td><a name="VIR_DOMAIN_BLKIO_PARAM_BOOLEAN" id="VIR_DOMAIN_BLKIO_PARAM_BOOLEAN">VIR_DOMAIN_BLKIO_PARAM_BOOLEAN</a></td><td> = </td><td>VIR_TYPED_PARAM_BOOLEAN</td></tr><tr><td><a name="VIR_DOMAIN_BLKIO_PARAM_DOUBLE" id="VIR_DOMAIN_BLKIO_PARAM_DOUBLE">VIR_DOMAIN_BLKIO_PARAM_DOUBLE</a></td><td> = </td><td>VIR_TYPED_PARAM_DOUBLE</td></tr><tr><td><a name="VIR_DOMAIN_BLKIO_PARAM_INT" id="VIR_DOMAIN_BLKIO_PARAM_INT">VIR_DOMAIN_BLKIO_PARAM_INT</a></td><td> = </td><td>VIR_TYPED_PARAM_INT</td></tr><tr><td><a name="VIR_DOMAIN_BLKIO_PARAM_LLONG" id="VIR_DOMAIN_BLKIO_PARAM_LLONG">VIR_DOMAIN_BLKIO_PARAM_LLONG</a></td><td> = </td><td>VIR_TYPED_PARAM_LLONG</td></tr><tr><td><a name="VIR_DOMAIN_BLKIO_PARAM_UINT" id="VIR_DOMAIN_BLKIO_PARAM_UINT">VIR_DOMAIN_BLKIO_PARAM_UINT</a></td><td> = </td><td>VIR_TYPED_PARAM_UINT</td></tr><tr><td><a name="VIR_DOMAIN_BLKIO_PARAM_ULLONG" id="VIR_DOMAIN_BLKIO_PARAM_ULLONG">VIR_DOMAIN_BLKIO_PARAM_ULLONG</a></td><td> = </td><td>VIR_TYPED_PARAM_ULLONG</td></tr></table><pre>}
592
643
</pre></div><h3><a name="virCPUCompareResult" id="virCPUCompareResult"><code>virCPUCompareResult</code></a></h3><div class="api"><pre>enum virCPUCompareResult {
593
 
</pre><table><tr><td><a name="VIR_CPU_COMPARE_ERROR" id="VIR_CPU_COMPARE_ERROR">VIR_CPU_COMPARE_ERROR</a></td><td> = </td><td>-1</td></tr><tr><td><a name="VIR_CPU_COMPARE_INCOMPATIBLE" id="VIR_CPU_COMPARE_INCOMPATIBLE">VIR_CPU_COMPARE_INCOMPATIBLE</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_CPU_COMPARE_IDENTICAL" id="VIR_CPU_COMPARE_IDENTICAL">VIR_CPU_COMPARE_IDENTICAL</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_CPU_COMPARE_SUPERSET" id="VIR_CPU_COMPARE_SUPERSET">VIR_CPU_COMPARE_SUPERSET</a></td><td> = </td><td>2</td></tr></table><pre>}
 
644
</pre><table><tr><td><a name="VIR_CPU_COMPARE_ERROR" id="VIR_CPU_COMPARE_ERROR">VIR_CPU_COMPARE_ERROR</a></td><td> = </td><td>-1</td></tr><tr><td><a name="VIR_CPU_COMPARE_INCOMPATIBLE" id="VIR_CPU_COMPARE_INCOMPATIBLE">VIR_CPU_COMPARE_INCOMPATIBLE</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_CPU_COMPARE_IDENTICAL" id="VIR_CPU_COMPARE_IDENTICAL">VIR_CPU_COMPARE_IDENTICAL</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_CPU_COMPARE_SUPERSET" id="VIR_CPU_COMPARE_SUPERSET">VIR_CPU_COMPARE_SUPERSET</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_CPU_COMPARE_LAST" id="VIR_CPU_COMPARE_LAST">VIR_CPU_COMPARE_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
594
645
</pre></div><h3><a name="virConnect" id="virConnect"><code>virConnect</code></a></h3><div class="api"><pre>struct virConnect{
595
646
</pre><table><tr><td colspan="3">The content of this structure is not made public by the API</td></tr></table><pre>
596
647
}
601
652
</pre><table><tr><td>int</td><td>type</td><td> : One of <a href="libvirt-libvirt.html#virConnectCredentialType">virConnectCredentialType</a> constants</td></tr><tr><td>const char *</td><td>prompt</td><td> : Prompt to show to user</td></tr><tr><td>const char *</td><td>challenge</td><td> : Additional challenge to show</td></tr><tr><td>const char *</td><td>defresult</td><td> : Optional default result</td></tr><tr><td>char *</td><td>result</td><td> : Result to be filled with user response (or defresult)</td></tr><tr><td>unsigned int</td><td>resultlen</td><td> : Length of the result</td></tr></table><pre>
602
653
}
603
654
</pre></div><h3><a name="virConnectCredentialType" id="virConnectCredentialType"><code>virConnectCredentialType</code></a></h3><div class="api"><pre>enum virConnectCredentialType {
604
 
</pre><table><tr><td><a name="VIR_CRED_USERNAME" id="VIR_CRED_USERNAME">VIR_CRED_USERNAME</a></td><td> = </td><td>1</td><td> : Identity to act as</td></tr><tr><td><a name="VIR_CRED_AUTHNAME" id="VIR_CRED_AUTHNAME">VIR_CRED_AUTHNAME</a></td><td> = </td><td>2</td><td> : Identify to authorize as</td></tr><tr><td><a name="VIR_CRED_LANGUAGE" id="VIR_CRED_LANGUAGE">VIR_CRED_LANGUAGE</a></td><td> = </td><td>3</td><td> : RFC 1766 languages, comma separated</td></tr><tr><td><a name="VIR_CRED_CNONCE" id="VIR_CRED_CNONCE">VIR_CRED_CNONCE</a></td><td> = </td><td>4</td><td> : client supplies a nonce</td></tr><tr><td><a name="VIR_CRED_PASSPHRASE" id="VIR_CRED_PASSPHRASE">VIR_CRED_PASSPHRASE</a></td><td> = </td><td>5</td><td> : Passphrase secret</td></tr><tr><td><a name="VIR_CRED_ECHOPROMPT" id="VIR_CRED_ECHOPROMPT">VIR_CRED_ECHOPROMPT</a></td><td> = </td><td>6</td><td> : Challenge response</td></tr><tr><td><a name="VIR_CRED_NOECHOPROMPT" id="VIR_CRED_NOECHOPROMPT">VIR_CRED_NOECHOPROMPT</a></td><td> = </td><td>7</td><td> : Challenge response</td></tr><tr><td><a name="VIR_CRED_REALM" id="VIR_CRED_REALM">VIR_CRED_REALM</a></td><td> = </td><td>8</td><td> : Authentication realm</td></tr><tr><td><a name="VIR_CRED_EXTERNAL" id="VIR_CRED_EXTERNAL">VIR_CRED_EXTERNAL</a></td><td> = </td><td>9</td><td> : Externally managed credential More may be added - expect the unexpected</td></tr></table><pre>}
 
655
</pre><table><tr><td><a name="VIR_CRED_USERNAME" id="VIR_CRED_USERNAME">VIR_CRED_USERNAME</a></td><td> = </td><td>1</td><td> : Identity to act as</td></tr><tr><td><a name="VIR_CRED_AUTHNAME" id="VIR_CRED_AUTHNAME">VIR_CRED_AUTHNAME</a></td><td> = </td><td>2</td><td> : Identify to authorize as</td></tr><tr><td><a name="VIR_CRED_LANGUAGE" id="VIR_CRED_LANGUAGE">VIR_CRED_LANGUAGE</a></td><td> = </td><td>3</td><td> : RFC 1766 languages, comma separated</td></tr><tr><td><a name="VIR_CRED_CNONCE" id="VIR_CRED_CNONCE">VIR_CRED_CNONCE</a></td><td> = </td><td>4</td><td> : client supplies a nonce</td></tr><tr><td><a name="VIR_CRED_PASSPHRASE" id="VIR_CRED_PASSPHRASE">VIR_CRED_PASSPHRASE</a></td><td> = </td><td>5</td><td> : Passphrase secret</td></tr><tr><td><a name="VIR_CRED_ECHOPROMPT" id="VIR_CRED_ECHOPROMPT">VIR_CRED_ECHOPROMPT</a></td><td> = </td><td>6</td><td> : Challenge response</td></tr><tr><td><a name="VIR_CRED_NOECHOPROMPT" id="VIR_CRED_NOECHOPROMPT">VIR_CRED_NOECHOPROMPT</a></td><td> = </td><td>7</td><td> : Challenge response</td></tr><tr><td><a name="VIR_CRED_REALM" id="VIR_CRED_REALM">VIR_CRED_REALM</a></td><td> = </td><td>8</td><td> : Authentication realm</td></tr><tr><td><a name="VIR_CRED_EXTERNAL" id="VIR_CRED_EXTERNAL">VIR_CRED_EXTERNAL</a></td><td> = </td><td>9</td><td> : Externally managed credential More may be added - expect the unexpected</td></tr><tr><td><a name="VIR_CRED_LAST" id="VIR_CRED_LAST">VIR_CRED_LAST</a></td><td> = </td><td>10</td></tr></table><pre>}
605
656
</pre></div><h3><a name="virConnectDomainEventBlockJobStatus" id="virConnectDomainEventBlockJobStatus"><code>virConnectDomainEventBlockJobStatus</code></a></h3><div class="api"><pre>enum virConnectDomainEventBlockJobStatus {
606
 
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_COMPLETED" id="VIR_DOMAIN_BLOCK_JOB_COMPLETED">VIR_DOMAIN_BLOCK_JOB_COMPLETED</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_FAILED" id="VIR_DOMAIN_BLOCK_JOB_FAILED">VIR_DOMAIN_BLOCK_JOB_FAILED</a></td><td> = </td><td>1</td></tr></table><pre>}
 
657
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_COMPLETED" id="VIR_DOMAIN_BLOCK_JOB_COMPLETED">VIR_DOMAIN_BLOCK_JOB_COMPLETED</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_FAILED" id="VIR_DOMAIN_BLOCK_JOB_FAILED">VIR_DOMAIN_BLOCK_JOB_FAILED</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_CANCELED" id="VIR_DOMAIN_BLOCK_JOB_CANCELED">VIR_DOMAIN_BLOCK_JOB_CANCELED</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_LAST" id="VIR_DOMAIN_BLOCK_JOB_LAST">VIR_DOMAIN_BLOCK_JOB_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
607
658
</pre></div><h3><a name="virConnectDomainEventDiskChangeReason" id="virConnectDomainEventDiskChangeReason"><code>virConnectDomainEventDiskChangeReason</code></a></h3><div class="api"><pre>enum virConnectDomainEventDiskChangeReason {
608
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START" id="VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START">VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START</a></td><td> = </td><td>0</td><td> : oldSrcPath is set</td></tr></table><pre>}
 
659
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START" id="VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START">VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START</a></td><td> = </td><td>0</td><td> : oldSrcPath is set</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_DISK_CHANGE_LAST" id="VIR_DOMAIN_EVENT_DISK_CHANGE_LAST">VIR_DOMAIN_EVENT_DISK_CHANGE_LAST</a></td><td> = </td><td>1</td></tr></table><pre>}
609
660
</pre></div><h3><a name="virConnectFlags" id="virConnectFlags"><code>virConnectFlags</code></a></h3><div class="api"><pre>enum virConnectFlags {
610
661
</pre><table><tr><td><a name="VIR_CONNECT_RO" id="VIR_CONNECT_RO">VIR_CONNECT_RO</a></td><td> = </td><td>1</td><td> : A readonly connection</td></tr><tr><td><a name="VIR_CONNECT_NO_ALIASES" id="VIR_CONNECT_NO_ALIASES">VIR_CONNECT_NO_ALIASES</a></td><td> = </td><td>2</td><td> : Don't try to resolve URI aliases</td></tr></table><pre>}
611
662
</pre></div><h3><a name="virDomain" id="virDomain"><code>virDomain</code></a></h3><div class="api"><pre>struct virDomain{
614
665
</pre></div><h3><a name="virDomainBlockInfo" id="virDomainBlockInfo"><code>virDomainBlockInfo</code></a></h3><div class="api"><pre>struct virDomainBlockInfo{
615
666
</pre><table><tr><td>unsigned long long</td><td>capacity</td><td> : logical size in bytes of the block device backing image</td></tr><tr><td>unsigned long long</td><td>allocation</td><td> : highest allocated extent in bytes of the block device backing image</td></tr><tr><td>unsigned long long</td><td>physical</td><td> : physical size in bytes of the container of the backing image</td></tr></table><pre>
616
667
}
 
668
</pre></div><h3><a name="virDomainBlockJobAbortFlags" id="virDomainBlockJobAbortFlags"><code>virDomainBlockJobAbortFlags</code></a></h3><div class="api"><pre>enum virDomainBlockJobAbortFlags {
 
669
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC" id="VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC">VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT" id="VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT">VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT</a></td><td> = </td><td>2</td></tr></table><pre>}
617
670
</pre></div><h3><a name="virDomainBlockJobInfo" id="virDomainBlockJobInfo"><code>virDomainBlockJobInfo</code></a></h3><div class="api"><pre>struct virDomainBlockJobInfo{
618
671
</pre><table><tr><td><a href="libvirt-libvirt.html#virDomainBlockJobType">virDomainBlockJobType</a></td><td>type</td></tr><tr><td>unsigned long</td><td>bandwidth</td><td> : 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.</td></tr><tr><td><a href="libvirt-libvirt.html#virDomainBlockJobCursor">virDomainBlockJobCursor</a></td><td>cur</td></tr><tr><td><a href="libvirt-libvirt.html#virDomainBlockJobCursor">virDomainBlockJobCursor</a></td><td>end</td></tr></table><pre>
619
672
}
620
673
</pre></div><h3><a name="virDomainBlockJobType" id="virDomainBlockJobType"><code>virDomainBlockJobType</code></a></h3><div class="api"><pre>enum virDomainBlockJobType {
621
 
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN" id="VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN">VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_TYPE_PULL" id="VIR_DOMAIN_BLOCK_JOB_TYPE_PULL">VIR_DOMAIN_BLOCK_JOB_TYPE_PULL</a></td><td> = </td><td>1</td></tr></table><pre>}
 
674
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN" id="VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN">VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_TYPE_PULL" id="VIR_DOMAIN_BLOCK_JOB_TYPE_PULL">VIR_DOMAIN_BLOCK_JOB_TYPE_PULL</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_TYPE_COPY" id="VIR_DOMAIN_BLOCK_JOB_TYPE_COPY">VIR_DOMAIN_BLOCK_JOB_TYPE_COPY</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_JOB_TYPE_LAST" id="VIR_DOMAIN_BLOCK_JOB_TYPE_LAST">VIR_DOMAIN_BLOCK_JOB_TYPE_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
 
675
</pre></div><h3><a name="virDomainBlockRebaseFlags" id="virDomainBlockRebaseFlags"><code>virDomainBlockRebaseFlags</code></a></h3><div class="api"><pre>enum virDomainBlockRebaseFlags {
 
676
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCK_REBASE_SHALLOW" id="VIR_DOMAIN_BLOCK_REBASE_SHALLOW">VIR_DOMAIN_BLOCK_REBASE_SHALLOW</a></td><td> = </td><td>1</td><td> : Limit copy to top of source backing chain</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT" id="VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT">VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT</a></td><td> = </td><td>2</td><td> : Reuse existing external file for a copy</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_REBASE_COPY_RAW" id="VIR_DOMAIN_BLOCK_REBASE_COPY_RAW">VIR_DOMAIN_BLOCK_REBASE_COPY_RAW</a></td><td> = </td><td>4</td><td> : Make destination file raw</td></tr><tr><td><a name="VIR_DOMAIN_BLOCK_REBASE_COPY" id="VIR_DOMAIN_BLOCK_REBASE_COPY">VIR_DOMAIN_BLOCK_REBASE_COPY</a></td><td> = </td><td>8</td><td> : Start a copy job</td></tr></table><pre>}
 
677
</pre></div><h3><a name="virDomainBlockResizeFlags" id="virDomainBlockResizeFlags"><code>virDomainBlockResizeFlags</code></a></h3><div class="api"><pre>enum virDomainBlockResizeFlags {
 
678
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCK_RESIZE_BYTES" id="VIR_DOMAIN_BLOCK_RESIZE_BYTES">VIR_DOMAIN_BLOCK_RESIZE_BYTES</a></td><td> = </td><td>1</td><td> : size in bytes instead of KiB</td></tr></table><pre>}
622
679
</pre></div><h3><a name="virDomainBlockStatsStruct" id="virDomainBlockStatsStruct"><code>virDomainBlockStatsStruct</code></a></h3><div class="api"><pre>struct virDomainBlockStatsStruct{
623
680
</pre><table><tr><td>long long</td><td>rd_req</td><td> : number of read requests</td></tr><tr><td>long long</td><td>rd_bytes</td><td> : number of read bytes</td></tr><tr><td>long long</td><td>wr_req</td><td> : number of write requests</td></tr><tr><td>long long</td><td>wr_bytes</td><td> : number of written bytes</td></tr><tr><td>long long</td><td>errs</td><td> : In Xen this returns the mysterious 'oo_req'.</td></tr></table><pre>
624
681
}
625
682
</pre></div><h3><a name="virDomainBlockedReason" id="virDomainBlockedReason"><code>virDomainBlockedReason</code></a></h3><div class="api"><pre>enum virDomainBlockedReason {
626
 
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCKED_UNKNOWN" id="VIR_DOMAIN_BLOCKED_UNKNOWN">VIR_DOMAIN_BLOCKED_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr></table><pre>}
 
683
</pre><table><tr><td><a name="VIR_DOMAIN_BLOCKED_UNKNOWN" id="VIR_DOMAIN_BLOCKED_UNKNOWN">VIR_DOMAIN_BLOCKED_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr><tr><td><a name="VIR_DOMAIN_BLOCKED_LAST" id="VIR_DOMAIN_BLOCKED_LAST">VIR_DOMAIN_BLOCKED_LAST</a></td><td> = </td><td>1</td></tr></table><pre>}
 
684
</pre></div><h3><a name="virDomainConsoleFlags" id="virDomainConsoleFlags"><code>virDomainConsoleFlags</code></a></h3><div class="api"><pre>enum virDomainConsoleFlags {
 
685
</pre><table><tr><td><a name="VIR_DOMAIN_CONSOLE_FORCE" id="VIR_DOMAIN_CONSOLE_FORCE">VIR_DOMAIN_CONSOLE_FORCE</a></td><td> = </td><td>1</td><td> : abort a (possibly) active console connection to force a new connection</td></tr><tr><td><a name="VIR_DOMAIN_CONSOLE_SAFE" id="VIR_DOMAIN_CONSOLE_SAFE">VIR_DOMAIN_CONSOLE_SAFE</a></td><td> = </td><td>2</td><td> : check if the console driver supports safe console operations</td></tr></table><pre>}
627
686
</pre></div><h3><a name="virDomainControlInfo" id="virDomainControlInfo"><code>virDomainControlInfo</code></a></h3><div class="api"><pre>struct virDomainControlInfo{
628
687
</pre><table><tr><td>unsigned int</td><td>state</td><td> : control state, one of <a href="libvirt-libvirt.html#virDomainControlState">virDomainControlState</a></td></tr><tr><td>unsigned int</td><td>details</td><td> : state details, currently 0</td></tr><tr><td>unsigned long long</td><td>stateTime</td><td> : for how long (in msec) control interface has been in current state (except for OK and ERROR states)</td></tr></table><pre>
629
688
}
630
689
</pre></div><h3><a name="virDomainControlState" id="virDomainControlState"><code>virDomainControlState</code></a></h3><div class="api"><pre>enum virDomainControlState {
631
 
</pre><table><tr><td><a name="VIR_DOMAIN_CONTROL_OK" id="VIR_DOMAIN_CONTROL_OK">VIR_DOMAIN_CONTROL_OK</a></td><td> = </td><td>0</td><td> : operational, ready to accept commands</td></tr><tr><td><a name="VIR_DOMAIN_CONTROL_JOB" id="VIR_DOMAIN_CONTROL_JOB">VIR_DOMAIN_CONTROL_JOB</a></td><td> = </td><td>1</td><td> : background job is running (can be monitored by <a href="libvirt-libvirt.html#virDomainGetJobInfo">virDomainGetJobInfo</a>); only limited set of commands may be allowed</td></tr><tr><td><a name="VIR_DOMAIN_CONTROL_OCCUPIED" id="VIR_DOMAIN_CONTROL_OCCUPIED">VIR_DOMAIN_CONTROL_OCCUPIED</a></td><td> = </td><td>2</td><td> : occupied by a running command</td></tr><tr><td><a name="VIR_DOMAIN_CONTROL_ERROR" id="VIR_DOMAIN_CONTROL_ERROR">VIR_DOMAIN_CONTROL_ERROR</a></td><td> = </td><td>3</td><td> : unusable, domain cannot be fully operated</td></tr></table><pre>}
 
690
</pre><table><tr><td><a name="VIR_DOMAIN_CONTROL_OK" id="VIR_DOMAIN_CONTROL_OK">VIR_DOMAIN_CONTROL_OK</a></td><td> = </td><td>0</td><td> : operational, ready to accept commands</td></tr><tr><td><a name="VIR_DOMAIN_CONTROL_JOB" id="VIR_DOMAIN_CONTROL_JOB">VIR_DOMAIN_CONTROL_JOB</a></td><td> = </td><td>1</td><td> : background job is running (can be monitored by <a href="libvirt-libvirt.html#virDomainGetJobInfo">virDomainGetJobInfo</a>); only limited set of commands may be allowed</td></tr><tr><td><a name="VIR_DOMAIN_CONTROL_OCCUPIED" id="VIR_DOMAIN_CONTROL_OCCUPIED">VIR_DOMAIN_CONTROL_OCCUPIED</a></td><td> = </td><td>2</td><td> : occupied by a running command</td></tr><tr><td><a name="VIR_DOMAIN_CONTROL_ERROR" id="VIR_DOMAIN_CONTROL_ERROR">VIR_DOMAIN_CONTROL_ERROR</a></td><td> = </td><td>3</td><td> : unusable, domain cannot be fully operated</td></tr><tr><td><a name="VIR_DOMAIN_CONTROL_LAST" id="VIR_DOMAIN_CONTROL_LAST">VIR_DOMAIN_CONTROL_LAST</a></td><td> = </td><td>4</td></tr></table><pre>}
632
691
</pre></div><h3><a name="virDomainCoreDumpFlags" id="virDomainCoreDumpFlags"><code>virDomainCoreDumpFlags</code></a></h3><div class="api"><pre>enum virDomainCoreDumpFlags {
633
692
</pre><table><tr><td><a name="VIR_DUMP_CRASH" id="VIR_DUMP_CRASH">VIR_DUMP_CRASH</a></td><td> = </td><td>1</td><td> : crash after dump</td></tr><tr><td><a name="VIR_DUMP_LIVE" id="VIR_DUMP_LIVE">VIR_DUMP_LIVE</a></td><td> = </td><td>2</td><td> : live dump</td></tr><tr><td><a name="VIR_DUMP_BYPASS_CACHE" id="VIR_DUMP_BYPASS_CACHE">VIR_DUMP_BYPASS_CACHE</a></td><td> = </td><td>4</td><td> : avoid file system cache pollution</td></tr><tr><td><a name="VIR_DUMP_RESET" id="VIR_DUMP_RESET">VIR_DUMP_RESET</a></td><td> = </td><td>8</td><td> : reset domain after dump finishes</td></tr></table><pre>}
634
693
</pre></div><h3><a name="virDomainCrashedReason" id="virDomainCrashedReason"><code>virDomainCrashedReason</code></a></h3><div class="api"><pre>enum virDomainCrashedReason {
635
 
</pre><table><tr><td><a name="VIR_DOMAIN_CRASHED_UNKNOWN" id="VIR_DOMAIN_CRASHED_UNKNOWN">VIR_DOMAIN_CRASHED_UNKNOWN</a></td><td> = </td><td>0</td><td> : crashed for unknown reason</td></tr></table><pre>}
 
694
</pre><table><tr><td><a name="VIR_DOMAIN_CRASHED_UNKNOWN" id="VIR_DOMAIN_CRASHED_UNKNOWN">VIR_DOMAIN_CRASHED_UNKNOWN</a></td><td> = </td><td>0</td><td> : crashed for unknown reason</td></tr><tr><td><a name="VIR_DOMAIN_CRASHED_LAST" id="VIR_DOMAIN_CRASHED_LAST">VIR_DOMAIN_CRASHED_LAST</a></td><td> = </td><td>1</td></tr></table><pre>}
636
695
</pre></div><h3><a name="virDomainCreateFlags" id="virDomainCreateFlags"><code>virDomainCreateFlags</code></a></h3><div class="api"><pre>enum virDomainCreateFlags {
637
696
</pre><table><tr><td><a name="VIR_DOMAIN_NONE" id="VIR_DOMAIN_NONE">VIR_DOMAIN_NONE</a></td><td> = </td><td>0</td><td> : Default behavior</td></tr><tr><td><a name="VIR_DOMAIN_START_PAUSED" id="VIR_DOMAIN_START_PAUSED">VIR_DOMAIN_START_PAUSED</a></td><td> = </td><td>1</td><td> : Launch guest in paused state</td></tr><tr><td><a name="VIR_DOMAIN_START_AUTODESTROY" id="VIR_DOMAIN_START_AUTODESTROY">VIR_DOMAIN_START_AUTODESTROY</a></td><td> = </td><td>2</td><td> : Automatically kill guest when <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> is closed</td></tr><tr><td><a name="VIR_DOMAIN_START_BYPASS_CACHE" id="VIR_DOMAIN_START_BYPASS_CACHE">VIR_DOMAIN_START_BYPASS_CACHE</a></td><td> = </td><td>4</td><td> : Avoid file system cache pollution</td></tr><tr><td><a name="VIR_DOMAIN_START_FORCE_BOOT" id="VIR_DOMAIN_START_FORCE_BOOT">VIR_DOMAIN_START_FORCE_BOOT</a></td><td> = </td><td>8</td><td> : Boot, discarding any managed save</td></tr></table><pre>}
 
697
</pre></div><h3><a name="virDomainDestroyFlagsValues" id="virDomainDestroyFlagsValues"><code>virDomainDestroyFlagsValues</code></a></h3><div class="api"><pre>enum virDomainDestroyFlagsValues {
 
698
</pre><table><tr><td><a name="VIR_DOMAIN_DESTROY_DEFAULT" id="VIR_DOMAIN_DESTROY_DEFAULT">VIR_DOMAIN_DESTROY_DEFAULT</a></td><td> = </td><td>0</td><td> : Default behavior - could lead to data loss!!</td></tr><tr><td><a name="VIR_DOMAIN_DESTROY_GRACEFUL" id="VIR_DOMAIN_DESTROY_GRACEFUL">VIR_DOMAIN_DESTROY_GRACEFUL</a></td><td> = </td><td>1</td><td> : only SIGTERM, no SIGKILL</td></tr></table><pre>}
638
699
</pre></div><h3><a name="virDomainDeviceModifyFlags" id="virDomainDeviceModifyFlags"><code>virDomainDeviceModifyFlags</code></a></h3><div class="api"><pre>enum virDomainDeviceModifyFlags {
639
700
</pre><table><tr><td><a name="VIR_DOMAIN_DEVICE_MODIFY_CONFIG" id="VIR_DOMAIN_DEVICE_MODIFY_CONFIG">VIR_DOMAIN_DEVICE_MODIFY_CONFIG</a></td><td> = </td><td>VIR_DOMAIN_AFFECT_CONFIG</td><td> : Additionally, these flags may be bitwise-OR'd in.</td></tr><tr><td><a name="VIR_DOMAIN_DEVICE_MODIFY_CURRENT" id="VIR_DOMAIN_DEVICE_MODIFY_CURRENT">VIR_DOMAIN_DEVICE_MODIFY_CURRENT</a></td><td> = </td><td>VIR_DOMAIN_AFFECT_CURRENT</td></tr><tr><td><a name="VIR_DOMAIN_DEVICE_MODIFY_LIVE" id="VIR_DOMAIN_DEVICE_MODIFY_LIVE">VIR_DOMAIN_DEVICE_MODIFY_LIVE</a></td><td> = </td><td>VIR_DOMAIN_AFFECT_LIVE</td></tr><tr><td><a name="VIR_DOMAIN_DEVICE_MODIFY_FORCE" id="VIR_DOMAIN_DEVICE_MODIFY_FORCE">VIR_DOMAIN_DEVICE_MODIFY_FORCE</a></td><td> = </td><td>4</td><td> : Forcibly modify device (ex. force eject a cdrom)</td></tr></table><pre>}
 
701
</pre></div><h3><a name="virDomainDiskError" id="virDomainDiskError"><code>virDomainDiskError</code></a></h3><div class="api"><pre>struct virDomainDiskError{
 
702
</pre><table><tr><td>char *</td><td>disk</td><td> : disk target</td></tr><tr><td>int</td><td>error</td><td> : <a href="libvirt-libvirt.html#virDomainDiskErrorCode">virDomainDiskErrorCode</a></td></tr></table><pre>
 
703
}
 
704
</pre></div><h3><a name="virDomainDiskErrorCode" id="virDomainDiskErrorCode"><code>virDomainDiskErrorCode</code></a></h3><div class="api"><pre>enum virDomainDiskErrorCode {
 
705
</pre><table><tr><td><a name="VIR_DOMAIN_DISK_ERROR_NONE" id="VIR_DOMAIN_DISK_ERROR_NONE">VIR_DOMAIN_DISK_ERROR_NONE</a></td><td> = </td><td>0</td><td> : no error</td></tr><tr><td><a name="VIR_DOMAIN_DISK_ERROR_UNSPEC" id="VIR_DOMAIN_DISK_ERROR_UNSPEC">VIR_DOMAIN_DISK_ERROR_UNSPEC</a></td><td> = </td><td>1</td><td> : unspecified I/O error</td></tr><tr><td><a name="VIR_DOMAIN_DISK_ERROR_NO_SPACE" id="VIR_DOMAIN_DISK_ERROR_NO_SPACE">VIR_DOMAIN_DISK_ERROR_NO_SPACE</a></td><td> = </td><td>2</td><td> : no space left on the device</td></tr><tr><td><a name="VIR_DOMAIN_DISK_ERROR_LAST" id="VIR_DOMAIN_DISK_ERROR_LAST">VIR_DOMAIN_DISK_ERROR_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
640
706
</pre></div><h3><a name="virDomainEventDefinedDetailType" id="virDomainEventDefinedDetailType"><code>virDomainEventDefinedDetailType</code></a></h3><div class="api"><pre>enum virDomainEventDefinedDetailType {
641
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_DEFINED_ADDED" id="VIR_DOMAIN_EVENT_DEFINED_ADDED">VIR_DOMAIN_EVENT_DEFINED_ADDED</a></td><td> = </td><td>0</td><td> : Newly created config file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_DEFINED_UPDATED" id="VIR_DOMAIN_EVENT_DEFINED_UPDATED">VIR_DOMAIN_EVENT_DEFINED_UPDATED</a></td><td> = </td><td>1</td><td> : Changed config file</td></tr></table><pre>}
 
707
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_DEFINED_ADDED" id="VIR_DOMAIN_EVENT_DEFINED_ADDED">VIR_DOMAIN_EVENT_DEFINED_ADDED</a></td><td> = </td><td>0</td><td> : Newly created config file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_DEFINED_UPDATED" id="VIR_DOMAIN_EVENT_DEFINED_UPDATED">VIR_DOMAIN_EVENT_DEFINED_UPDATED</a></td><td> = </td><td>1</td><td> : Changed config file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_DEFINED_LAST" id="VIR_DOMAIN_EVENT_DEFINED_LAST">VIR_DOMAIN_EVENT_DEFINED_LAST</a></td><td> = </td><td>2</td></tr></table><pre>}
642
708
</pre></div><h3><a name="virDomainEventGraphicsAddress" id="virDomainEventGraphicsAddress"><code>virDomainEventGraphicsAddress</code></a></h3><div class="api"><pre>struct virDomainEventGraphicsAddress{
643
709
</pre><table><tr><td>int</td><td>family</td><td> : Address family, <a href="libvirt-libvirt.html#virDomainEventGraphicsAddressType">virDomainEventGraphicsAddressType</a></td></tr><tr><td>const char *</td><td>node</td><td> : Address of node (eg IP address, or UNIX path)</td></tr><tr><td>const char *</td><td>service</td><td> : Service name/number (eg TCP port, or NULL)</td></tr></table><pre>
644
710
}
645
711
</pre></div><h3><a name="virDomainEventGraphicsAddressType" id="virDomainEventGraphicsAddressType"><code>virDomainEventGraphicsAddressType</code></a></h3><div class="api"><pre>enum virDomainEventGraphicsAddressType {
646
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4" id="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4</a></td><td> = </td><td>1</td><td> : IPv4 address</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6" id="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6</a></td><td> = </td><td>2</td><td> : IPv6 address</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX" id="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX</a></td><td> = </td><td>3</td><td> : UNIX socket path</td></tr></table><pre>}
 
712
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4" id="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV4</a></td><td> = </td><td>1</td><td> : IPv4 address</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6" id="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_IPV6</a></td><td> = </td><td>2</td><td> : IPv6 address</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX" id="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_UNIX</a></td><td> = </td><td>3</td><td> : UNIX socket path</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST" id="VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST">VIR_DOMAIN_EVENT_GRAPHICS_ADDRESS_LAST</a></td><td> = </td><td>4</td></tr></table><pre>}
647
713
</pre></div><h3><a name="virDomainEventGraphicsPhase" id="virDomainEventGraphicsPhase"><code>virDomainEventGraphicsPhase</code></a></h3><div class="api"><pre>enum virDomainEventGraphicsPhase {
648
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_CONNECT" id="VIR_DOMAIN_EVENT_GRAPHICS_CONNECT">VIR_DOMAIN_EVENT_GRAPHICS_CONNECT</a></td><td> = </td><td>0</td><td> : Initial socket connection established</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE" id="VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE">VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE</a></td><td> = </td><td>1</td><td> : Authentication &amp; setup completed</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT" id="VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT">VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT</a></td><td> = </td><td>2</td><td> : Final socket disconnection</td></tr></table><pre>}
 
714
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_CONNECT" id="VIR_DOMAIN_EVENT_GRAPHICS_CONNECT">VIR_DOMAIN_EVENT_GRAPHICS_CONNECT</a></td><td> = </td><td>0</td><td> : Initial socket connection established</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE" id="VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE">VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE</a></td><td> = </td><td>1</td><td> : Authentication &amp; setup completed</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT" id="VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT">VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT</a></td><td> = </td><td>2</td><td> : Final socket disconnection</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_GRAPHICS_LAST" id="VIR_DOMAIN_EVENT_GRAPHICS_LAST">VIR_DOMAIN_EVENT_GRAPHICS_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
649
715
</pre></div><h3><a name="virDomainEventGraphicsSubject" id="virDomainEventGraphicsSubject"><code>virDomainEventGraphicsSubject</code></a></h3><div class="api"><pre>struct virDomainEventGraphicsSubject{
650
716
</pre><table><tr><td>int</td><td>nidentity</td><td> : Number of identities in arra</td></tr><tr><td><a href="libvirt-libvirt.html#virDomainEventGraphicsSubjectIdentityPtr">virDomainEventGraphicsSubjectIdentityPtr</a></td><td>identities</td><td> : Array of identities for subject</td></tr></table><pre>
651
717
}
653
719
</pre><table><tr><td>const char *</td><td>type</td><td> : Type of identity</td></tr><tr><td>const char *</td><td>name</td><td> : Identity value</td></tr></table><pre>
654
720
}
655
721
</pre></div><h3><a name="virDomainEventID" id="virDomainEventID"><code>virDomainEventID</code></a></h3><div class="api"><pre>enum virDomainEventID {
656
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_ID_LIFECYCLE" id="VIR_DOMAIN_EVENT_ID_LIFECYCLE">VIR_DOMAIN_EVENT_ID_LIFECYCLE</a></td><td> = </td><td>0</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_REBOOT" id="VIR_DOMAIN_EVENT_ID_REBOOT">VIR_DOMAIN_EVENT_ID_REBOOT</a></td><td> = </td><td>1</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventGenericCallback">virConnectDomainEventGenericCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_RTC_CHANGE" id="VIR_DOMAIN_EVENT_ID_RTC_CHANGE">VIR_DOMAIN_EVENT_ID_RTC_CHANGE</a></td><td> = </td><td>2</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventRTCChangeCallback">virConnectDomainEventRTCChangeCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_WATCHDOG" id="VIR_DOMAIN_EVENT_ID_WATCHDOG">VIR_DOMAIN_EVENT_ID_WATCHDOG</a></td><td> = </td><td>3</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventWatchdogCallback">virConnectDomainEventWatchdogCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_IO_ERROR" id="VIR_DOMAIN_EVENT_ID_IO_ERROR">VIR_DOMAIN_EVENT_ID_IO_ERROR</a></td><td> = </td><td>4</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventIOErrorCallback">virConnectDomainEventIOErrorCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_GRAPHICS" id="VIR_DOMAIN_EVENT_ID_GRAPHICS">VIR_DOMAIN_EVENT_ID_GRAPHICS</a></td><td> = </td><td>5</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventGraphicsCallback">virConnectDomainEventGraphicsCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON" id="VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON">VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON</a></td><td> = </td><td>6</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventIOErrorReasonCallback">virConnectDomainEventIOErrorReasonCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_CONTROL_ERROR" id="VIR_DOMAIN_EVENT_ID_CONTROL_ERROR">VIR_DOMAIN_EVENT_ID_CONTROL_ERROR</a></td><td> = </td><td>7</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventGenericCallback">virConnectDomainEventGenericCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_BLOCK_JOB" id="VIR_DOMAIN_EVENT_ID_BLOCK_JOB">VIR_DOMAIN_EVENT_ID_BLOCK_JOB</a></td><td> = </td><td>8</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventBlockJobCallback">virConnectDomainEventBlockJobCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_DISK_CHANGE" id="VIR_DOMAIN_EVENT_ID_DISK_CHANGE">VIR_DOMAIN_EVENT_ID_DISK_CHANGE</a></td><td> = </td><td>9</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_LAST" id="VIR_DOMAIN_EVENT_ID_LAST">VIR_DOMAIN_EVENT_ID_LAST</a></td><td> = </td><td>10</td></tr></table><pre>}
 
722
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_ID_LIFECYCLE" id="VIR_DOMAIN_EVENT_ID_LIFECYCLE">VIR_DOMAIN_EVENT_ID_LIFECYCLE</a></td><td> = </td><td>0</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_REBOOT" id="VIR_DOMAIN_EVENT_ID_REBOOT">VIR_DOMAIN_EVENT_ID_REBOOT</a></td><td> = </td><td>1</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventGenericCallback">virConnectDomainEventGenericCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_RTC_CHANGE" id="VIR_DOMAIN_EVENT_ID_RTC_CHANGE">VIR_DOMAIN_EVENT_ID_RTC_CHANGE</a></td><td> = </td><td>2</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventRTCChangeCallback">virConnectDomainEventRTCChangeCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_WATCHDOG" id="VIR_DOMAIN_EVENT_ID_WATCHDOG">VIR_DOMAIN_EVENT_ID_WATCHDOG</a></td><td> = </td><td>3</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventWatchdogCallback">virConnectDomainEventWatchdogCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_IO_ERROR" id="VIR_DOMAIN_EVENT_ID_IO_ERROR">VIR_DOMAIN_EVENT_ID_IO_ERROR</a></td><td> = </td><td>4</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventIOErrorCallback">virConnectDomainEventIOErrorCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_GRAPHICS" id="VIR_DOMAIN_EVENT_ID_GRAPHICS">VIR_DOMAIN_EVENT_ID_GRAPHICS</a></td><td> = </td><td>5</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventGraphicsCallback">virConnectDomainEventGraphicsCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON" id="VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON">VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON</a></td><td> = </td><td>6</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventIOErrorReasonCallback">virConnectDomainEventIOErrorReasonCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_CONTROL_ERROR" id="VIR_DOMAIN_EVENT_ID_CONTROL_ERROR">VIR_DOMAIN_EVENT_ID_CONTROL_ERROR</a></td><td> = </td><td>7</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventGenericCallback">virConnectDomainEventGenericCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_BLOCK_JOB" id="VIR_DOMAIN_EVENT_ID_BLOCK_JOB">VIR_DOMAIN_EVENT_ID_BLOCK_JOB</a></td><td> = </td><td>8</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventBlockJobCallback">virConnectDomainEventBlockJobCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_DISK_CHANGE" id="VIR_DOMAIN_EVENT_ID_DISK_CHANGE">VIR_DOMAIN_EVENT_ID_DISK_CHANGE</a></td><td> = </td><td>9</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventDiskChangeCallback">virConnectDomainEventDiskChangeCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_TRAY_CHANGE" id="VIR_DOMAIN_EVENT_ID_TRAY_CHANGE">VIR_DOMAIN_EVENT_ID_TRAY_CHANGE</a></td><td> = </td><td>10</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventTrayChangeCallback">virConnectDomainEventTrayChangeCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_PMWAKEUP" id="VIR_DOMAIN_EVENT_ID_PMWAKEUP">VIR_DOMAIN_EVENT_ID_PMWAKEUP</a></td><td> = </td><td>11</td><td> : <a href="libvirt-libvirt.html#virConnectDomainEventPMWakeupCallback">virConnectDomainEventPMWakeupCallback</a></td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_PMSUSPEND" id="VIR_DOMAIN_EVENT_ID_PMSUSPEND">VIR_DOMAIN_EVENT_ID_PMSUSPEND</a></td><td> = </td><td>12</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_ID_LAST" id="VIR_DOMAIN_EVENT_ID_LAST">VIR_DOMAIN_EVENT_ID_LAST</a></td><td> = </td><td>13</td></tr></table><pre>}
657
723
</pre></div><h3><a name="virDomainEventIOErrorAction" id="virDomainEventIOErrorAction"><code>virDomainEventIOErrorAction</code></a></h3><div class="api"><pre>enum virDomainEventIOErrorAction {
658
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_IO_ERROR_NONE" id="VIR_DOMAIN_EVENT_IO_ERROR_NONE">VIR_DOMAIN_EVENT_IO_ERROR_NONE</a></td><td> = </td><td>0</td><td> : No action, IO error ignored</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_IO_ERROR_PAUSE" id="VIR_DOMAIN_EVENT_IO_ERROR_PAUSE">VIR_DOMAIN_EVENT_IO_ERROR_PAUSE</a></td><td> = </td><td>1</td><td> : Guest CPUs are pausde</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_IO_ERROR_REPORT" id="VIR_DOMAIN_EVENT_IO_ERROR_REPORT">VIR_DOMAIN_EVENT_IO_ERROR_REPORT</a></td><td> = </td><td>2</td><td> : IO error reported to guest OS</td></tr></table><pre>}
 
724
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_IO_ERROR_NONE" id="VIR_DOMAIN_EVENT_IO_ERROR_NONE">VIR_DOMAIN_EVENT_IO_ERROR_NONE</a></td><td> = </td><td>0</td><td> : No action, IO error ignored</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_IO_ERROR_PAUSE" id="VIR_DOMAIN_EVENT_IO_ERROR_PAUSE">VIR_DOMAIN_EVENT_IO_ERROR_PAUSE</a></td><td> = </td><td>1</td><td> : Guest CPUs are pausde</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_IO_ERROR_REPORT" id="VIR_DOMAIN_EVENT_IO_ERROR_REPORT">VIR_DOMAIN_EVENT_IO_ERROR_REPORT</a></td><td> = </td><td>2</td><td> : IO error reported to guest OS</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_IO_ERROR_LAST" id="VIR_DOMAIN_EVENT_IO_ERROR_LAST">VIR_DOMAIN_EVENT_IO_ERROR_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
659
725
</pre></div><h3><a name="virDomainEventResumedDetailType" id="virDomainEventResumedDetailType"><code>virDomainEventResumedDetailType</code></a></h3><div class="api"><pre>enum virDomainEventResumedDetailType {
660
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED_UNPAUSED" id="VIR_DOMAIN_EVENT_RESUMED_UNPAUSED">VIR_DOMAIN_EVENT_RESUMED_UNPAUSED</a></td><td> = </td><td>0</td><td> : Normal resume due to admin unpause</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED_MIGRATED" id="VIR_DOMAIN_EVENT_RESUMED_MIGRATED">VIR_DOMAIN_EVENT_RESUMED_MIGRATED</a></td><td> = </td><td>1</td><td> : Resumed for completion of migration</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT</a></td><td> = </td><td>2</td><td> : Resumed from snapshot</td></tr></table><pre>}
 
726
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED_UNPAUSED" id="VIR_DOMAIN_EVENT_RESUMED_UNPAUSED">VIR_DOMAIN_EVENT_RESUMED_UNPAUSED</a></td><td> = </td><td>0</td><td> : Normal resume due to admin unpause</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED_MIGRATED" id="VIR_DOMAIN_EVENT_RESUMED_MIGRATED">VIR_DOMAIN_EVENT_RESUMED_MIGRATED</a></td><td> = </td><td>1</td><td> : Resumed for completion of migration</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_RESUMED_FROM_SNAPSHOT</a></td><td> = </td><td>2</td><td> : Resumed from snapshot</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED_LAST" id="VIR_DOMAIN_EVENT_RESUMED_LAST">VIR_DOMAIN_EVENT_RESUMED_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
661
727
</pre></div><h3><a name="virDomainEventShutdownDetailType" id="virDomainEventShutdownDetailType"><code>virDomainEventShutdownDetailType</code></a></h3><div class="api"><pre>enum virDomainEventShutdownDetailType {
662
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED" id="VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED">VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED</a></td><td> = </td><td>0</td><td> : Guest finished shutdown sequence</td></tr></table><pre>}
 
728
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED" id="VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED">VIR_DOMAIN_EVENT_SHUTDOWN_FINISHED</a></td><td> = </td><td>0</td><td> : Guest finished shutdown sequence</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SHUTDOWN_LAST" id="VIR_DOMAIN_EVENT_SHUTDOWN_LAST">VIR_DOMAIN_EVENT_SHUTDOWN_LAST</a></td><td> = </td><td>1</td></tr></table><pre>}
663
729
</pre></div><h3><a name="virDomainEventStartedDetailType" id="virDomainEventStartedDetailType"><code>virDomainEventStartedDetailType</code></a></h3><div class="api"><pre>enum virDomainEventStartedDetailType {
664
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_BOOTED" id="VIR_DOMAIN_EVENT_STARTED_BOOTED">VIR_DOMAIN_EVENT_STARTED_BOOTED</a></td><td> = </td><td>0</td><td> : Normal startup from boot</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_MIGRATED" id="VIR_DOMAIN_EVENT_STARTED_MIGRATED">VIR_DOMAIN_EVENT_STARTED_MIGRATED</a></td><td> = </td><td>1</td><td> : Incoming migration from another host</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_RESTORED" id="VIR_DOMAIN_EVENT_STARTED_RESTORED">VIR_DOMAIN_EVENT_STARTED_RESTORED</a></td><td> = </td><td>2</td><td> : Restored from a state file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT</a></td><td> = </td><td>3</td><td> : Restored from snapshot</td></tr></table><pre>}
 
730
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_BOOTED" id="VIR_DOMAIN_EVENT_STARTED_BOOTED">VIR_DOMAIN_EVENT_STARTED_BOOTED</a></td><td> = </td><td>0</td><td> : Normal startup from boot</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_MIGRATED" id="VIR_DOMAIN_EVENT_STARTED_MIGRATED">VIR_DOMAIN_EVENT_STARTED_MIGRATED</a></td><td> = </td><td>1</td><td> : Incoming migration from another host</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_RESTORED" id="VIR_DOMAIN_EVENT_STARTED_RESTORED">VIR_DOMAIN_EVENT_STARTED_RESTORED</a></td><td> = </td><td>2</td><td> : Restored from a state file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_STARTED_FROM_SNAPSHOT</a></td><td> = </td><td>3</td><td> : Restored from snapshot</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_WAKEUP" id="VIR_DOMAIN_EVENT_STARTED_WAKEUP">VIR_DOMAIN_EVENT_STARTED_WAKEUP</a></td><td> = </td><td>4</td><td> : Started due to wakeup event</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED_LAST" id="VIR_DOMAIN_EVENT_STARTED_LAST">VIR_DOMAIN_EVENT_STARTED_LAST</a></td><td> = </td><td>5</td></tr></table><pre>}
665
731
</pre></div><h3><a name="virDomainEventStoppedDetailType" id="virDomainEventStoppedDetailType"><code>virDomainEventStoppedDetailType</code></a></h3><div class="api"><pre>enum virDomainEventStoppedDetailType {
666
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN" id="VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN">VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN</a></td><td> = </td><td>0</td><td> : Normal shutdown</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_DESTROYED" id="VIR_DOMAIN_EVENT_STOPPED_DESTROYED">VIR_DOMAIN_EVENT_STOPPED_DESTROYED</a></td><td> = </td><td>1</td><td> : Forced poweroff from host</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_CRASHED" id="VIR_DOMAIN_EVENT_STOPPED_CRASHED">VIR_DOMAIN_EVENT_STOPPED_CRASHED</a></td><td> = </td><td>2</td><td> : Guest crashed</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_MIGRATED" id="VIR_DOMAIN_EVENT_STOPPED_MIGRATED">VIR_DOMAIN_EVENT_STOPPED_MIGRATED</a></td><td> = </td><td>3</td><td> : Migrated off to another host</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_SAVED" id="VIR_DOMAIN_EVENT_STOPPED_SAVED">VIR_DOMAIN_EVENT_STOPPED_SAVED</a></td><td> = </td><td>4</td><td> : Saved to a state file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_FAILED" id="VIR_DOMAIN_EVENT_STOPPED_FAILED">VIR_DOMAIN_EVENT_STOPPED_FAILED</a></td><td> = </td><td>5</td><td> : Host emulator/mgmt failed</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT</a></td><td> = </td><td>6</td><td> : offline snapshot loaded</td></tr></table><pre>}
 
732
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN" id="VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN">VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN</a></td><td> = </td><td>0</td><td> : Normal shutdown</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_DESTROYED" id="VIR_DOMAIN_EVENT_STOPPED_DESTROYED">VIR_DOMAIN_EVENT_STOPPED_DESTROYED</a></td><td> = </td><td>1</td><td> : Forced poweroff from host</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_CRASHED" id="VIR_DOMAIN_EVENT_STOPPED_CRASHED">VIR_DOMAIN_EVENT_STOPPED_CRASHED</a></td><td> = </td><td>2</td><td> : Guest crashed</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_MIGRATED" id="VIR_DOMAIN_EVENT_STOPPED_MIGRATED">VIR_DOMAIN_EVENT_STOPPED_MIGRATED</a></td><td> = </td><td>3</td><td> : Migrated off to another host</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_SAVED" id="VIR_DOMAIN_EVENT_STOPPED_SAVED">VIR_DOMAIN_EVENT_STOPPED_SAVED</a></td><td> = </td><td>4</td><td> : Saved to a state file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_FAILED" id="VIR_DOMAIN_EVENT_STOPPED_FAILED">VIR_DOMAIN_EVENT_STOPPED_FAILED</a></td><td> = </td><td>5</td><td> : Host emulator/mgmt failed</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT</a></td><td> = </td><td>6</td><td> : offline snapshot loaded</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED_LAST" id="VIR_DOMAIN_EVENT_STOPPED_LAST">VIR_DOMAIN_EVENT_STOPPED_LAST</a></td><td> = </td><td>7</td></tr></table><pre>}
667
733
</pre></div><h3><a name="virDomainEventSuspendedDetailType" id="virDomainEventSuspendedDetailType"><code>virDomainEventSuspendedDetailType</code></a></h3><div class="api"><pre>enum virDomainEventSuspendedDetailType {
668
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_PAUSED" id="VIR_DOMAIN_EVENT_SUSPENDED_PAUSED">VIR_DOMAIN_EVENT_SUSPENDED_PAUSED</a></td><td> = </td><td>0</td><td> : Normal suspend due to admin pause</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED" id="VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED">VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED</a></td><td> = </td><td>1</td><td> : Suspended for offline migration</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_IOERROR" id="VIR_DOMAIN_EVENT_SUSPENDED_IOERROR">VIR_DOMAIN_EVENT_SUSPENDED_IOERROR</a></td><td> = </td><td>2</td><td> : Suspended due to a disk I/O error</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG" id="VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG">VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG</a></td><td> = </td><td>3</td><td> : Suspended due to a watchdog firing</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_RESTORED" id="VIR_DOMAIN_EVENT_SUSPENDED_RESTORED">VIR_DOMAIN_EVENT_SUSPENDED_RESTORED</a></td><td> = </td><td>4</td><td> : Restored from paused state file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT</a></td><td> = </td><td>5</td><td> : Restored from paused snapshot</td></tr></table><pre>}
 
734
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_PAUSED" id="VIR_DOMAIN_EVENT_SUSPENDED_PAUSED">VIR_DOMAIN_EVENT_SUSPENDED_PAUSED</a></td><td> = </td><td>0</td><td> : Normal suspend due to admin pause</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED" id="VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED">VIR_DOMAIN_EVENT_SUSPENDED_MIGRATED</a></td><td> = </td><td>1</td><td> : Suspended for offline migration</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_IOERROR" id="VIR_DOMAIN_EVENT_SUSPENDED_IOERROR">VIR_DOMAIN_EVENT_SUSPENDED_IOERROR</a></td><td> = </td><td>2</td><td> : Suspended due to a disk I/O error</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG" id="VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG">VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG</a></td><td> = </td><td>3</td><td> : Suspended due to a watchdog firing</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_RESTORED" id="VIR_DOMAIN_EVENT_SUSPENDED_RESTORED">VIR_DOMAIN_EVENT_SUSPENDED_RESTORED</a></td><td> = </td><td>4</td><td> : Restored from paused state file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT" id="VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT">VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT</a></td><td> = </td><td>5</td><td> : Restored from paused snapshot</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED_LAST" id="VIR_DOMAIN_EVENT_SUSPENDED_LAST">VIR_DOMAIN_EVENT_SUSPENDED_LAST</a></td><td> = </td><td>6</td></tr></table><pre>}
 
735
</pre></div><h3><a name="virDomainEventTrayChangeReason" id="virDomainEventTrayChangeReason"><code>virDomainEventTrayChangeReason</code></a></h3><div class="api"><pre>enum virDomainEventTrayChangeReason {
 
736
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN" id="VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN">VIR_DOMAIN_EVENT_TRAY_CHANGE_OPEN</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE" id="VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE">VIR_DOMAIN_EVENT_TRAY_CHANGE_CLOSE</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST" id="VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST">VIR_DOMAIN_EVENT_TRAY_CHANGE_LAST</a></td><td> = </td><td>2</td></tr></table><pre>}
669
737
</pre></div><h3><a name="virDomainEventType" id="virDomainEventType"><code>virDomainEventType</code></a></h3><div class="api"><pre>enum virDomainEventType {
670
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_DEFINED" id="VIR_DOMAIN_EVENT_DEFINED">VIR_DOMAIN_EVENT_DEFINED</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_UNDEFINED" id="VIR_DOMAIN_EVENT_UNDEFINED">VIR_DOMAIN_EVENT_UNDEFINED</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED" id="VIR_DOMAIN_EVENT_STARTED">VIR_DOMAIN_EVENT_STARTED</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED" id="VIR_DOMAIN_EVENT_SUSPENDED">VIR_DOMAIN_EVENT_SUSPENDED</a></td><td> = </td><td>3</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED" id="VIR_DOMAIN_EVENT_RESUMED">VIR_DOMAIN_EVENT_RESUMED</a></td><td> = </td><td>4</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED" id="VIR_DOMAIN_EVENT_STOPPED">VIR_DOMAIN_EVENT_STOPPED</a></td><td> = </td><td>5</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SHUTDOWN" id="VIR_DOMAIN_EVENT_SHUTDOWN">VIR_DOMAIN_EVENT_SHUTDOWN</a></td><td> = </td><td>6</td></tr></table><pre>}
 
738
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_DEFINED" id="VIR_DOMAIN_EVENT_DEFINED">VIR_DOMAIN_EVENT_DEFINED</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_UNDEFINED" id="VIR_DOMAIN_EVENT_UNDEFINED">VIR_DOMAIN_EVENT_UNDEFINED</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STARTED" id="VIR_DOMAIN_EVENT_STARTED">VIR_DOMAIN_EVENT_STARTED</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SUSPENDED" id="VIR_DOMAIN_EVENT_SUSPENDED">VIR_DOMAIN_EVENT_SUSPENDED</a></td><td> = </td><td>3</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_RESUMED" id="VIR_DOMAIN_EVENT_RESUMED">VIR_DOMAIN_EVENT_RESUMED</a></td><td> = </td><td>4</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_STOPPED" id="VIR_DOMAIN_EVENT_STOPPED">VIR_DOMAIN_EVENT_STOPPED</a></td><td> = </td><td>5</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_SHUTDOWN" id="VIR_DOMAIN_EVENT_SHUTDOWN">VIR_DOMAIN_EVENT_SHUTDOWN</a></td><td> = </td><td>6</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_LAST" id="VIR_DOMAIN_EVENT_LAST">VIR_DOMAIN_EVENT_LAST</a></td><td> = </td><td>7</td></tr></table><pre>}
671
739
</pre></div><h3><a name="virDomainEventUndefinedDetailType" id="virDomainEventUndefinedDetailType"><code>virDomainEventUndefinedDetailType</code></a></h3><div class="api"><pre>enum virDomainEventUndefinedDetailType {
672
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_UNDEFINED_REMOVED" id="VIR_DOMAIN_EVENT_UNDEFINED_REMOVED">VIR_DOMAIN_EVENT_UNDEFINED_REMOVED</a></td><td> = </td><td>0</td><td> : Deleted the config file</td></tr></table><pre>}
 
740
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_UNDEFINED_REMOVED" id="VIR_DOMAIN_EVENT_UNDEFINED_REMOVED">VIR_DOMAIN_EVENT_UNDEFINED_REMOVED</a></td><td> = </td><td>0</td><td> : Deleted the config file</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_UNDEFINED_LAST" id="VIR_DOMAIN_EVENT_UNDEFINED_LAST">VIR_DOMAIN_EVENT_UNDEFINED_LAST</a></td><td> = </td><td>1</td></tr></table><pre>}
673
741
</pre></div><h3><a name="virDomainEventWatchdogAction" id="virDomainEventWatchdogAction"><code>virDomainEventWatchdogAction</code></a></h3><div class="api"><pre>enum virDomainEventWatchdogAction {
674
 
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_NONE" id="VIR_DOMAIN_EVENT_WATCHDOG_NONE">VIR_DOMAIN_EVENT_WATCHDOG_NONE</a></td><td> = </td><td>0</td><td> : No action, watchdog ignored</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_PAUSE" id="VIR_DOMAIN_EVENT_WATCHDOG_PAUSE">VIR_DOMAIN_EVENT_WATCHDOG_PAUSE</a></td><td> = </td><td>1</td><td> : Guest CPUs are paused</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_RESET" id="VIR_DOMAIN_EVENT_WATCHDOG_RESET">VIR_DOMAIN_EVENT_WATCHDOG_RESET</a></td><td> = </td><td>2</td><td> : Guest CPUs are reset</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF" id="VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF">VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF</a></td><td> = </td><td>3</td><td> : Guest is forcably powered off</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN" id="VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN">VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN</a></td><td> = </td><td>4</td><td> : Guest is requested to gracefully shutdown</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_DEBUG" id="VIR_DOMAIN_EVENT_WATCHDOG_DEBUG">VIR_DOMAIN_EVENT_WATCHDOG_DEBUG</a></td><td> = </td><td>5</td><td> : No action, a debug message logged</td></tr></table><pre>}
 
742
</pre><table><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_NONE" id="VIR_DOMAIN_EVENT_WATCHDOG_NONE">VIR_DOMAIN_EVENT_WATCHDOG_NONE</a></td><td> = </td><td>0</td><td> : No action, watchdog ignored</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_PAUSE" id="VIR_DOMAIN_EVENT_WATCHDOG_PAUSE">VIR_DOMAIN_EVENT_WATCHDOG_PAUSE</a></td><td> = </td><td>1</td><td> : Guest CPUs are paused</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_RESET" id="VIR_DOMAIN_EVENT_WATCHDOG_RESET">VIR_DOMAIN_EVENT_WATCHDOG_RESET</a></td><td> = </td><td>2</td><td> : Guest CPUs are reset</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF" id="VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF">VIR_DOMAIN_EVENT_WATCHDOG_POWEROFF</a></td><td> = </td><td>3</td><td> : Guest is forcably powered off</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN" id="VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN">VIR_DOMAIN_EVENT_WATCHDOG_SHUTDOWN</a></td><td> = </td><td>4</td><td> : Guest is requested to gracefully shutdown</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_DEBUG" id="VIR_DOMAIN_EVENT_WATCHDOG_DEBUG">VIR_DOMAIN_EVENT_WATCHDOG_DEBUG</a></td><td> = </td><td>5</td><td> : No action, a debug message logged</td></tr><tr><td><a name="VIR_DOMAIN_EVENT_WATCHDOG_LAST" id="VIR_DOMAIN_EVENT_WATCHDOG_LAST">VIR_DOMAIN_EVENT_WATCHDOG_LAST</a></td><td> = </td><td>6</td></tr></table><pre>}
675
743
</pre></div><h3><a name="virDomainInfo" id="virDomainInfo"><code>virDomainInfo</code></a></h3><div class="api"><pre>struct virDomainInfo{
676
744
</pre><table><tr><td>unsigned char</td><td>state</td><td> : the running state, one of <a href="libvirt-libvirt.html#virDomainState">virDomainState</a></td></tr><tr><td>unsigned long</td><td>maxMem</td><td> : the maximum memory in KBytes allowed</td></tr><tr><td>unsigned long</td><td>memory</td><td> : the memory in KBytes used by the domain</td></tr><tr><td>unsigned short</td><td>nrVirtCpu</td><td> : the number of virtual CPUs for the domain</td></tr><tr><td>unsigned long long</td><td>cpuTime</td><td> : the CPU time used in nanoseconds</td></tr></table><pre>
677
745
}
682
750
</pre><table><tr><td>int</td><td>type</td><td> : Time is measured in mill-seconds</td></tr><tr><td>unsigned long long</td><td>timeElapsed</td><td> : Always set</td></tr><tr><td>unsigned long long</td><td>timeRemaining</td><td> : Only for <a href="libvirt-libvirt.html#VIR_DOMAIN_JOB_BOUNDED">VIR_DOMAIN_JOB_BOUNDED</a> Data is measured in bytes unless otherwise specified and is measuring the job as a whole For <a href="libvirt-libvirt.html#VIR_DOMAIN_JOB_UNBOUNDED">VIR_DOMAIN_JOB_UNBOUNDED</a>, dataTotal may be less than the final sum of dataProcessed + dataRemaining in the event that the hypervisor has to repeat some data eg due to dirtied pages during migration For <a href="libvirt-libvirt.html#VIR_DOMAIN_JOB_BOUNDED">VIR_DOMAIN_JOB_BOUNDED</a>, dataTotal shall always equal sum of dataProcessed + dataRemaining</td></tr><tr><td>unsigned long long</td><td>dataTotal</td></tr><tr><td>unsigned long long</td><td>dataProcessed</td></tr><tr><td>unsigned long long</td><td>dataRemaining</td><td> : As above, but only tracking guest memory progress</td></tr><tr><td>unsigned long long</td><td>memTotal</td></tr><tr><td>unsigned long long</td><td>memProcessed</td></tr><tr><td>unsigned long long</td><td>memRemaining</td><td> : As above, but only tracking guest disk file progress</td></tr><tr><td>unsigned long long</td><td>fileTotal</td></tr><tr><td>unsigned long long</td><td>fileProcessed</td></tr><tr><td>unsigned long long</td><td>fileRemaining</td></tr></table><pre>
683
751
}
684
752
</pre></div><h3><a name="virDomainJobType" id="virDomainJobType"><code>virDomainJobType</code></a></h3><div class="api"><pre>enum virDomainJobType {
685
 
</pre><table><tr><td><a name="VIR_DOMAIN_JOB_NONE" id="VIR_DOMAIN_JOB_NONE">VIR_DOMAIN_JOB_NONE</a></td><td> = </td><td>0</td><td> : No job is active</td></tr><tr><td><a name="VIR_DOMAIN_JOB_BOUNDED" id="VIR_DOMAIN_JOB_BOUNDED">VIR_DOMAIN_JOB_BOUNDED</a></td><td> = </td><td>1</td><td> : Job with a finite completion time</td></tr><tr><td><a name="VIR_DOMAIN_JOB_UNBOUNDED" id="VIR_DOMAIN_JOB_UNBOUNDED">VIR_DOMAIN_JOB_UNBOUNDED</a></td><td> = </td><td>2</td><td> : Job without a finite completion time</td></tr><tr><td><a name="VIR_DOMAIN_JOB_COMPLETED" id="VIR_DOMAIN_JOB_COMPLETED">VIR_DOMAIN_JOB_COMPLETED</a></td><td> = </td><td>3</td><td> : Job has finished, but isn't cleaned up</td></tr><tr><td><a name="VIR_DOMAIN_JOB_FAILED" id="VIR_DOMAIN_JOB_FAILED">VIR_DOMAIN_JOB_FAILED</a></td><td> = </td><td>4</td><td> : Job hit error, but isn't cleaned up</td></tr><tr><td><a name="VIR_DOMAIN_JOB_CANCELLED" id="VIR_DOMAIN_JOB_CANCELLED">VIR_DOMAIN_JOB_CANCELLED</a></td><td> = </td><td>5</td><td> : Job was aborted, but isn't cleaned up</td></tr></table><pre>}
 
753
</pre><table><tr><td><a name="VIR_DOMAIN_JOB_NONE" id="VIR_DOMAIN_JOB_NONE">VIR_DOMAIN_JOB_NONE</a></td><td> = </td><td>0</td><td> : No job is active</td></tr><tr><td><a name="VIR_DOMAIN_JOB_BOUNDED" id="VIR_DOMAIN_JOB_BOUNDED">VIR_DOMAIN_JOB_BOUNDED</a></td><td> = </td><td>1</td><td> : Job with a finite completion time</td></tr><tr><td><a name="VIR_DOMAIN_JOB_UNBOUNDED" id="VIR_DOMAIN_JOB_UNBOUNDED">VIR_DOMAIN_JOB_UNBOUNDED</a></td><td> = </td><td>2</td><td> : Job without a finite completion time</td></tr><tr><td><a name="VIR_DOMAIN_JOB_COMPLETED" id="VIR_DOMAIN_JOB_COMPLETED">VIR_DOMAIN_JOB_COMPLETED</a></td><td> = </td><td>3</td><td> : Job has finished, but isn't cleaned up</td></tr><tr><td><a name="VIR_DOMAIN_JOB_FAILED" id="VIR_DOMAIN_JOB_FAILED">VIR_DOMAIN_JOB_FAILED</a></td><td> = </td><td>4</td><td> : Job hit error, but isn't cleaned up</td></tr><tr><td><a name="VIR_DOMAIN_JOB_CANCELLED" id="VIR_DOMAIN_JOB_CANCELLED">VIR_DOMAIN_JOB_CANCELLED</a></td><td> = </td><td>5</td><td> : Job was aborted, but isn't cleaned up</td></tr><tr><td><a name="VIR_DOMAIN_JOB_LAST" id="VIR_DOMAIN_JOB_LAST">VIR_DOMAIN_JOB_LAST</a></td><td> = </td><td>6</td></tr></table><pre>}
686
754
</pre></div><h3><a name="virDomainMemoryFlags" id="virDomainMemoryFlags"><code>virDomainMemoryFlags</code></a></h3><div class="api"><pre>enum virDomainMemoryFlags {
687
755
</pre><table><tr><td><a name="VIR_MEMORY_VIRTUAL" id="VIR_MEMORY_VIRTUAL">VIR_MEMORY_VIRTUAL</a></td><td> = </td><td>1</td><td> : addresses are virtual addresses</td></tr><tr><td><a name="VIR_MEMORY_PHYSICAL" id="VIR_MEMORY_PHYSICAL">VIR_MEMORY_PHYSICAL</a></td><td> = </td><td>2</td><td> : addresses are physical addresses</td></tr></table><pre>}
688
756
</pre></div><h3><a name="virDomainMemoryModFlags" id="virDomainMemoryModFlags"><code>virDomainMemoryModFlags</code></a></h3><div class="api"><pre>enum virDomainMemoryModFlags {
691
759
</pre><table><tr><td>int</td><td>tag</td></tr><tr><td>unsigned long long</td><td>val</td></tr></table><pre>
692
760
}
693
761
</pre></div><h3><a name="virDomainMemoryStatTags" id="virDomainMemoryStatTags"><code>virDomainMemoryStatTags</code></a></h3><div class="api"><pre>enum virDomainMemoryStatTags {
694
 
</pre><table><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_SWAP_IN" id="VIR_DOMAIN_MEMORY_STAT_SWAP_IN">VIR_DOMAIN_MEMORY_STAT_SWAP_IN</a></td><td> = </td><td>0</td><td> : The total amount of memory written out to swap space (in kB).</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_SWAP_OUT" id="VIR_DOMAIN_MEMORY_STAT_SWAP_OUT">VIR_DOMAIN_MEMORY_STAT_SWAP_OUT</a></td><td> = </td><td>1</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT" id="VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT" id="VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT</a></td><td> = </td><td>3</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_UNUSED" id="VIR_DOMAIN_MEMORY_STAT_UNUSED">VIR_DOMAIN_MEMORY_STAT_UNUSED</a></td><td> = </td><td>4</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_AVAILABLE" id="VIR_DOMAIN_MEMORY_STAT_AVAILABLE">VIR_DOMAIN_MEMORY_STAT_AVAILABLE</a></td><td> = </td><td>5</td><td> : Current balloon value (in KB).</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON" id="VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON">VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON</a></td><td> = </td><td>6</td><td> : The number of statistics supported by this version of the interface. To add new statistics, add them to the enum and increase this value.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_NR" id="VIR_DOMAIN_MEMORY_STAT_NR">VIR_DOMAIN_MEMORY_STAT_NR</a></td><td> = </td><td>7</td></tr></table><pre>}
 
762
</pre><table><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_LAST" id="VIR_DOMAIN_MEMORY_STAT_LAST">VIR_DOMAIN_MEMORY_STAT_LAST</a></td><td> = </td><td>VIR_DOMAIN_MEMORY_STAT_NR</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_SWAP_IN" id="VIR_DOMAIN_MEMORY_STAT_SWAP_IN">VIR_DOMAIN_MEMORY_STAT_SWAP_IN</a></td><td> = </td><td>0</td><td> : The total amount of memory written out to swap space (in kB).</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_SWAP_OUT" id="VIR_DOMAIN_MEMORY_STAT_SWAP_OUT">VIR_DOMAIN_MEMORY_STAT_SWAP_OUT</a></td><td> = </td><td>1</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT" id="VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT</a></td><td> = </td><td>2</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT" id="VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT</a></td><td> = </td><td>3</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_UNUSED" id="VIR_DOMAIN_MEMORY_STAT_UNUSED">VIR_DOMAIN_MEMORY_STAT_UNUSED</a></td><td> = </td><td>4</td><td> : 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.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_AVAILABLE" id="VIR_DOMAIN_MEMORY_STAT_AVAILABLE">VIR_DOMAIN_MEMORY_STAT_AVAILABLE</a></td><td> = </td><td>5</td><td> : Current balloon value (in KB).</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON" id="VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON">VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON</a></td><td> = </td><td>6</td><td> : Resident Set Size of the process running the domain. This value is in kB</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_RSS" id="VIR_DOMAIN_MEMORY_STAT_RSS">VIR_DOMAIN_MEMORY_STAT_RSS</a></td><td> = </td><td>7</td><td> : The number of statistics supported by this version of the interface. To add new statistics, add them to the enum and increase this value.</td></tr><tr><td><a name="VIR_DOMAIN_MEMORY_STAT_NR" id="VIR_DOMAIN_MEMORY_STAT_NR">VIR_DOMAIN_MEMORY_STAT_NR</a></td><td> = </td><td>8</td></tr></table><pre>}
 
763
</pre></div><h3><a name="virDomainMetadataType" id="virDomainMetadataType"><code>virDomainMetadataType</code></a></h3><div class="api"><pre>enum virDomainMetadataType {
 
764
</pre><table><tr><td><a name="VIR_DOMAIN_METADATA_DESCRIPTION" id="VIR_DOMAIN_METADATA_DESCRIPTION">VIR_DOMAIN_METADATA_DESCRIPTION</a></td><td> = </td><td>0</td><td> : Operate on &lt;description&gt;</td></tr><tr><td><a name="VIR_DOMAIN_METADATA_TITLE" id="VIR_DOMAIN_METADATA_TITLE">VIR_DOMAIN_METADATA_TITLE</a></td><td> = </td><td>1</td><td> : Operate on &lt;title&gt;</td></tr><tr><td><a name="VIR_DOMAIN_METADATA_ELEMENT" id="VIR_DOMAIN_METADATA_ELEMENT">VIR_DOMAIN_METADATA_ELEMENT</a></td><td> = </td><td>2</td><td> : Operate on &lt;metadata&gt;</td></tr><tr><td><a name="VIR_DOMAIN_METADATA_LAST" id="VIR_DOMAIN_METADATA_LAST">VIR_DOMAIN_METADATA_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
695
765
</pre></div><h3><a name="virDomainMigrateFlags" id="virDomainMigrateFlags"><code>virDomainMigrateFlags</code></a></h3><div class="api"><pre>enum virDomainMigrateFlags {
696
 
</pre><table><tr><td><a name="VIR_MIGRATE_LIVE" id="VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a></td><td> = </td><td>1</td><td> : live migration</td></tr><tr><td><a name="VIR_MIGRATE_PEER2PEER" id="VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a></td><td> = </td><td>2</td><td> : direct source -&gt; dest host control channel Note the less-common spelling that we're stuck with: <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> should be VIR_MIGRATE_TUNNELED</td></tr><tr><td><a name="VIR_MIGRATE_TUNNELLED" id="VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a></td><td> = </td><td>4</td><td> : tunnel migration data over libvirtd connection</td></tr><tr><td><a name="VIR_MIGRATE_PERSIST_DEST" id="VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a></td><td> = </td><td>8</td><td> : persist the VM on the destination</td></tr><tr><td><a name="VIR_MIGRATE_UNDEFINE_SOURCE" id="VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a></td><td> = </td><td>16</td><td> : undefine the VM on the source</td></tr><tr><td><a name="VIR_MIGRATE_PAUSED" id="VIR_MIGRATE_PAUSED">VIR_MIGRATE_PAUSED</a></td><td> = </td><td>32</td><td> : pause on remote side</td></tr><tr><td><a name="VIR_MIGRATE_NON_SHARED_DISK" id="VIR_MIGRATE_NON_SHARED_DISK">VIR_MIGRATE_NON_SHARED_DISK</a></td><td> = </td><td>64</td><td> : migration with non-shared storage with full disk copy</td></tr><tr><td><a name="VIR_MIGRATE_NON_SHARED_INC" id="VIR_MIGRATE_NON_SHARED_INC">VIR_MIGRATE_NON_SHARED_INC</a></td><td> = </td><td>128</td><td> : migration with non-shared storage with incremental copy (same base image shared between source and destination)</td></tr><tr><td><a name="VIR_MIGRATE_CHANGE_PROTECTION" id="VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a></td><td> = </td><td>256</td><td> : protect for changing domain configuration through the whole migration process; this will be used automatically when supported</td></tr></table><pre>}
 
766
</pre><table><tr><td><a name="VIR_MIGRATE_LIVE" id="VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a></td><td> = </td><td>1</td><td> : live migration</td></tr><tr><td><a name="VIR_MIGRATE_PEER2PEER" id="VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a></td><td> = </td><td>2</td><td> : direct source -&gt; dest host control channel Note the less-common spelling that we're stuck with: <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> should be VIR_MIGRATE_TUNNELED</td></tr><tr><td><a name="VIR_MIGRATE_TUNNELLED" id="VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a></td><td> = </td><td>4</td><td> : tunnel migration data over libvirtd connection</td></tr><tr><td><a name="VIR_MIGRATE_PERSIST_DEST" id="VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a></td><td> = </td><td>8</td><td> : persist the VM on the destination</td></tr><tr><td><a name="VIR_MIGRATE_UNDEFINE_SOURCE" id="VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a></td><td> = </td><td>16</td><td> : undefine the VM on the source</td></tr><tr><td><a name="VIR_MIGRATE_PAUSED" id="VIR_MIGRATE_PAUSED">VIR_MIGRATE_PAUSED</a></td><td> = </td><td>32</td><td> : pause on remote side</td></tr><tr><td><a name="VIR_MIGRATE_NON_SHARED_DISK" id="VIR_MIGRATE_NON_SHARED_DISK">VIR_MIGRATE_NON_SHARED_DISK</a></td><td> = </td><td>64</td><td> : migration with non-shared storage with full disk copy</td></tr><tr><td><a name="VIR_MIGRATE_NON_SHARED_INC" id="VIR_MIGRATE_NON_SHARED_INC">VIR_MIGRATE_NON_SHARED_INC</a></td><td> = </td><td>128</td><td> : migration with non-shared storage with incremental copy (same base image shared between source and destination)</td></tr><tr><td><a name="VIR_MIGRATE_CHANGE_PROTECTION" id="VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a></td><td> = </td><td>256</td><td> : protect for changing domain configuration through the whole migration process; this will be used automatically when supported</td></tr><tr><td><a name="VIR_MIGRATE_UNSAFE" id="VIR_MIGRATE_UNSAFE">VIR_MIGRATE_UNSAFE</a></td><td> = </td><td>512</td><td> : force migration even if it is considered unsafe</td></tr></table><pre>}
697
767
</pre></div><h3><a name="virDomainModificationImpact" id="virDomainModificationImpact"><code>virDomainModificationImpact</code></a></h3><div class="api"><pre>enum virDomainModificationImpact {
698
768
</pre><table><tr><td><a name="VIR_DOMAIN_AFFECT_CURRENT" id="VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a></td><td> = </td><td>0</td><td> : Affect current domain state.</td></tr><tr><td><a name="VIR_DOMAIN_AFFECT_LIVE" id="VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a></td><td> = </td><td>1</td><td> : Affect running domain state.</td></tr><tr><td><a name="VIR_DOMAIN_AFFECT_CONFIG" id="VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a></td><td> = </td><td>2</td><td> : Affect persistent domain state. 1 &lt;&lt; 2 is reserved for <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr></table><pre>}
699
769
</pre></div><h3><a name="virDomainNostateReason" id="virDomainNostateReason"><code>virDomainNostateReason</code></a></h3><div class="api"><pre>enum virDomainNostateReason {
700
 
</pre><table><tr><td><a name="VIR_DOMAIN_NOSTATE_UNKNOWN" id="VIR_DOMAIN_NOSTATE_UNKNOWN">VIR_DOMAIN_NOSTATE_UNKNOWN</a></td><td> = </td><td>0</td></tr></table><pre>}
 
770
</pre><table><tr><td><a name="VIR_DOMAIN_NOSTATE_UNKNOWN" id="VIR_DOMAIN_NOSTATE_UNKNOWN">VIR_DOMAIN_NOSTATE_UNKNOWN</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_NOSTATE_LAST" id="VIR_DOMAIN_NOSTATE_LAST">VIR_DOMAIN_NOSTATE_LAST</a></td><td> = </td><td>1</td></tr></table><pre>}
 
771
</pre></div><h3><a name="virDomainNumatuneMemMode" id="virDomainNumatuneMemMode"><code>virDomainNumatuneMemMode</code></a></h3><div class="api"><pre>enum virDomainNumatuneMemMode {
 
772
</pre><table><tr><td><a name="VIR_DOMAIN_NUMATUNE_MEM_STRICT" id="VIR_DOMAIN_NUMATUNE_MEM_STRICT">VIR_DOMAIN_NUMATUNE_MEM_STRICT</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_NUMATUNE_MEM_PREFERRED" id="VIR_DOMAIN_NUMATUNE_MEM_PREFERRED">VIR_DOMAIN_NUMATUNE_MEM_PREFERRED</a></td><td> = </td><td>1</td></tr><tr><td><a name="VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE" id="VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE">VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE</a></td><td> = </td><td>2</td><td> : This constant is subject to change</td></tr><tr><td><a name="VIR_DOMAIN_NUMATUNE_MEM_LAST" id="VIR_DOMAIN_NUMATUNE_MEM_LAST">VIR_DOMAIN_NUMATUNE_MEM_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
701
773
</pre></div><h3><a name="virDomainOpenGraphicsFlags" id="virDomainOpenGraphicsFlags"><code>virDomainOpenGraphicsFlags</code></a></h3><div class="api"><pre>enum virDomainOpenGraphicsFlags {
702
774
</pre><table><tr><td><a name="VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH" id="VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH">VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH</a></td><td> = </td><td>1</td></tr></table><pre>}
 
775
</pre></div><h3><a name="virDomainPMSuspendedReason" id="virDomainPMSuspendedReason"><code>virDomainPMSuspendedReason</code></a></h3><div class="api"><pre>enum virDomainPMSuspendedReason {
 
776
</pre><table><tr><td><a name="VIR_DOMAIN_PMSUSPENDED_UNKNOWN" id="VIR_DOMAIN_PMSUSPENDED_UNKNOWN">VIR_DOMAIN_PMSUSPENDED_UNKNOWN</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_PMSUSPENDED_LAST" id="VIR_DOMAIN_PMSUSPENDED_LAST">VIR_DOMAIN_PMSUSPENDED_LAST</a></td><td> = </td><td>1</td></tr></table><pre>}
703
777
</pre></div><h3><a name="virDomainPausedReason" id="virDomainPausedReason"><code>virDomainPausedReason</code></a></h3><div class="api"><pre>enum virDomainPausedReason {
704
 
</pre><table><tr><td><a name="VIR_DOMAIN_PAUSED_UNKNOWN" id="VIR_DOMAIN_PAUSED_UNKNOWN">VIR_DOMAIN_PAUSED_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_USER" id="VIR_DOMAIN_PAUSED_USER">VIR_DOMAIN_PAUSED_USER</a></td><td> = </td><td>1</td><td> : paused on user request</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_MIGRATION" id="VIR_DOMAIN_PAUSED_MIGRATION">VIR_DOMAIN_PAUSED_MIGRATION</a></td><td> = </td><td>2</td><td> : paused for offline migration</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_SAVE" id="VIR_DOMAIN_PAUSED_SAVE">VIR_DOMAIN_PAUSED_SAVE</a></td><td> = </td><td>3</td><td> : paused for save</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_DUMP" id="VIR_DOMAIN_PAUSED_DUMP">VIR_DOMAIN_PAUSED_DUMP</a></td><td> = </td><td>4</td><td> : paused for offline core dump</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_IOERROR" id="VIR_DOMAIN_PAUSED_IOERROR">VIR_DOMAIN_PAUSED_IOERROR</a></td><td> = </td><td>5</td><td> : paused due to a disk I/O error</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_WATCHDOG" id="VIR_DOMAIN_PAUSED_WATCHDOG">VIR_DOMAIN_PAUSED_WATCHDOG</a></td><td> = </td><td>6</td><td> : paused due to a watchdog event</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_FROM_SNAPSHOT" id="VIR_DOMAIN_PAUSED_FROM_SNAPSHOT">VIR_DOMAIN_PAUSED_FROM_SNAPSHOT</a></td><td> = </td><td>7</td><td> : paused after restoring from snapshot</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_SHUTTING_DOWN" id="VIR_DOMAIN_PAUSED_SHUTTING_DOWN">VIR_DOMAIN_PAUSED_SHUTTING_DOWN</a></td><td> = </td><td>8</td><td> : paused during shutdown process</td></tr></table><pre>}
 
778
</pre><table><tr><td><a name="VIR_DOMAIN_PAUSED_UNKNOWN" id="VIR_DOMAIN_PAUSED_UNKNOWN">VIR_DOMAIN_PAUSED_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_USER" id="VIR_DOMAIN_PAUSED_USER">VIR_DOMAIN_PAUSED_USER</a></td><td> = </td><td>1</td><td> : paused on user request</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_MIGRATION" id="VIR_DOMAIN_PAUSED_MIGRATION">VIR_DOMAIN_PAUSED_MIGRATION</a></td><td> = </td><td>2</td><td> : paused for offline migration</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_SAVE" id="VIR_DOMAIN_PAUSED_SAVE">VIR_DOMAIN_PAUSED_SAVE</a></td><td> = </td><td>3</td><td> : paused for save</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_DUMP" id="VIR_DOMAIN_PAUSED_DUMP">VIR_DOMAIN_PAUSED_DUMP</a></td><td> = </td><td>4</td><td> : paused for offline core dump</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_IOERROR" id="VIR_DOMAIN_PAUSED_IOERROR">VIR_DOMAIN_PAUSED_IOERROR</a></td><td> = </td><td>5</td><td> : paused due to a disk I/O error</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_WATCHDOG" id="VIR_DOMAIN_PAUSED_WATCHDOG">VIR_DOMAIN_PAUSED_WATCHDOG</a></td><td> = </td><td>6</td><td> : paused due to a watchdog event</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_FROM_SNAPSHOT" id="VIR_DOMAIN_PAUSED_FROM_SNAPSHOT">VIR_DOMAIN_PAUSED_FROM_SNAPSHOT</a></td><td> = </td><td>7</td><td> : paused after restoring from snapshot</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_SHUTTING_DOWN" id="VIR_DOMAIN_PAUSED_SHUTTING_DOWN">VIR_DOMAIN_PAUSED_SHUTTING_DOWN</a></td><td> = </td><td>8</td><td> : paused during shutdown process</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED_LAST" id="VIR_DOMAIN_PAUSED_LAST">VIR_DOMAIN_PAUSED_LAST</a></td><td> = </td><td>9</td></tr></table><pre>}
 
779
</pre></div><h3><a name="virDomainRebootFlagValues" id="virDomainRebootFlagValues"><code>virDomainRebootFlagValues</code></a></h3><div class="api"><pre>enum virDomainRebootFlagValues {
 
780
</pre><table><tr><td><a name="VIR_DOMAIN_REBOOT_DEFAULT" id="VIR_DOMAIN_REBOOT_DEFAULT">VIR_DOMAIN_REBOOT_DEFAULT</a></td><td> = </td><td>0</td><td> : hypervisor choice</td></tr><tr><td><a name="VIR_DOMAIN_REBOOT_ACPI_POWER_BTN" id="VIR_DOMAIN_REBOOT_ACPI_POWER_BTN">VIR_DOMAIN_REBOOT_ACPI_POWER_BTN</a></td><td> = </td><td>1</td><td> : Send ACPI event</td></tr><tr><td><a name="VIR_DOMAIN_REBOOT_GUEST_AGENT" id="VIR_DOMAIN_REBOOT_GUEST_AGENT">VIR_DOMAIN_REBOOT_GUEST_AGENT</a></td><td> = </td><td>2</td><td> : Use guest agent</td></tr></table><pre>}
705
781
</pre></div><h3><a name="virDomainRunningReason" id="virDomainRunningReason"><code>virDomainRunningReason</code></a></h3><div class="api"><pre>enum virDomainRunningReason {
706
 
</pre><table><tr><td><a name="VIR_DOMAIN_RUNNING_UNKNOWN" id="VIR_DOMAIN_RUNNING_UNKNOWN">VIR_DOMAIN_RUNNING_UNKNOWN</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_BOOTED" id="VIR_DOMAIN_RUNNING_BOOTED">VIR_DOMAIN_RUNNING_BOOTED</a></td><td> = </td><td>1</td><td> : normal startup from boot</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_MIGRATED" id="VIR_DOMAIN_RUNNING_MIGRATED">VIR_DOMAIN_RUNNING_MIGRATED</a></td><td> = </td><td>2</td><td> : migrated from another host</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_RESTORED" id="VIR_DOMAIN_RUNNING_RESTORED">VIR_DOMAIN_RUNNING_RESTORED</a></td><td> = </td><td>3</td><td> : restored from a state file</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_FROM_SNAPSHOT" id="VIR_DOMAIN_RUNNING_FROM_SNAPSHOT">VIR_DOMAIN_RUNNING_FROM_SNAPSHOT</a></td><td> = </td><td>4</td><td> : restored from snapshot</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_UNPAUSED" id="VIR_DOMAIN_RUNNING_UNPAUSED">VIR_DOMAIN_RUNNING_UNPAUSED</a></td><td> = </td><td>5</td><td> : returned from paused state</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_MIGRATION_CANCELED" id="VIR_DOMAIN_RUNNING_MIGRATION_CANCELED">VIR_DOMAIN_RUNNING_MIGRATION_CANCELED</a></td><td> = </td><td>6</td><td> : returned from migration</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_SAVE_CANCELED" id="VIR_DOMAIN_RUNNING_SAVE_CANCELED">VIR_DOMAIN_RUNNING_SAVE_CANCELED</a></td><td> = </td><td>7</td><td> : returned from failed save process</td></tr></table><pre>}
 
782
</pre><table><tr><td><a name="VIR_DOMAIN_RUNNING_UNKNOWN" id="VIR_DOMAIN_RUNNING_UNKNOWN">VIR_DOMAIN_RUNNING_UNKNOWN</a></td><td> = </td><td>0</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_BOOTED" id="VIR_DOMAIN_RUNNING_BOOTED">VIR_DOMAIN_RUNNING_BOOTED</a></td><td> = </td><td>1</td><td> : normal startup from boot</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_MIGRATED" id="VIR_DOMAIN_RUNNING_MIGRATED">VIR_DOMAIN_RUNNING_MIGRATED</a></td><td> = </td><td>2</td><td> : migrated from another host</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_RESTORED" id="VIR_DOMAIN_RUNNING_RESTORED">VIR_DOMAIN_RUNNING_RESTORED</a></td><td> = </td><td>3</td><td> : restored from a state file</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_FROM_SNAPSHOT" id="VIR_DOMAIN_RUNNING_FROM_SNAPSHOT">VIR_DOMAIN_RUNNING_FROM_SNAPSHOT</a></td><td> = </td><td>4</td><td> : restored from snapshot</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_UNPAUSED" id="VIR_DOMAIN_RUNNING_UNPAUSED">VIR_DOMAIN_RUNNING_UNPAUSED</a></td><td> = </td><td>5</td><td> : returned from paused state</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_MIGRATION_CANCELED" id="VIR_DOMAIN_RUNNING_MIGRATION_CANCELED">VIR_DOMAIN_RUNNING_MIGRATION_CANCELED</a></td><td> = </td><td>6</td><td> : returned from migration</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_SAVE_CANCELED" id="VIR_DOMAIN_RUNNING_SAVE_CANCELED">VIR_DOMAIN_RUNNING_SAVE_CANCELED</a></td><td> = </td><td>7</td><td> : returned from failed save process</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_WAKEUP" id="VIR_DOMAIN_RUNNING_WAKEUP">VIR_DOMAIN_RUNNING_WAKEUP</a></td><td> = </td><td>8</td><td> : returned from pmsuspended due to wakeup event</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING_LAST" id="VIR_DOMAIN_RUNNING_LAST">VIR_DOMAIN_RUNNING_LAST</a></td><td> = </td><td>9</td></tr></table><pre>}
707
783
</pre></div><h3><a name="virDomainSaveRestoreFlags" id="virDomainSaveRestoreFlags"><code>virDomainSaveRestoreFlags</code></a></h3><div class="api"><pre>enum virDomainSaveRestoreFlags {
708
784
</pre><table><tr><td><a name="VIR_DOMAIN_SAVE_BYPASS_CACHE" id="VIR_DOMAIN_SAVE_BYPASS_CACHE">VIR_DOMAIN_SAVE_BYPASS_CACHE</a></td><td> = </td><td>1</td><td> : Avoid file system cache pollution</td></tr><tr><td><a name="VIR_DOMAIN_SAVE_RUNNING" id="VIR_DOMAIN_SAVE_RUNNING">VIR_DOMAIN_SAVE_RUNNING</a></td><td> = </td><td>2</td><td> : Favor running over paused</td></tr><tr><td><a name="VIR_DOMAIN_SAVE_PAUSED" id="VIR_DOMAIN_SAVE_PAUSED">VIR_DOMAIN_SAVE_PAUSED</a></td><td> = </td><td>4</td><td> : Favor paused over running</td></tr></table><pre>}
 
785
</pre></div><h3><a name="virDomainShutdownFlagValues" id="virDomainShutdownFlagValues"><code>virDomainShutdownFlagValues</code></a></h3><div class="api"><pre>enum virDomainShutdownFlagValues {
 
786
</pre><table><tr><td><a name="VIR_DOMAIN_SHUTDOWN_DEFAULT" id="VIR_DOMAIN_SHUTDOWN_DEFAULT">VIR_DOMAIN_SHUTDOWN_DEFAULT</a></td><td> = </td><td>0</td><td> : hypervisor choice</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN" id="VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN">VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN</a></td><td> = </td><td>1</td><td> : Send ACPI event</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN_GUEST_AGENT" id="VIR_DOMAIN_SHUTDOWN_GUEST_AGENT">VIR_DOMAIN_SHUTDOWN_GUEST_AGENT</a></td><td> = </td><td>2</td><td> : Use guest agent</td></tr></table><pre>}
709
787
</pre></div><h3><a name="virDomainShutdownReason" id="virDomainShutdownReason"><code>virDomainShutdownReason</code></a></h3><div class="api"><pre>enum virDomainShutdownReason {
710
 
</pre><table><tr><td><a name="VIR_DOMAIN_SHUTDOWN_UNKNOWN" id="VIR_DOMAIN_SHUTDOWN_UNKNOWN">VIR_DOMAIN_SHUTDOWN_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN_USER" id="VIR_DOMAIN_SHUTDOWN_USER">VIR_DOMAIN_SHUTDOWN_USER</a></td><td> = </td><td>1</td><td> : shutting down on user request</td></tr></table><pre>}
 
788
</pre><table><tr><td><a name="VIR_DOMAIN_SHUTDOWN_UNKNOWN" id="VIR_DOMAIN_SHUTDOWN_UNKNOWN">VIR_DOMAIN_SHUTDOWN_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN_USER" id="VIR_DOMAIN_SHUTDOWN_USER">VIR_DOMAIN_SHUTDOWN_USER</a></td><td> = </td><td>1</td><td> : shutting down on user request</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN_LAST" id="VIR_DOMAIN_SHUTDOWN_LAST">VIR_DOMAIN_SHUTDOWN_LAST</a></td><td> = </td><td>2</td></tr></table><pre>}
711
789
</pre></div><h3><a name="virDomainShutoffReason" id="virDomainShutoffReason"><code>virDomainShutoffReason</code></a></h3><div class="api"><pre>enum virDomainShutoffReason {
712
 
</pre><table><tr><td><a name="VIR_DOMAIN_SHUTOFF_UNKNOWN" id="VIR_DOMAIN_SHUTOFF_UNKNOWN">VIR_DOMAIN_SHUTOFF_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_SHUTDOWN" id="VIR_DOMAIN_SHUTOFF_SHUTDOWN">VIR_DOMAIN_SHUTOFF_SHUTDOWN</a></td><td> = </td><td>1</td><td> : normal shutdown</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_DESTROYED" id="VIR_DOMAIN_SHUTOFF_DESTROYED">VIR_DOMAIN_SHUTOFF_DESTROYED</a></td><td> = </td><td>2</td><td> : forced poweroff</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_CRASHED" id="VIR_DOMAIN_SHUTOFF_CRASHED">VIR_DOMAIN_SHUTOFF_CRASHED</a></td><td> = </td><td>3</td><td> : domain crashed</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_MIGRATED" id="VIR_DOMAIN_SHUTOFF_MIGRATED">VIR_DOMAIN_SHUTOFF_MIGRATED</a></td><td> = </td><td>4</td><td> : migrated to another host</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_SAVED" id="VIR_DOMAIN_SHUTOFF_SAVED">VIR_DOMAIN_SHUTOFF_SAVED</a></td><td> = </td><td>5</td><td> : saved to a file</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_FAILED" id="VIR_DOMAIN_SHUTOFF_FAILED">VIR_DOMAIN_SHUTOFF_FAILED</a></td><td> = </td><td>6</td><td> : domain failed to start</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT" id="VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT">VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT</a></td><td> = </td><td>7</td><td> : restored from a snapshot which was taken while domain was shutoff</td></tr></table><pre>}
 
790
</pre><table><tr><td><a name="VIR_DOMAIN_SHUTOFF_UNKNOWN" id="VIR_DOMAIN_SHUTOFF_UNKNOWN">VIR_DOMAIN_SHUTOFF_UNKNOWN</a></td><td> = </td><td>0</td><td> : the reason is unknown</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_SHUTDOWN" id="VIR_DOMAIN_SHUTOFF_SHUTDOWN">VIR_DOMAIN_SHUTOFF_SHUTDOWN</a></td><td> = </td><td>1</td><td> : normal shutdown</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_DESTROYED" id="VIR_DOMAIN_SHUTOFF_DESTROYED">VIR_DOMAIN_SHUTOFF_DESTROYED</a></td><td> = </td><td>2</td><td> : forced poweroff</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_CRASHED" id="VIR_DOMAIN_SHUTOFF_CRASHED">VIR_DOMAIN_SHUTOFF_CRASHED</a></td><td> = </td><td>3</td><td> : domain crashed</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_MIGRATED" id="VIR_DOMAIN_SHUTOFF_MIGRATED">VIR_DOMAIN_SHUTOFF_MIGRATED</a></td><td> = </td><td>4</td><td> : migrated to another host</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_SAVED" id="VIR_DOMAIN_SHUTOFF_SAVED">VIR_DOMAIN_SHUTOFF_SAVED</a></td><td> = </td><td>5</td><td> : saved to a file</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_FAILED" id="VIR_DOMAIN_SHUTOFF_FAILED">VIR_DOMAIN_SHUTOFF_FAILED</a></td><td> = </td><td>6</td><td> : domain failed to start</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT" id="VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT">VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT</a></td><td> = </td><td>7</td><td> : restored from a snapshot which was taken while domain was shutoff</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF_LAST" id="VIR_DOMAIN_SHUTOFF_LAST">VIR_DOMAIN_SHUTOFF_LAST</a></td><td> = </td><td>8</td></tr></table><pre>}
713
791
</pre></div><h3><a name="virDomainSnapshot" id="virDomainSnapshot"><code>virDomainSnapshot</code></a></h3><div class="api"><pre>struct virDomainSnapshot{
714
792
</pre><table><tr><td colspan="3">The content of this structure is not made public by the API</td></tr></table><pre>
715
793
}
716
794
</pre></div><h3><a name="virDomainSnapshotCreateFlags" id="virDomainSnapshotCreateFlags"><code>virDomainSnapshotCreateFlags</code></a></h3><div class="api"><pre>enum virDomainSnapshotCreateFlags {
717
 
</pre><table><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE" id="VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a></td><td> = </td><td>1</td><td> : Restore or alter metadata</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT" id="VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT">VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT</a></td><td> = </td><td>2</td><td> : With redefine, make snapshot current</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA" id="VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA">VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA</a></td><td> = </td><td>4</td><td> : Make snapshot without remembering it</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_HALT" id="VIR_DOMAIN_SNAPSHOT_CREATE_HALT">VIR_DOMAIN_SNAPSHOT_CREATE_HALT</a></td><td> = </td><td>8</td><td> : Stop running guest after snapshot</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY" id="VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY">VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</a></td><td> = </td><td>16</td><td> : disk snapshot, not system checkpoint</td></tr></table><pre>}
 
795
</pre><table><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE" id="VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a></td><td> = </td><td>1</td><td> : Restore or alter metadata</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT" id="VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT">VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT</a></td><td> = </td><td>2</td><td> : With redefine, make snapshot current</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA" id="VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA">VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA</a></td><td> = </td><td>4</td><td> : Make snapshot without remembering it</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_HALT" id="VIR_DOMAIN_SNAPSHOT_CREATE_HALT">VIR_DOMAIN_SNAPSHOT_CREATE_HALT</a></td><td> = </td><td>8</td><td> : Stop running guest after snapshot</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY" id="VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY">VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</a></td><td> = </td><td>16</td><td> : disk snapshot, not system checkpoint</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT" id="VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT">VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT</a></td><td> = </td><td>32</td><td> : reuse any existing external files</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE" id="VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE">VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE</a></td><td> = </td><td>64</td><td> : use guest agent to quiesce all mounted file systems within the domain</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC" id="VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC">VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC</a></td><td> = </td><td>128</td><td> : atomically avoid partial changes</td></tr></table><pre>}
718
796
</pre></div><h3><a name="virDomainSnapshotDeleteFlags" id="virDomainSnapshotDeleteFlags"><code>virDomainSnapshotDeleteFlags</code></a></h3><div class="api"><pre>enum virDomainSnapshotDeleteFlags {
719
797
</pre><table><tr><td><a name="VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN" id="VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN">VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN</a></td><td> = </td><td>1</td><td> : Also delete children</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY" id="VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY">VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY</a></td><td> = </td><td>2</td><td> : Delete just metadata</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY" id="VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY">VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY</a></td><td> = </td><td>4</td><td> : Delete just children</td></tr></table><pre>}
720
798
</pre></div><h3><a name="virDomainSnapshotListFlags" id="virDomainSnapshotListFlags"><code>virDomainSnapshotListFlags</code></a></h3><div class="api"><pre>enum virDomainSnapshotListFlags {
722
800
</pre></div><h3><a name="virDomainSnapshotRevertFlags" id="virDomainSnapshotRevertFlags"><code>virDomainSnapshotRevertFlags</code></a></h3><div class="api"><pre>enum virDomainSnapshotRevertFlags {
723
801
</pre><table><tr><td><a name="VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING" id="VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING">VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING</a></td><td> = </td><td>1</td><td> : Run after revert</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED" id="VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED">VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED</a></td><td> = </td><td>2</td><td> : Pause after revert</td></tr><tr><td><a name="VIR_DOMAIN_SNAPSHOT_REVERT_FORCE" id="VIR_DOMAIN_SNAPSHOT_REVERT_FORCE">VIR_DOMAIN_SNAPSHOT_REVERT_FORCE</a></td><td> = </td><td>4</td><td> : Allow risky reverts</td></tr></table><pre>}
724
802
</pre></div><h3><a name="virDomainState" id="virDomainState"><code>virDomainState</code></a></h3><div class="api"><pre>enum virDomainState {
725
 
</pre><table><tr><td><a name="VIR_DOMAIN_NOSTATE" id="VIR_DOMAIN_NOSTATE">VIR_DOMAIN_NOSTATE</a></td><td> = </td><td>0</td><td> : no state</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING" id="VIR_DOMAIN_RUNNING">VIR_DOMAIN_RUNNING</a></td><td> = </td><td>1</td><td> : the domain is running</td></tr><tr><td><a name="VIR_DOMAIN_BLOCKED" id="VIR_DOMAIN_BLOCKED">VIR_DOMAIN_BLOCKED</a></td><td> = </td><td>2</td><td> : the domain is blocked on resource</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED" id="VIR_DOMAIN_PAUSED">VIR_DOMAIN_PAUSED</a></td><td> = </td><td>3</td><td> : the domain is paused by user</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN" id="VIR_DOMAIN_SHUTDOWN">VIR_DOMAIN_SHUTDOWN</a></td><td> = </td><td>4</td><td> : the domain is being shut down</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF" id="VIR_DOMAIN_SHUTOFF">VIR_DOMAIN_SHUTOFF</a></td><td> = </td><td>5</td><td> : the domain is shut off</td></tr><tr><td><a name="VIR_DOMAIN_CRASHED" id="VIR_DOMAIN_CRASHED">VIR_DOMAIN_CRASHED</a></td><td> = </td><td>6</td><td> : NB: this enum value will increase over time as new events are added to the libvirt API. It reflects the last state supported by this version of the libvirt API.</td></tr><tr><td><a name="VIR_DOMAIN_LAST" id="VIR_DOMAIN_LAST">VIR_DOMAIN_LAST</a></td><td> = </td><td>7</td></tr></table><pre>}
 
803
</pre><table><tr><td><a name="VIR_DOMAIN_NOSTATE" id="VIR_DOMAIN_NOSTATE">VIR_DOMAIN_NOSTATE</a></td><td> = </td><td>0</td><td> : no state</td></tr><tr><td><a name="VIR_DOMAIN_RUNNING" id="VIR_DOMAIN_RUNNING">VIR_DOMAIN_RUNNING</a></td><td> = </td><td>1</td><td> : the domain is running</td></tr><tr><td><a name="VIR_DOMAIN_BLOCKED" id="VIR_DOMAIN_BLOCKED">VIR_DOMAIN_BLOCKED</a></td><td> = </td><td>2</td><td> : the domain is blocked on resource</td></tr><tr><td><a name="VIR_DOMAIN_PAUSED" id="VIR_DOMAIN_PAUSED">VIR_DOMAIN_PAUSED</a></td><td> = </td><td>3</td><td> : the domain is paused by user</td></tr><tr><td><a name="VIR_DOMAIN_SHUTDOWN" id="VIR_DOMAIN_SHUTDOWN">VIR_DOMAIN_SHUTDOWN</a></td><td> = </td><td>4</td><td> : the domain is being shut down</td></tr><tr><td><a name="VIR_DOMAIN_SHUTOFF" id="VIR_DOMAIN_SHUTOFF">VIR_DOMAIN_SHUTOFF</a></td><td> = </td><td>5</td><td> : the domain is shut off</td></tr><tr><td><a name="VIR_DOMAIN_CRASHED" id="VIR_DOMAIN_CRASHED">VIR_DOMAIN_CRASHED</a></td><td> = </td><td>6</td><td> : the domain is crashed</td></tr><tr><td><a name="VIR_DOMAIN_PMSUSPENDED" id="VIR_DOMAIN_PMSUSPENDED">VIR_DOMAIN_PMSUSPENDED</a></td><td> = </td><td>7</td><td> : NB: this enum value will increase over time as new events are added to the libvirt API. It reflects the last state supported by this version of the libvirt API.</td></tr><tr><td><a name="VIR_DOMAIN_LAST" id="VIR_DOMAIN_LAST">VIR_DOMAIN_LAST</a></td><td> = </td><td>8</td></tr></table><pre>}
726
804
</pre></div><h3><a name="virDomainUndefineFlagsValues" id="virDomainUndefineFlagsValues"><code>virDomainUndefineFlagsValues</code></a></h3><div class="api"><pre>enum virDomainUndefineFlagsValues {
727
805
</pre><table><tr><td><a name="VIR_DOMAIN_UNDEFINE_MANAGED_SAVE" id="VIR_DOMAIN_UNDEFINE_MANAGED_SAVE">VIR_DOMAIN_UNDEFINE_MANAGED_SAVE</a></td><td> = </td><td>1</td><td> : Also remove any managed save</td></tr><tr><td><a name="VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA" id="VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA">VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA</a></td><td> = </td><td>2</td><td> : If last use of domain, then also remove any snapshot metadata Future undefine control flags should come here.</td></tr></table><pre>}
728
806
</pre></div><h3><a name="virDomainVcpuFlags" id="virDomainVcpuFlags"><code>virDomainVcpuFlags</code></a></h3><div class="api"><pre>enum virDomainVcpuFlags {
749
827
</pre></div><h3><a name="virNetwork" id="virNetwork"><code>virNetwork</code></a></h3><div class="api"><pre>struct virNetwork{
750
828
</pre><table><tr><td colspan="3">The content of this structure is not made public by the API</td></tr></table><pre>
751
829
}
 
830
</pre></div><h3><a name="virNetworkXMLFlags" id="virNetworkXMLFlags"><code>virNetworkXMLFlags</code></a></h3><div class="api"><pre>enum virNetworkXMLFlags {
 
831
</pre><table><tr><td><a name="VIR_NETWORK_XML_INACTIVE" id="VIR_NETWORK_XML_INACTIVE">VIR_NETWORK_XML_INACTIVE</a></td><td> = </td><td>1</td><td> : dump inactive network information</td></tr></table><pre>}
752
832
</pre></div><h3><a name="virNodeCPUStats" id="virNodeCPUStats"><code>virNodeCPUStats</code></a></h3><div class="api"><pre>struct virNodeCPUStats{
753
833
</pre><table><tr><td>char field[VIR_NODE_CPU_STATS_FIELD_LENGTH]</td><td>field</td></tr><tr><td>unsigned long long</td><td>value</td></tr></table><pre>
754
834
}
794
874
</pre><table><tr><td>int</td><td>state</td><td> : <a href="libvirt-libvirt.html#virStoragePoolState">virStoragePoolState</a> flags</td></tr><tr><td>unsigned long long</td><td>capacity</td><td> : Logical size bytes</td></tr><tr><td>unsigned long long</td><td>allocation</td><td> : Current allocation bytes</td></tr><tr><td>unsigned long long</td><td>available</td><td> : Remaining free space bytes</td></tr></table><pre>
795
875
}
796
876
</pre></div><h3><a name="virStoragePoolState" id="virStoragePoolState"><code>virStoragePoolState</code></a></h3><div class="api"><pre>enum virStoragePoolState {
797
 
</pre><table><tr><td><a name="VIR_STORAGE_POOL_INACTIVE" id="VIR_STORAGE_POOL_INACTIVE">VIR_STORAGE_POOL_INACTIVE</a></td><td> = </td><td>0</td><td> : Not running</td></tr><tr><td><a name="VIR_STORAGE_POOL_BUILDING" id="VIR_STORAGE_POOL_BUILDING">VIR_STORAGE_POOL_BUILDING</a></td><td> = </td><td>1</td><td> : Initializing pool, not available</td></tr><tr><td><a name="VIR_STORAGE_POOL_RUNNING" id="VIR_STORAGE_POOL_RUNNING">VIR_STORAGE_POOL_RUNNING</a></td><td> = </td><td>2</td><td> : Running normally</td></tr><tr><td><a name="VIR_STORAGE_POOL_DEGRADED" id="VIR_STORAGE_POOL_DEGRADED">VIR_STORAGE_POOL_DEGRADED</a></td><td> = </td><td>3</td><td> : Running degraded</td></tr><tr><td><a name="VIR_STORAGE_POOL_INACCESSIBLE" id="VIR_STORAGE_POOL_INACCESSIBLE">VIR_STORAGE_POOL_INACCESSIBLE</a></td><td> = </td><td>4</td><td> : Running, but not accessible</td></tr></table><pre>}
 
877
</pre><table><tr><td><a name="VIR_STORAGE_POOL_INACTIVE" id="VIR_STORAGE_POOL_INACTIVE">VIR_STORAGE_POOL_INACTIVE</a></td><td> = </td><td>0</td><td> : Not running</td></tr><tr><td><a name="VIR_STORAGE_POOL_BUILDING" id="VIR_STORAGE_POOL_BUILDING">VIR_STORAGE_POOL_BUILDING</a></td><td> = </td><td>1</td><td> : Initializing pool, not available</td></tr><tr><td><a name="VIR_STORAGE_POOL_RUNNING" id="VIR_STORAGE_POOL_RUNNING">VIR_STORAGE_POOL_RUNNING</a></td><td> = </td><td>2</td><td> : Running normally</td></tr><tr><td><a name="VIR_STORAGE_POOL_DEGRADED" id="VIR_STORAGE_POOL_DEGRADED">VIR_STORAGE_POOL_DEGRADED</a></td><td> = </td><td>3</td><td> : Running degraded</td></tr><tr><td><a name="VIR_STORAGE_POOL_INACCESSIBLE" id="VIR_STORAGE_POOL_INACCESSIBLE">VIR_STORAGE_POOL_INACCESSIBLE</a></td><td> = </td><td>4</td><td> : Running, but not accessible</td></tr><tr><td><a name="VIR_STORAGE_POOL_STATE_LAST" id="VIR_STORAGE_POOL_STATE_LAST">VIR_STORAGE_POOL_STATE_LAST</a></td><td> = </td><td>5</td></tr></table><pre>}
798
878
</pre></div><h3><a name="virStorageVol" id="virStorageVol"><code>virStorageVol</code></a></h3><div class="api"><pre>struct virStorageVol{
799
879
</pre><table><tr><td colspan="3">The content of this structure is not made public by the API</td></tr></table><pre>
800
880
}
803
883
</pre></div><h3><a name="virStorageVolInfo" id="virStorageVolInfo"><code>virStorageVolInfo</code></a></h3><div class="api"><pre>struct virStorageVolInfo{
804
884
</pre><table><tr><td>int</td><td>type</td><td> : <a href="libvirt-libvirt.html#virStorageVolType">virStorageVolType</a> flags</td></tr><tr><td>unsigned long long</td><td>capacity</td><td> : Logical size bytes</td></tr><tr><td>unsigned long long</td><td>allocation</td><td> : Current allocation bytes</td></tr></table><pre>
805
885
}
 
886
</pre></div><h3><a name="virStorageVolResizeFlags" id="virStorageVolResizeFlags"><code>virStorageVolResizeFlags</code></a></h3><div class="api"><pre>enum virStorageVolResizeFlags {
 
887
</pre><table><tr><td><a name="VIR_STORAGE_VOL_RESIZE_ALLOCATE" id="VIR_STORAGE_VOL_RESIZE_ALLOCATE">VIR_STORAGE_VOL_RESIZE_ALLOCATE</a></td><td> = </td><td>1</td><td> : force allocation of new size</td></tr><tr><td><a name="VIR_STORAGE_VOL_RESIZE_DELTA" id="VIR_STORAGE_VOL_RESIZE_DELTA">VIR_STORAGE_VOL_RESIZE_DELTA</a></td><td> = </td><td>2</td><td> : size is relative to current</td></tr><tr><td><a name="VIR_STORAGE_VOL_RESIZE_SHRINK" id="VIR_STORAGE_VOL_RESIZE_SHRINK">VIR_STORAGE_VOL_RESIZE_SHRINK</a></td><td> = </td><td>4</td><td> : allow decrease in capacity</td></tr></table><pre>}
806
888
</pre></div><h3><a name="virStorageVolType" id="virStorageVolType"><code>virStorageVolType</code></a></h3><div class="api"><pre>enum virStorageVolType {
807
 
</pre><table><tr><td><a name="VIR_STORAGE_VOL_FILE" id="VIR_STORAGE_VOL_FILE">VIR_STORAGE_VOL_FILE</a></td><td> = </td><td>0</td><td> : Regular file based volumes</td></tr><tr><td><a name="VIR_STORAGE_VOL_BLOCK" id="VIR_STORAGE_VOL_BLOCK">VIR_STORAGE_VOL_BLOCK</a></td><td> = </td><td>1</td><td> : Block based volumes</td></tr><tr><td><a name="VIR_STORAGE_VOL_DIR" id="VIR_STORAGE_VOL_DIR">VIR_STORAGE_VOL_DIR</a></td><td> = </td><td>2</td><td> : Directory-passthrough based volume</td></tr></table><pre>}
 
889
</pre><table><tr><td><a name="VIR_STORAGE_VOL_FILE" id="VIR_STORAGE_VOL_FILE">VIR_STORAGE_VOL_FILE</a></td><td> = </td><td>0</td><td> : Regular file based volumes</td></tr><tr><td><a name="VIR_STORAGE_VOL_BLOCK" id="VIR_STORAGE_VOL_BLOCK">VIR_STORAGE_VOL_BLOCK</a></td><td> = </td><td>1</td><td> : Block based volumes</td></tr><tr><td><a name="VIR_STORAGE_VOL_DIR" id="VIR_STORAGE_VOL_DIR">VIR_STORAGE_VOL_DIR</a></td><td> = </td><td>2</td><td> : Directory-passthrough based volume</td></tr><tr><td><a name="VIR_STORAGE_VOL_LAST" id="VIR_STORAGE_VOL_LAST">VIR_STORAGE_VOL_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
 
890
</pre></div><h3><a name="virStorageVolWipeAlgorithm" id="virStorageVolWipeAlgorithm"><code>virStorageVolWipeAlgorithm</code></a></h3><div class="api"><pre>enum virStorageVolWipeAlgorithm {
 
891
</pre><table><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_ZERO" id="VIR_STORAGE_VOL_WIPE_ALG_ZERO">VIR_STORAGE_VOL_WIPE_ALG_ZERO</a></td><td> = </td><td>0</td><td> : 1-pass, all zeroes</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_NNSA" id="VIR_STORAGE_VOL_WIPE_ALG_NNSA">VIR_STORAGE_VOL_WIPE_ALG_NNSA</a></td><td> = </td><td>1</td><td> : 4-pass NNSA Policy Letter NAP-14.1-C (XVI-8)</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_DOD" id="VIR_STORAGE_VOL_WIPE_ALG_DOD">VIR_STORAGE_VOL_WIPE_ALG_DOD</a></td><td> = </td><td>2</td><td> : 4-pass DoD 5220.22-M section 8-306 procedure</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_BSI" id="VIR_STORAGE_VOL_WIPE_ALG_BSI">VIR_STORAGE_VOL_WIPE_ALG_BSI</a></td><td> = </td><td>3</td><td> : 9-pass method recommended by the German Center of Security in Information Technologies</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_GUTMANN" id="VIR_STORAGE_VOL_WIPE_ALG_GUTMANN">VIR_STORAGE_VOL_WIPE_ALG_GUTMANN</a></td><td> = </td><td>4</td><td> : The canonical 35-pass sequence</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER" id="VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER">VIR_STORAGE_VOL_WIPE_ALG_SCHNEIER</a></td><td> = </td><td>5</td><td> : 7-pass method described by Bruce Schneier in "Applied Cryptography" (1996)</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7" id="VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7">VIR_STORAGE_VOL_WIPE_ALG_PFITZNER7</a></td><td> = </td><td>6</td><td> : 7-pass random</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33" id="VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33">VIR_STORAGE_VOL_WIPE_ALG_PFITZNER33</a></td><td> = </td><td>7</td><td> : 33-pass random</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_RANDOM" id="VIR_STORAGE_VOL_WIPE_ALG_RANDOM">VIR_STORAGE_VOL_WIPE_ALG_RANDOM</a></td><td> = </td><td>8</td><td> : NB: this enum value will increase over time as new algorithms are added to the libvirt API. It reflects the last algorithm supported by this version of the libvirt API.</td></tr><tr><td><a name="VIR_STORAGE_VOL_WIPE_ALG_LAST" id="VIR_STORAGE_VOL_WIPE_ALG_LAST">VIR_STORAGE_VOL_WIPE_ALG_LAST</a></td><td> = </td><td>9</td></tr></table><pre>}
808
892
</pre></div><h3><a name="virStream" id="virStream"><code>virStream</code></a></h3><div class="api"><pre>struct virStream{
809
893
</pre><table><tr><td colspan="3">The content of this structure is not made public by the API</td></tr></table><pre>
810
894
}
818
902
</pre></div><h3><a name="virTypedParameterFlags" id="virTypedParameterFlags"><code>virTypedParameterFlags</code></a></h3><div class="api"><pre>enum virTypedParameterFlags {
819
903
</pre><table><tr><td><a name="VIR_TYPED_PARAM_STRING_OKAY" id="VIR_TYPED_PARAM_STRING_OKAY">VIR_TYPED_PARAM_STRING_OKAY</a></td><td> = </td><td>4</td></tr></table><pre>}
820
904
</pre></div><h3><a name="virTypedParameterType" id="virTypedParameterType"><code>virTypedParameterType</code></a></h3><div class="api"><pre>enum virTypedParameterType {
821
 
</pre><table><tr><td><a name="VIR_TYPED_PARAM_INT" id="VIR_TYPED_PARAM_INT">VIR_TYPED_PARAM_INT</a></td><td> = </td><td>1</td><td> : integer case</td></tr><tr><td><a name="VIR_TYPED_PARAM_UINT" id="VIR_TYPED_PARAM_UINT">VIR_TYPED_PARAM_UINT</a></td><td> = </td><td>2</td><td> : unsigned integer case</td></tr><tr><td><a name="VIR_TYPED_PARAM_LLONG" id="VIR_TYPED_PARAM_LLONG">VIR_TYPED_PARAM_LLONG</a></td><td> = </td><td>3</td><td> : long long case</td></tr><tr><td><a name="VIR_TYPED_PARAM_ULLONG" id="VIR_TYPED_PARAM_ULLONG">VIR_TYPED_PARAM_ULLONG</a></td><td> = </td><td>4</td><td> : unsigned long long case</td></tr><tr><td><a name="VIR_TYPED_PARAM_DOUBLE" id="VIR_TYPED_PARAM_DOUBLE">VIR_TYPED_PARAM_DOUBLE</a></td><td> = </td><td>5</td><td> : double case</td></tr><tr><td><a name="VIR_TYPED_PARAM_BOOLEAN" id="VIR_TYPED_PARAM_BOOLEAN">VIR_TYPED_PARAM_BOOLEAN</a></td><td> = </td><td>6</td><td> : boolean(character) case</td></tr><tr><td><a name="VIR_TYPED_PARAM_STRING" id="VIR_TYPED_PARAM_STRING">VIR_TYPED_PARAM_STRING</a></td><td> = </td><td>7</td><td> : string case</td></tr></table><pre>}
 
905
</pre><table><tr><td><a name="VIR_TYPED_PARAM_INT" id="VIR_TYPED_PARAM_INT">VIR_TYPED_PARAM_INT</a></td><td> = </td><td>1</td><td> : integer case</td></tr><tr><td><a name="VIR_TYPED_PARAM_UINT" id="VIR_TYPED_PARAM_UINT">VIR_TYPED_PARAM_UINT</a></td><td> = </td><td>2</td><td> : unsigned integer case</td></tr><tr><td><a name="VIR_TYPED_PARAM_LLONG" id="VIR_TYPED_PARAM_LLONG">VIR_TYPED_PARAM_LLONG</a></td><td> = </td><td>3</td><td> : long long case</td></tr><tr><td><a name="VIR_TYPED_PARAM_ULLONG" id="VIR_TYPED_PARAM_ULLONG">VIR_TYPED_PARAM_ULLONG</a></td><td> = </td><td>4</td><td> : unsigned long long case</td></tr><tr><td><a name="VIR_TYPED_PARAM_DOUBLE" id="VIR_TYPED_PARAM_DOUBLE">VIR_TYPED_PARAM_DOUBLE</a></td><td> = </td><td>5</td><td> : double case</td></tr><tr><td><a name="VIR_TYPED_PARAM_BOOLEAN" id="VIR_TYPED_PARAM_BOOLEAN">VIR_TYPED_PARAM_BOOLEAN</a></td><td> = </td><td>6</td><td> : boolean(character) case</td></tr><tr><td><a name="VIR_TYPED_PARAM_STRING" id="VIR_TYPED_PARAM_STRING">VIR_TYPED_PARAM_STRING</a></td><td> = </td><td>7</td><td> : string case</td></tr><tr><td><a name="VIR_TYPED_PARAM_LAST" id="VIR_TYPED_PARAM_LAST">VIR_TYPED_PARAM_LAST</a></td><td> = </td><td>8</td></tr></table><pre>}
822
906
</pre></div><h3><a name="virVcpuInfo" id="virVcpuInfo"><code>virVcpuInfo</code></a></h3><div class="api"><pre>struct virVcpuInfo{
823
907
</pre><table><tr><td>unsigned int</td><td>number</td><td> : virtual CPU number</td></tr><tr><td>int</td><td>state</td><td> : value from <a href="libvirt-libvirt.html#virVcpuState">virVcpuState</a></td></tr><tr><td>unsigned long long</td><td>cpuTime</td><td> : CPU time used, in nanoseconds</td></tr><tr><td>int</td><td>cpu</td><td> : real CPU number, or -1 if offline</td></tr></table><pre>
824
908
}
825
909
</pre></div><h3><a name="virVcpuState" id="virVcpuState"><code>virVcpuState</code></a></h3><div class="api"><pre>enum virVcpuState {
826
 
</pre><table><tr><td><a name="VIR_VCPU_OFFLINE" id="VIR_VCPU_OFFLINE">VIR_VCPU_OFFLINE</a></td><td> = </td><td>0</td><td> : the virtual CPU is offline</td></tr><tr><td><a name="VIR_VCPU_RUNNING" id="VIR_VCPU_RUNNING">VIR_VCPU_RUNNING</a></td><td> = </td><td>1</td><td> : the virtual CPU is running</td></tr><tr><td><a name="VIR_VCPU_BLOCKED" id="VIR_VCPU_BLOCKED">VIR_VCPU_BLOCKED</a></td><td> = </td><td>2</td><td> : the virtual CPU is blocked on resource</td></tr></table><pre>}
 
910
</pre><table><tr><td><a name="VIR_VCPU_OFFLINE" id="VIR_VCPU_OFFLINE">VIR_VCPU_OFFLINE</a></td><td> = </td><td>0</td><td> : the virtual CPU is offline</td></tr><tr><td><a name="VIR_VCPU_RUNNING" id="VIR_VCPU_RUNNING">VIR_VCPU_RUNNING</a></td><td> = </td><td>1</td><td> : the virtual CPU is running</td></tr><tr><td><a name="VIR_VCPU_BLOCKED" id="VIR_VCPU_BLOCKED">VIR_VCPU_BLOCKED</a></td><td> = </td><td>2</td><td> : the virtual CPU is blocked on resource</td></tr><tr><td><a name="VIR_VCPU_LAST" id="VIR_VCPU_LAST">VIR_VCPU_LAST</a></td><td> = </td><td>3</td></tr></table><pre>}
827
911
</pre></div><h3><a name="functions" id="functions">Functions</a></h3><h3><a name="virConnectAuthCallbackPtr" id="virConnectAuthCallbackPtr"><code>virConnectAuthCallbackPtr</code></a></h3><pre class="programlisting">typedef int      (*virConnectAuthCallbackPtr)    (<a href="libvirt-libvirt.html#virConnectCredentialPtr">virConnectCredentialPtr</a> cred, <br />                                         unsigned int ncred, <br />                                      void * cbdata)
828
912
</pre><p>When authentication requires one or more interactions, this callback is invoked. For each interaction supplied, data must be gathered from the user and filled in to the 'result' and 'resultlen' fields. If an interaction cannot be filled, fill in NULL and 0.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>cred</tt></i>:</span></td><td>list of <a href="libvirt-libvirt.html#virConnectCredential">virConnectCredential</a> object to fetch from user</td></tr><tr><td><span class="term"><i><tt>ncred</tt></i>:</span></td><td>size of cred list</td></tr><tr><td><span class="term"><i><tt>cbdata</tt></i>:</span></td><td>opaque data passed to <a href="libvirt-libvirt.html#virConnectOpenAuth">virConnectOpenAuth</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if all interactions were filled, or -1 upon error</td></tr></tbody></table></div><br /><h3><a name="virConnectBaselineCPU" id="virConnectBaselineCPU"><code>virConnectBaselineCPU</code></a></h3><pre class="programlisting">char *     virConnectBaselineCPU           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char ** xmlCPUs, <br />                                   unsigned int ncpus, <br />                                      unsigned int flags)<br />
829
 
</pre><p>Computes the most feature-rich CPU which is compatible with all given host CPUs.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xmlCPUs</tt></i>:</span></td><td>array of XML descriptions of host CPUs</td></tr><tr><td><span class="term"><i><tt>ncpus</tt></i>:</span></td><td>number of CPUs in xmlCPUs</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>fine-tuning flags, currently unused, pass 0.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>XML description of the computed CPU or NULL on error.</td></tr></tbody></table></div><h3><a name="virConnectClose" id="virConnectClose"><code>virConnectClose</code></a></h3><pre class="programlisting">int  virConnectClose                 (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
 
913
</pre><p>Computes the most feature-rich CPU which is compatible with all given host CPUs.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xmlCPUs</tt></i>:</span></td><td>array of XML descriptions of host CPUs</td></tr><tr><td><span class="term"><i><tt>ncpus</tt></i>:</span></td><td>number of CPUs in xmlCPUs</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>XML description of the computed CPU or NULL on error.</td></tr></tbody></table></div><h3><a name="virConnectClose" id="virConnectClose"><code>virConnectClose</code></a></h3><pre class="programlisting">int    virConnectClose                 (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
830
914
</pre><p>This function closes the connection to the Hypervisor. This should not be called if further interaction with the Hypervisor are needed especially if there is running domain which need further monitoring by the application. Connections are reference counted; the count is explicitly increased by the initial open (<a href="libvirt-libvirt.html#virConnectOpen">virConnectOpen</a>, <a href="libvirt-libvirt.html#virConnectOpenAuth">virConnectOpenAuth</a>, and the like) as well as <a href="libvirt-libvirt.html#virConnectRef">virConnectRef</a>; it is also temporarily increased by other API that depend on the connection remaining alive. The open and every <a href="libvirt-libvirt.html#virConnectRef">virConnectRef</a> call should have a matching <a href="libvirt-libvirt.html#virConnectClose">virConnectClose</a>, and all other references will be released after the corresponding operation completes.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of remaining references on success (positive implies that some other call still has a reference open, 0 implies that no references remain and the connection is closed), or -1 on failure. It is possible for the last <a href="libvirt-libvirt.html#virConnectClose">virConnectClose</a> to return a positive value if some other object still has a temporary reference to the connection, but the application should not try to further use a connection after the <a href="libvirt-libvirt.html#virConnectClose">virConnectClose</a> that matches the initial open.</td></tr></tbody></table></div><h3><a name="virConnectCompareCPU" id="virConnectCompareCPU"><code>virConnectCompareCPU</code></a></h3><pre class="programlisting">int        virConnectCompareCPU            (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xmlDesc, <br />                                    unsigned int flags)<br />
831
 
</pre><p>Compares the given CPU description with the host CPU</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>XML describing the CPU to compare with host CPU</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>comparison result according to enum <a href="libvirt-libvirt.html#virCPUCompareResult">virCPUCompareResult</a></td></tr></tbody></table></div><h3><a name="virConnectDomainEventBlockJobCallback" id="virConnectDomainEventBlockJobCallback"><code>virConnectDomainEventBlockJobCallback</code></a></h3><pre class="programlisting">typedef void (*virConnectDomainEventBlockJobCallback)        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                const char * disk, <br />                                               int type, <br />                                                int status, <br />                                              void * opaque)
 
915
</pre><p>Compares the given CPU description with the host CPU</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>XML describing the CPU to compare with host CPU</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>comparison result according to enum <a href="libvirt-libvirt.html#virCPUCompareResult">virCPUCompareResult</a></td></tr></tbody></table></div><h3><a name="virConnectDomainEventBlockJobCallback" id="virConnectDomainEventBlockJobCallback"><code>virConnectDomainEventBlockJobCallback</code></a></h3><pre class="programlisting">typedef void       (*virConnectDomainEventBlockJobCallback)        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                const char * disk, <br />                                               int type, <br />                                                int status, <br />                                              void * opaque)
832
916
</pre><p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_BLOCK_JOB">VIR_DOMAIN_EVENT_ID_BLOCK_JOB</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of block job (<a href="libvirt-libvirt.html#virDomainBlockJobType">virDomainBlockJobType</a>)</td></tr><tr><td><span class="term"><i><tt>status</tt></i>:</span></td><td>final status of the operation (<a href="libvirt-libvirt.html#virConnectDomainEventBlockJobStatus">virConnectDomainEventBlockJobStatus</a>)</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td></td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventCallback" id="virConnectDomainEventCallback"><code>virConnectDomainEventCallback</code></a></h3><pre class="programlisting">typedef int   (*virConnectDomainEventCallback)        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        int event, <br />                                       int detail, <br />                                      void * opaque)
833
917
</pre><p>A callback function to be registered, and called when a domain event occurs</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>The domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>event</tt></i>:</span></td><td>The specfic <a href="libvirt-libvirt.html#virDomainEventType">virDomainEventType</a> which occurred</td></tr><tr><td><span class="term"><i><tt>detail</tt></i>:</span></td><td>event specific detail information</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque user data</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventDeregister" id="virConnectDomainEventDeregister"><code>virConnectDomainEventDeregister</code></a></h3><pre class="programlisting">int      virConnectDomainEventDeregister (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb)<br />
834
918
</pre><p>Removes a callback previously registered with the <a href="libvirt-libvirt.html#virConnectDomainEventRegister">virConnectDomainEventRegister</a> funtion. Use of this method is no longer recommended. Instead applications should try virConnectDomainEventUnregisterAny which has a more flexible API contract</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectDomainEventDeregisterAny" id="virConnectDomainEventDeregisterAny"><code>virConnectDomainEventDeregisterAny</code></a></h3><pre class="programlisting">int    virConnectDomainEventDeregisterAny      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             int callbackID)<br />
835
919
</pre><p>Removes an event callback. The callbackID parameter should be the vaule obtained from a previous virDomainEventRegisterAny method.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the connection</td></tr><tr><td><span class="term"><i><tt>callbackID</tt></i>:</span></td><td>the callback identifier</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectDomainEventDiskChangeCallback" id="virConnectDomainEventDiskChangeCallback"><code>virConnectDomainEventDiskChangeCallback</code></a></h3><pre class="programlisting">typedef void  (*virConnectDomainEventDiskChangeCallback)      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                const char * oldSrcPath, <br />                                                 const char * newSrcPath, <br />                                                 const char * devAlias, <br />                                           int reason, <br />                                              void * opaque)
836
 
</pre><p>This callback occurs when disk gets changed. However, not all @reason will cause both @oldSrcPath and @newSrcPath to be non-NULL. Please see <a href="libvirt-libvirt.html#virConnectDomainEventDiskChangeReason">virConnectDomainEventDiskChangeReason</a> for more details. The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_IO_ERROR">VIR_DOMAIN_EVENT_ID_IO_ERROR</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>oldSrcPath</tt></i>:</span></td><td>old source path</td></tr><tr><td><span class="term"><i><tt>newSrcPath</tt></i>:</span></td><td>new source path</td></tr><tr><td><span class="term"><i><tt>devAlias</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>reason why this callback was called; any of <a href="libvirt-libvirt.html#virConnectDomainEventDiskChangeReason">virConnectDomainEventDiskChangeReason</a></td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventGenericCallback" id="virConnectDomainEventGenericCallback"><code>virConnectDomainEventGenericCallback</code></a></h3><pre class="programlisting">typedef void (*virConnectDomainEventGenericCallback) (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                void * opaque)
 
920
</pre><p>This callback occurs when disk gets changed. However, not all @reason will cause both @oldSrcPath and @newSrcPath to be non-NULL. Please see <a href="libvirt-libvirt.html#virConnectDomainEventDiskChangeReason">virConnectDomainEventDiskChangeReason</a> for more details. The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_DISK_CHANGE">VIR_DOMAIN_EVENT_ID_DISK_CHANGE</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>oldSrcPath</tt></i>:</span></td><td>old source path</td></tr><tr><td><span class="term"><i><tt>newSrcPath</tt></i>:</span></td><td>new source path</td></tr><tr><td><span class="term"><i><tt>devAlias</tt></i>:</span></td><td>device alias name</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>reason why this callback was called; any of <a href="libvirt-libvirt.html#virConnectDomainEventDiskChangeReason">virConnectDomainEventDiskChangeReason</a></td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventGenericCallback" id="virConnectDomainEventGenericCallback"><code>virConnectDomainEventGenericCallback</code></a></h3><pre class="programlisting">typedef void  (*virConnectDomainEventGenericCallback) (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                void * opaque)
837
921
</pre><p>A generic domain event callback handler. Specific events usually have a customization with extra parameters</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>the connection pointer</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>the domain pointer</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventGraphicsCallback" id="virConnectDomainEventGraphicsCallback"><code>virConnectDomainEventGraphicsCallback</code></a></h3><pre class="programlisting">typedef void  (*virConnectDomainEventGraphicsCallback)        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int phase, <br />                                               <a href="libvirt-libvirt.html#virDomainEventGraphicsAddressPtr">virDomainEventGraphicsAddressPtr</a> local, <br />                                              <a href="libvirt-libvirt.html#virDomainEventGraphicsAddressPtr">virDomainEventGraphicsAddressPtr</a> remote, <br />                                             const char * authScheme, <br />                                                 <a href="libvirt-libvirt.html#virDomainEventGraphicsSubjectPtr">virDomainEventGraphicsSubjectPtr</a> subject, <br />                                            void * opaque)
838
922
</pre><p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_GRAPHICS">VIR_DOMAIN_EVENT_ID_GRAPHICS</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>phase</tt></i>:</span></td><td>the phase of the connection</td></tr><tr><td><span class="term"><i><tt>local</tt></i>:</span></td><td>the local server address</td></tr><tr><td><span class="term"><i><tt>remote</tt></i>:</span></td><td>the remote client address</td></tr><tr><td><span class="term"><i><tt>authScheme</tt></i>:</span></td><td>the authentication scheme activated</td></tr><tr><td><span class="term"><i><tt>subject</tt></i>:</span></td><td>the authenticated subject (user)</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventIOErrorCallback" id="virConnectDomainEventIOErrorCallback"><code>virConnectDomainEventIOErrorCallback</code></a></h3><pre class="programlisting">typedef void   (*virConnectDomainEventIOErrorCallback) (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                const char * srcPath, <br />                                            const char * devAlias, <br />                                           int action, <br />                                              void * opaque)
839
923
</pre><p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_IO_ERROR">VIR_DOMAIN_EVENT_ID_IO_ERROR</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>srcPath</tt></i>:</span></td><td>The host file on which the IO error occurred</td></tr><tr><td><span class="term"><i><tt>devAlias</tt></i>:</span></td><td>The guest device alias associated with the path</td></tr><tr><td><span class="term"><i><tt>action</tt></i>:</span></td><td>action that is to be taken due to the IO error</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventIOErrorReasonCallback" id="virConnectDomainEventIOErrorReasonCallback"><code>virConnectDomainEventIOErrorReasonCallback</code></a></h3><pre class="programlisting">typedef void       (*virConnectDomainEventIOErrorReasonCallback)   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                        const char * srcPath, <br />                                                    const char * devAlias, <br />                                                   int action, <br />                                                      const char * reason, <br />                                                     void * opaque)
840
 
</pre><p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_IO_ERROR">VIR_DOMAIN_EVENT_ID_IO_ERROR</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>srcPath</tt></i>:</span></td><td>The host file on which the IO error occurred</td></tr><tr><td><span class="term"><i><tt>devAlias</tt></i>:</span></td><td>The guest device alias associated with the path</td></tr><tr><td><span class="term"><i><tt>action</tt></i>:</span></td><td>action that is to be taken due to the IO error</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>the cause of the IO error</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventRTCChangeCallback" id="virConnectDomainEventRTCChangeCallback"><code>virConnectDomainEventRTCChangeCallback</code></a></h3><pre class="programlisting">typedef void      (*virConnectDomainEventRTCChangeCallback)       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                long long utcoffset, <br />                                             void * opaque)
 
924
</pre><p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_IO_ERROR">VIR_DOMAIN_EVENT_ID_IO_ERROR</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>srcPath</tt></i>:</span></td><td>The host file on which the IO error occurred</td></tr><tr><td><span class="term"><i><tt>devAlias</tt></i>:</span></td><td>The guest device alias associated with the path</td></tr><tr><td><span class="term"><i><tt>action</tt></i>:</span></td><td>action that is to be taken due to the IO error</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>the cause of the IO error</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventPMSuspendCallback" id="virConnectDomainEventPMSuspendCallback"><code>virConnectDomainEventPMSuspendCallback</code></a></h3><pre class="programlisting">typedef void      (*virConnectDomainEventPMSuspendCallback)       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int reason, <br />                                              void * opaque)
 
925
</pre><p>This callback occurs when the guest is waken up. The callback signature to use when registering for an event of type VIR_DOMAIN_EVENT_ID_PMSuspend with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>reason why the callback was called, unused currently, always passes 0</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventPMWakeupCallback" id="virConnectDomainEventPMWakeupCallback"><code>virConnectDomainEventPMWakeupCallback</code></a></h3><pre class="programlisting">typedef void   (*virConnectDomainEventPMWakeupCallback)        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int reason, <br />                                              void * opaque)
 
926
</pre><p>This callback occurs when the guest is waken up. The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_PMWAKEUP">VIR_DOMAIN_EVENT_ID_PMWAKEUP</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>reason why the callback was called, unused currently, always passes 0</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventRTCChangeCallback" id="virConnectDomainEventRTCChangeCallback"><code>virConnectDomainEventRTCChangeCallback</code></a></h3><pre class="programlisting">typedef void (*virConnectDomainEventRTCChangeCallback)       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                long long utcoffset, <br />                                             void * opaque)
841
927
</pre><p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_RTC_CHANGE">VIR_DOMAIN_EVENT_ID_RTC_CHANGE</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>utcoffset</tt></i>:</span></td><td>the new RTC offset from UTC, measured in seconds</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventRegister" id="virConnectDomainEventRegister"><code>virConnectDomainEventRegister</code></a></h3><pre class="programlisting">int    virConnectDomainEventRegister   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virConnectDomainEventCallback">virConnectDomainEventCallback</a> cb, <br />                                       void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> freecb)<br />
842
928
</pre><p>Adds a callback to receive notifications of domain lifecycle events occurring on a connection Use of this method is no longer recommended. Instead applications should try <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a> which has a more flexible API contract The <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> 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 <a href="libvirt-libvirt.html#virDomainRef">virDomainRef</a>. The reference can be released once the object is no longer required by calling <a href="libvirt-libvirt.html#virDomainFree">virDomainFree</a>.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the connection</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque data to pass on to the callback</td></tr><tr><td><span class="term"><i><tt>freecb</tt></i>:</span></td><td>optional function to deallocate opaque when not used anymore</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectDomainEventRegisterAny" id="virConnectDomainEventRegisterAny"><code>virConnectDomainEventRegisterAny</code></a></h3><pre class="programlisting">int     virConnectDomainEventRegisterAny        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int eventID, <br />                                             <a href="libvirt-libvirt.html#virConnectDomainEventGenericCallback">virConnectDomainEventGenericCallback</a> cb, <br />                                                 void * opaque, <br />                                           <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> freecb)<br />
843
 
</pre><p>Adds a callback to receive notifications of arbitrary domain events occurring on a domain. 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 neccessary to use the <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_CALLBACK">VIR_DOMAIN_EVENT_CALLBACK</a>() macro to cast the supplied function pointer to match the signature of this method. The <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> 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 <a href="libvirt-libvirt.html#virDomainRef">virDomainRef</a>. The reference can be released once the object is no longer required by calling <a href="libvirt-libvirt.html#virDomainFree">virDomainFree</a>. The return value from this method is a positive integer identifier for the callback. To unregister a callback, this callback ID should be passed to the virDomainEventUnregisterAny method</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the connection</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain</td></tr><tr><td><span class="term"><i><tt>eventID</tt></i>:</span></td><td>the event type to receive</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque data to pass on to the callback</td></tr><tr><td><span class="term"><i><tt>freecb</tt></i>:</span></td><td>optional function to deallocate opaque when not used anymore</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a callback identifier on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectDomainEventWatchdogCallback" id="virConnectDomainEventWatchdogCallback"><code>virConnectDomainEventWatchdogCallback</code></a></h3><pre class="programlisting">typedef void    (*virConnectDomainEventWatchdogCallback)        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int action, <br />                                              void * opaque)
 
929
</pre><p>Adds a callback to receive notifications of arbitrary domain events occurring on a domain. 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_CALLBACK">VIR_DOMAIN_EVENT_CALLBACK</a>() macro to cast the supplied function pointer to match the signature of this method. The <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> 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 <a href="libvirt-libvirt.html#virDomainRef">virDomainRef</a>. The reference can be released once the object is no longer required by calling <a href="libvirt-libvirt.html#virDomainFree">virDomainFree</a>. The return value from this method is a positive integer identifier for the callback. To unregister a callback, this callback ID should be passed to the virDomainEventUnregisterAny method</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the connection</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain</td></tr><tr><td><span class="term"><i><tt>eventID</tt></i>:</span></td><td>the event type to receive</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to the function handling domain events</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque data to pass on to the callback</td></tr><tr><td><span class="term"><i><tt>freecb</tt></i>:</span></td><td>optional function to deallocate opaque when not used anymore</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a callback identifier on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virConnectDomainEventTrayChangeCallback" id="virConnectDomainEventTrayChangeCallback"><code>virConnectDomainEventTrayChangeCallback</code></a></h3><pre class="programlisting">typedef void       (*virConnectDomainEventTrayChangeCallback)      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                const char * devAlias, <br />                                           int reason, <br />                                              void * opaque)
 
930
</pre><p>This callback occurs when the tray of a removable device is moved. The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_TRAY_CHANGE">VIR_DOMAIN_EVENT_ID_TRAY_CHANGE</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>devAlias</tt></i>:</span></td><td>device alias</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>why the tray status was changed?</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainEventWatchdogCallback" id="virConnectDomainEventWatchdogCallback"><code>virConnectDomainEventWatchdogCallback</code></a></h3><pre class="programlisting">typedef void       (*virConnectDomainEventWatchdogCallback)        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                                int action, <br />                                              void * opaque)
844
931
</pre><p>The callback signature to use when registering for an event of type <a href="libvirt-libvirt.html#VIR_DOMAIN_EVENT_ID_WATCHDOG">VIR_DOMAIN_EVENT_ID_WATCHDOG</a> with <a href="libvirt-libvirt.html#virConnectDomainEventRegisterAny">virConnectDomainEventRegisterAny</a>()</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>connection object</td></tr><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>domain on which the event occurred</td></tr><tr><td><span class="term"><i><tt>action</tt></i>:</span></td><td>action that is to be taken due to watchdog firing</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application specified data</td></tr></tbody></table></div><br /><h3><a name="virConnectDomainXMLFromNative" id="virConnectDomainXMLFromNative"><code>virConnectDomainXMLFromNative</code></a></h3><pre class="programlisting">char *       virConnectDomainXMLFromNative   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * nativeFormat, <br />                                       const char * nativeConfig, <br />                                       unsigned int flags)<br />
845
 
</pre><p>Reads native configuration data describing a domain, and generates libvirt domain XML. The format of the native data is hypervisor dependant.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>a connection object</td></tr><tr><td><span class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration format importing from</td></tr><tr><td><span class="term"><i><tt>nativeConfig</tt></i>:</span></td><td>the configuration data to import</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virConnectDomainXMLToNative" id="virConnectDomainXMLToNative"><code>virConnectDomainXMLToNative</code></a></h3><pre class="programlisting">char *        virConnectDomainXMLToNative     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * nativeFormat, <br />                                       const char * domainXml, <br />                                  unsigned int flags)<br />
846
 
</pre><p>Reads a domain XML configuration document, and generates a native configuration file describing the domain. The format of the native data is hypervisor dependant.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>a connection object</td></tr><tr><td><span class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration format exporting to</td></tr><tr><td><span class="term"><i><tt>domainXml</tt></i>:</span></td><td>the domain configuration to export</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded native config datafile, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virConnectFindStoragePoolSources" id="virConnectFindStoragePoolSources"><code>virConnectFindStoragePoolSources</code></a></h3><pre class="programlisting">char *     virConnectFindStoragePoolSources        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * type, <br />                                               const char * srcSpec, <br />                                            unsigned int flags)<br />
847
 
</pre><p>Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only)</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of storage pool sources to discover</td></tr><tr><td><span class="term"><i><tt>srcSpec</tt></i>:</span></td><td>XML document specifying discovery source</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for discovery (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an xml document consisting of a SourceList element containing a source document appropriate to the given pool type for each discovered source.</td></tr></tbody></table></div><h3><a name="virConnectGetCapabilities" id="virConnectGetCapabilities"><code>virConnectGetCapabilities</code></a></h3><pre class="programlisting">char *        virConnectGetCapabilities       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
 
932
</pre><p>Reads native configuration data describing a domain, and generates libvirt domain XML. The format of the native data is hypervisor dependant.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>a connection object</td></tr><tr><td><span class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration format importing from</td></tr><tr><td><span class="term"><i><tt>nativeConfig</tt></i>:</span></td><td>the configuration data to import</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virConnectDomainXMLToNative" id="virConnectDomainXMLToNative"><code>virConnectDomainXMLToNative</code></a></h3><pre class="programlisting">char *      virConnectDomainXMLToNative     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * nativeFormat, <br />                                       const char * domainXml, <br />                                  unsigned int flags)<br />
 
933
</pre><p>Reads a domain XML configuration document, and generates a native configuration file describing the domain. The format of the native data is hypervisor dependant.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>a connection object</td></tr><tr><td><span class="term"><i><tt>nativeFormat</tt></i>:</span></td><td>configuration format exporting to</td></tr><tr><td><span class="term"><i><tt>domainXml</tt></i>:</span></td><td>the domain configuration to export</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded native config datafile, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virConnectFindStoragePoolSources" id="virConnectFindStoragePoolSources"><code>virConnectFindStoragePoolSources</code></a></h3><pre class="programlisting">char *   virConnectFindStoragePoolSources        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * type, <br />                                               const char * srcSpec, <br />                                            unsigned int flags)<br />
 
934
</pre><p>Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. e.g. For iSCSI this would be a set of iSCSI targets. For NFS this would be a list of exported paths. The srcSpec (optional for some storage pool types, e.g. local ones) is an instance of the storage pool's source element specifying where to look for the pools. srcSpec is not required for some types (e.g., those querying local storage resources only)</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of storage pool sources to discover</td></tr><tr><td><span class="term"><i><tt>srcSpec</tt></i>:</span></td><td>XML document specifying discovery source</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an xml document consisting of a SourceList element containing a source document appropriate to the given pool type for each discovered source.</td></tr></tbody></table></div><h3><a name="virConnectGetCapabilities" id="virConnectGetCapabilities"><code>virConnectGetCapabilities</code></a></h3><pre class="programlisting">char *  virConnectGetCapabilities       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
848
935
</pre><p>Provides capabilities of the hypervisor / driver.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of error, or an XML string defining the capabilities. The client must free the returned string after use.</td></tr></tbody></table></div><h3><a name="virConnectGetHostname" id="virConnectGetHostname"><code>virConnectGetHostname</code></a></h3><pre class="programlisting">char *        virConnectGetHostname           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
849
936
</pre><p>This returns the system hostname on which the hypervisor is running (the result of the gethostname system call). If we are connected to a remote system, then this returns the hostname of the remote system.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to a hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the hostname which must be freed by the caller, or NULL if there was an error.</td></tr></tbody></table></div><h3><a name="virConnectGetLibVersion" id="virConnectGetLibVersion"><code>virConnectGetLibVersion</code></a></h3><pre class="programlisting">int   virConnectGetLibVersion         (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned long * libVer)<br />
850
937
</pre><p>Provides @libVer, which is the version of libvirt used by the daemon running on the @conn host</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>libVer</tt></i>:</span></td><td>returns the libvirt library version used on the connection (OUT)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise, and values for @libVer have the format major * 1,000,000 + minor * 1,000 + release.</td></tr></tbody></table></div><h3><a name="virConnectGetMaxVcpus" id="virConnectGetMaxVcpus"><code>virConnectGetMaxVcpus</code></a></h3><pre class="programlisting">int virConnectGetMaxVcpus           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * type)<br />
851
938
</pre><p>Provides the maximum number of virtual CPUs supported for a guest VM of a specific type. The 'type' parameter here corresponds to the 'type' attribute in the &lt;domain&gt; element of the XML.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>value of the 'type' attribute in the &lt;domain&gt; element</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the maximum of virtual CPU or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virConnectGetSysinfo" id="virConnectGetSysinfo"><code>virConnectGetSysinfo</code></a></h3><pre class="programlisting">char *   virConnectGetSysinfo            (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int flags)<br />
852
 
</pre><p>This returns the XML description of the sysinfo details for the host on which the hypervisor is running, in the same format as the &lt;sysinfo&gt; element of a domain XML. This information is generally available only for hypervisors running with root privileges.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to a hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML string which must be freed by the caller, or NULL if there was an error.</td></tr></tbody></table></div><h3><a name="virConnectGetType" id="virConnectGetType"><code>virConnectGetType</code></a></h3><pre class="programlisting">const char *  virConnectGetType       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
 
939
</pre><p>This returns the XML description of the sysinfo details for the host on which the hypervisor is running, in the same format as the &lt;sysinfo&gt; element of a domain XML. This information is generally available only for hypervisors running with root privileges.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to a hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML string which must be freed by the caller, or NULL if there was an error.</td></tr></tbody></table></div><h3><a name="virConnectGetType" id="virConnectGetType"><code>virConnectGetType</code></a></h3><pre class="programlisting">const char *    virConnectGetType       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
853
940
</pre><p>Get the name of the Hypervisor software used.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of error, a static zero terminated string otherwise. See also: http://www.redhat.com/archives/libvir-list/2007-February/msg00096.html</td></tr></tbody></table></div><h3><a name="virConnectGetURI" id="virConnectGetURI"><code>virConnectGetURI</code></a></h3><pre class="programlisting">char *       virConnectGetURI                (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
854
941
</pre><p>This returns the URI (name) of the hypervisor connection. Normally this is the same as or similar to the string passed to the virConnectOpen/virConnectOpenReadOnly call, but the driver may make the URI canonical. If name == NULL was passed to <a href="libvirt-libvirt.html#virConnectOpen">virConnectOpen</a>, then the driver will return a non-NULL URI which can be used to connect to the same hypervisor later.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to a hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the URI string which must be freed by the caller, or NULL if there was an error.</td></tr></tbody></table></div><h3><a name="virConnectGetVersion" id="virConnectGetVersion"><code>virConnectGetVersion</code></a></h3><pre class="programlisting">int     virConnectGetVersion            (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned long * hvVer)<br />
855
942
</pre><p>Get the version level of the Hypervisor running. This may work only with hypervisor call, i.e. with privileged access to the hypervisor, not with a Read-Only connection.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>hvVer</tt></i>:</span></td><td>return value for the version of the running hypervisor (OUT)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise. if the version can't be extracted by lack of capacities returns 0 and @hvVer is 0, otherwise @hvVer value is major * 1,000,000 + minor * 1,000 + release</td></tr></tbody></table></div><h3><a name="virConnectIsAlive" id="virConnectIsAlive"><code>virConnectIsAlive</code></a></h3><pre class="programlisting">int    virConnectIsAlive               (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
860
947
</pre><p>Collect the list of defined (inactive) physical host interfaces, and store their names in @names.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of interfaces</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of interfaces found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectListDefinedNetworks" id="virConnectListDefinedNetworks"><code>virConnectListDefinedNetworks</code></a></h3><pre class="programlisting">int     virConnectListDefinedNetworks   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     char ** const names, <br />                                     int maxnames)<br />
861
948
</pre><p>list the inactive networks, stores the pointers to the names in @names</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>pointer to an array to store the names</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of the array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of names provided in the array or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectListDefinedStoragePools" id="virConnectListDefinedStoragePools"><code>virConnectListDefinedStoragePools</code></a></h3><pre class="programlisting">int        virConnectListDefinedStoragePools       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             char ** const names, <br />                                             int maxnames)<br />
862
949
</pre><p>Provides the list of names of inactive storage pools upto maxnames. If there are more than maxnames, the remaining names will be silently ignored.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array of char * to fill with pool names (allocated by caller)</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of the names array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on error</td></tr></tbody></table></div><h3><a name="virConnectListDomains" id="virConnectListDomains"><code>virConnectListDomains</code></a></h3><pre class="programlisting">int      virConnectListDomains           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     int * ids, <br />                                       int maxids)<br />
863
 
</pre><p>Collect the list of active domains, and store their ID in @maxids</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>ids</tt></i>:</span></td><td>array to collect the list of IDs of active domains</td></tr><tr><td><span class="term"><i><tt>maxids</tt></i>:</span></td><td>size of @ids</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectListInterfaces" id="virConnectListInterfaces"><code>virConnectListInterfaces</code></a></h3><pre class="programlisting">int    virConnectListInterfaces        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     char ** const names, <br />                                     int maxnames)<br />
 
950
</pre><p>Collect the list of active domains, and store their IDs in array @ids</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>ids</tt></i>:</span></td><td>array to collect the list of IDs of active domains</td></tr><tr><td><span class="term"><i><tt>maxids</tt></i>:</span></td><td>size of @ids</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domains found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectListInterfaces" id="virConnectListInterfaces"><code>virConnectListInterfaces</code></a></h3><pre class="programlisting">int       virConnectListInterfaces        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     char ** const names, <br />                                     int maxnames)<br />
864
951
</pre><p>Collect the list of active physical host interfaces, and store their names in @names</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of interfaces</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of interfaces found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectListNWFilters" id="virConnectListNWFilters"><code>virConnectListNWFilters</code></a></h3><pre class="programlisting">int    virConnectListNWFilters         (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     char ** const names, <br />                                     int maxnames)<br />
865
952
</pre><p>Collect the list of network filters, and store their names in @names</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of network filters</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of network filters found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectListNetworks" id="virConnectListNetworks"><code>virConnectListNetworks</code></a></h3><pre class="programlisting">int     virConnectListNetworks          (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     char ** const names, <br />                                     int maxnames)<br />
866
953
</pre><p>Collect the list of active networks, and store their names in @names</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of active networks</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of networks found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectListSecrets" id="virConnectListSecrets"><code>virConnectListSecrets</code></a></h3><pre class="programlisting">int       virConnectListSecrets           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     char ** uuids, <br />                                   int maxuuids)<br />
876
963
</pre><p>Provides the number of active networks.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of network found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virConnectNumOfSecrets" id="virConnectNumOfSecrets"><code>virConnectNumOfSecrets</code></a></h3><pre class="programlisting">int      virConnectNumOfSecrets          (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
877
964
</pre><p>Fetch number of currently defined secrets.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number currently defined secrets.</td></tr></tbody></table></div><h3><a name="virConnectNumOfStoragePools" id="virConnectNumOfStoragePools"><code>virConnectNumOfStoragePools</code></a></h3><pre class="programlisting">int  virConnectNumOfStoragePools     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
878
965
</pre><p>Provides the number of active storage pools</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of pools found, or -1 on error</td></tr></tbody></table></div><h3><a name="virConnectOpen" id="virConnectOpen"><code>virConnectOpen</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>    virConnectOpen          (const char * name)<br />
879
 
</pre><p>This function should be called first to get a connection to the Hypervisor and xen store</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error If @name is NULL then probing will be done to determine a suitable default driver to activate. This involves trying each hypervisor in turn until one successfully opens. If the LIBVIRT_DEFAULT_URI environment variable is set, then it will be used in preference to probing for a driver. If connecting to an unprivileged hypervisor driver which requires the libvirtd daemon to be active, it will automatically be launched if not already running. This can be prevented by setting the environment variable LIBVIRT_AUTOSTART=0 URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectOpenAuth" id="virConnectOpenAuth"><code>virConnectOpenAuth</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>   virConnectOpenAuth      (const char * name, <br />                                       <a href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a> auth, <br />                                     unsigned int flags)<br />
880
 
</pre><p>This function should be called first to get a connection to the Hypervisor. If necessary, authentication will be performed fetching credentials via the callback See <a href="libvirt-libvirt.html#virConnectOpen">virConnectOpen</a> for notes about environment variables which can have an effect on opening drivers</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>auth</tt></i>:</span></td><td>Authenticate callback parameters</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>Open flags</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectOpenReadOnly" id="virConnectOpenReadOnly"><code>virConnectOpenReadOnly</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>   virConnectOpenReadOnly  (const char * name)<br />
 
966
</pre><p>This function should be called first to get a connection to the Hypervisor and xen store</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error If @name is NULL, if the LIBVIRT_DEFAULT_URI environment variable is set, then it will be used. Otherwise if the client configuration file has the "uri_default" parameter set, then it will be used. Finally probing will be done to determine a suitable default driver to activate. This involves trying each hypervisor in turn until one successfully opens. If connecting to an unprivileged hypervisor driver which requires the libvirtd daemon to be active, it will automatically be launched if not already running. This can be prevented by setting the environment variable LIBVIRT_AUTOSTART=0 URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectOpenAuth" id="virConnectOpenAuth"><code>virConnectOpenAuth</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>       virConnectOpenAuth      (const char * name, <br />                                       <a href="libvirt-libvirt.html#virConnectAuthPtr">virConnectAuthPtr</a> auth, <br />                                     unsigned int flags)<br />
 
967
</pre><p>This function should be called first to get a connection to the Hypervisor. If necessary, authentication will be performed fetching credentials via the callback See <a href="libvirt-libvirt.html#virConnectOpen">virConnectOpen</a> for notes about environment variables which can have an effect on opening drivers</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>auth</tt></i>:</span></td><td>Authenticate callback parameters</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virConnectFlags">virConnectFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectOpenReadOnly" id="virConnectOpenReadOnly"><code>virConnectOpenReadOnly</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>     virConnectOpenReadOnly  (const char * name)<br />
881
968
</pre><p>This function should be called first to get a restricted connection to the library functionalities. The set of APIs usable are then restricted on the available methods to control the domains. See <a href="libvirt-libvirt.html#virConnectOpen">virConnectOpen</a> for notes about environment variables which can have an effect on opening drivers</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>URI of the hypervisor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the hypervisor connection or NULL in case of error URIs are documented at http://libvirt.org/uri.html</td></tr></tbody></table></div><h3><a name="virConnectRef" id="virConnectRef"><code>virConnectRef</code></a></h3><pre class="programlisting">int virConnectRef                   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
882
969
</pre><p>Increment the reference count on the connection. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virConnectClose">virConnectClose</a> 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 connection would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>the connection to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure</td></tr></tbody></table></div><h3><a name="virConnectSetKeepAlive" id="virConnectSetKeepAlive"><code>virConnectSetKeepAlive</code></a></h3><pre class="programlisting">int virConnectSetKeepAlive          (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     int interval, <br />                                    unsigned int count)<br />
883
 
</pre><p>Start sending keepalive messages after interval second of inactivity and consider the connection to be broken when no response is received after count keepalive messages sent in a row. In other words, sending count + 1 keepalive message results in closing the connection. When interval is &lt;= 0, no keepalive messages will be sent. When count is 0, the connection will be automatically closed after interval seconds of inactivity without sending any keepalive messages. Note: client has to implement and run event loop to be able to use keepalive messages. Failure to do so may result in connections being closed unexpectedly.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to a hypervisor connection</td></tr><tr><td><span class="term"><i><tt>interval</tt></i>:</span></td><td>number of seconds of inactivity before a keepalive message is sent</td></tr><tr><td><span class="term"><i><tt>count</tt></i>:</span></td><td>number of messages that can be sent in a row</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 on error, 0 on success, 1 when remote party doesn't support keepalive messages.</td></tr></tbody></table></div><h3><a name="virDomainAbortJob" id="virDomainAbortJob"><code>virDomainAbortJob</code></a></h3><pre class="programlisting">int   virDomainAbortJob               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
970
</pre><p>Start sending keepalive messages after interval second of inactivity and consider the connection to be broken when no response is received after count keepalive messages sent in a row. In other words, sending count + 1 keepalive message results in closing the connection. When interval is &lt;= 0, no keepalive messages will be sent. When count is 0, the connection will be automatically closed after interval seconds of inactivity without sending any keepalive messages. Note: client has to implement and run event loop to be able to use keepalive messages. Failure to do so may result in connections being closed unexpectedly. Note: This API function controls only keepalive messages sent by the client. If the server is configured to use keepalive you still need to run the event loop to respond to them, even if you disable keepalives by this function.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to a hypervisor connection</td></tr><tr><td><span class="term"><i><tt>interval</tt></i>:</span></td><td>number of seconds of inactivity before a keepalive message is sent</td></tr><tr><td><span class="term"><i><tt>count</tt></i>:</span></td><td>number of messages that can be sent in a row</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 on error, 0 on success, 1 when remote party doesn't support keepalive messages.</td></tr></tbody></table></div><h3><a name="virDomainAbortJob" id="virDomainAbortJob"><code>virDomainAbortJob</code></a></h3><pre class="programlisting">int       virDomainAbortJob               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
884
971
</pre><p>Requests that the current background job be aborted at the soonest opportunity. This will block until the job has either completed, or aborted.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainAttachDevice" id="virDomainAttachDevice"><code>virDomainAttachDevice</code></a></h3><pre class="programlisting">int       virDomainAttachDevice           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * xml)<br />
885
972
</pre><p>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 virDomainUpdateDeviceFlag method instead.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainAttachDeviceFlags" id="virDomainAttachDeviceFlags"><code>virDomainAttachDeviceFlags</code></a></h3><pre class="programlisting">int virDomainAttachDeviceFlags      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
886
 
</pre><p>Attach a virtual device to a domain, using the flags parameter to control how the device is attached. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a> specifies that the device allocation is made based on current domain state. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> specifies that the device shall be allocated to the active domain instance only and is not added to the persisted domain configuration. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainDeviceModifyFlags">virDomainDeviceModifyFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockJobAbort" id="virDomainBlockJobAbort"><code>virDomainBlockJobAbort</code></a></h3><pre class="programlisting">int  virDomainBlockJobAbort          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned int flags)<br />
887
 
</pre><p>Cancel the active block job on the given disk. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, for future extension</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 when successful.</td></tr></tbody></table></div><h3><a name="virDomainBlockJobSetSpeed" id="virDomainBlockJobSetSpeed"><code>virDomainBlockJobSetSpeed</code></a></h3><pre class="programlisting">int      virDomainBlockJobSetSpeed       (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)<br />
888
 
</pre><p>Set the maximimum allowable bandwidth that a block job may consume. If bandwidth is 0, the limit will revert to the hypervisor default. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>specify bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, for future extension</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 when successful.</td></tr></tbody></table></div><h3><a name="virDomainBlockPeek" id="virDomainBlockPeek"><code>virDomainBlockPeek</code></a></h3><pre class="programlisting">int    virDomainBlockPeek              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long long offset, <br />                                       size_t size, <br />                                     void * buffer, <br />                                   unsigned int flags)<br />
889
 
</pre><p>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 &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() 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 &lt;= 65536 bytes.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>offset</tt></i>:</span></td><td>offset within block device</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size to read</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>return buffer (must be at least size bytes)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused, always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure. really 64 bits</td></tr></tbody></table></div><h3><a name="virDomainBlockPull" id="virDomainBlockPull"><code>virDomainBlockPull</code></a></h3><pre class="programlisting">int      virDomainBlockPull              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)<br />
890
 
</pre><p>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 <a href="libvirt-libvirt.html#virDomainGetBlockJobInfo">virDomainGetBlockJobInfo</a>() and the operation can be aborted with <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>(). When finished, an asynchronous event is raised to indicate the final status. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. The maximum bandwidth (in Mbps) that will be used to do the copy can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify copy bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, for future extension</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the operation has started, -1 on failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockResize" id="virDomainBlockResize"><code>virDomainBlockResize</code></a></h3><pre class="programlisting">int    virDomainBlockResize            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long long size, <br />                                         unsigned int flags)<br />
891
 
</pre><p>Note that this call may fail if the underlying virtualization hypervisor does not support it. And this call requires privileged access to the hypervisor. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. Resize a block device of domain while the domain is running.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block image, or shorthand</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>new size of the block image in kilobytes</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused, always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockStats" id="virDomainBlockStats"><code>virDomainBlockStats</code></a></h3><pre class="programlisting">int      virDomainBlockStats             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a> stats, <br />                                  size_t size)<br />
 
973
</pre><p>Attach a virtual device to a domain, using the flags parameter to control how the device is attached. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a> specifies that the device allocation is made based on current domain state. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> specifies that the device shall be allocated to the active domain instance only and is not added to the persisted domain configuration. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainDeviceModifyFlags">virDomainDeviceModifyFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockJobAbort" id="virDomainBlockJobAbort"><code>virDomainBlockJobAbort</code></a></h3><pre class="programlisting">int    virDomainBlockJobAbort          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned int flags)<br />
 
974
</pre><p>Cancel the active block job on the given disk. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. If the current block job for @disk is <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_PULL">VIR_DOMAIN_BLOCK_JOB_TYPE_PULL</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC">VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC</a> 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_CANCELED">VIR_DOMAIN_BLOCK_JOB_CANCELED</a> (even if the ABORT_ASYNC flag was not used); it is also possible to poll <a href="libvirt-libvirt.html#virDomainBlockJobInfo">virDomainBlockJobInfo</a>() 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_COPY">VIR_DOMAIN_BLOCK_JOB_TYPE_COPY</a>, then the default is to abort the mirroring and revert to the source disk; adding @flags of <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT">VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT</a> causes this call to fail with <a href="libvirt-virterror.html#VIR_ERR_BLOCK_COPY_ACTIVE">VIR_ERR_BLOCK_COPY_ACTIVE</a> if the copy is not fully populated, otherwise it will swap the disk over to the copy to end the mirroring. An event will be issued when the job is ended, and it is possible to use <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC">VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC</a> to control whether this command waits for the completion of the job. Restarting this job requires starting over from the beginning of the first phase.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainBlockJobAbortFlags">virDomainBlockJobAbortFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 when successful.</td></tr></tbody></table></div><h3><a name="virDomainBlockJobSetSpeed" id="virDomainBlockJobSetSpeed"><code>virDomainBlockJobSetSpeed</code></a></h3><pre class="programlisting">int      virDomainBlockJobSetSpeed       (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)<br />
 
975
</pre><p>Set the maximimum allowable bandwidth that a block job may consume. If bandwidth is 0, the limit will revert to the hypervisor default. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>specify bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 when successful.</td></tr></tbody></table></div><h3><a name="virDomainBlockPeek" id="virDomainBlockPeek"><code>virDomainBlockPeek</code></a></h3><pre class="programlisting">int        virDomainBlockPeek              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long long offset, <br />                                       size_t size, <br />                                     void * buffer, <br />                                   unsigned int flags)<br />
 
976
</pre><p>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 &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() 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 &lt;= 65536 bytes.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>offset</tt></i>:</span></td><td>offset within block device</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size to read</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>return buffer (must be at least size bytes)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure. really 64 bits</td></tr></tbody></table></div><h3><a name="virDomainBlockPull" id="virDomainBlockPull"><code>virDomainBlockPull</code></a></h3><pre class="programlisting">int virDomainBlockPull              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)<br />
 
977
</pre><p>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 <a href="libvirt-libvirt.html#virDomainGetBlockJobInfo">virDomainGetBlockJobInfo</a>() and the operation can be aborted with <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>(). When finished, an asynchronous event is raised to indicate the final status. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. The maximum bandwidth (in Mbps) that will be used to do the copy can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. 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 <a href="libvirt-libvirt.html#virDomainBlockJobSetSpeed">virDomainBlockJobSetSpeed</a>() to succeed. The actual speed can be determined with <a href="libvirt-libvirt.html#virDomainGetBlockJobInfo">virDomainGetBlockJobInfo</a>(). This is shorthand for <a href="libvirt-libvirt.html#virDomainBlockRebase">virDomainBlockRebase</a>() with a NULL base.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify copy bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the operation has started, -1 on failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockRebase" id="virDomainBlockRebase"><code>virDomainBlockRebase</code></a></h3><pre class="programlisting">int       virDomainBlockRebase            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       const char * base, <br />                                       unsigned long bandwidth, <br />                                         unsigned int flags)<br />
 
978
</pre><p>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 <a href="libvirt-libvirt.html#virDomainGetBlockJobInfo">virDomainGetBlockJobInfo</a>() with a job type of <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_PULL">VIR_DOMAIN_BLOCK_JOB_TYPE_PULL</a>, and the operation can be aborted with <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>(). 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. When @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_REBASE_COPY">VIR_DOMAIN_BLOCK_REBASE_COPY</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_REBASE_SHALLOW">VIR_DOMAIN_BLOCK_REBASE_SHALLOW</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_REBASE_COPY_RAW">VIR_DOMAIN_BLOCK_REBASE_COPY_RAW</a> to force the copy to be raw (does not make sense with the shallow flag unless the source is also raw), or by using <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT">VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT</a> to reuse an existing file with initial contents identical to the backing file of the source (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). 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 <a href="libvirt-libvirt.html#virDomainBlockJobInfo">virDomainBlockJobInfo</a>() command, with a job type of <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_JOB_TYPE_COPY">VIR_DOMAIN_BLOCK_JOB_TYPE_COPY</a>. 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 <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>() 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 in the future, an event may be added 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 <a href="libvirt-libvirt.html#virDomainSave">virDomainSave</a>() or <a href="libvirt-libvirt.html#virDomainDetachDevice">virDomainDetachDevice</a>(), 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 &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. The maximum bandwidth (in Mbps) that will be used to do the copy can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. 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 <a href="libvirt-libvirt.html#virDomainBlockJobSetSpeed">virDomainBlockJobSetSpeed</a>() to succeed. The actual speed can be determined with <a href="libvirt-libvirt.html#virDomainGetBlockJobInfo">virDomainGetBlockJobInfo</a>(). When @base is NULL and @flags is 0, this is identical to <a href="libvirt-libvirt.html#virDomainBlockPull">virDomainBlockPull</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>base</tt></i>:</span></td><td>path to backing file to keep, or NULL for no backing file</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify copy bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainBlockRebaseFlags">virDomainBlockRebaseFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the operation has started, -1 on failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockResize" id="virDomainBlockResize"><code>virDomainBlockResize</code></a></h3><pre class="programlisting">int   virDomainBlockResize            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       unsigned long long size, <br />                                         unsigned int flags)<br />
 
979
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_BLOCK_RESIZE_BYTES">VIR_DOMAIN_BLOCK_RESIZE_BYTES</a>, @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. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block image, or shorthand</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>new size of the block image, see below for unit</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainBlockResizeFlags">virDomainBlockResizeFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockStats" id="virDomainBlockStats"><code>virDomainBlockStats</code></a></h3><pre class="programlisting">int  virDomainBlockStats             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockStatsPtr">virDomainBlockStatsPtr</a> stats, <br />                                  size_t size)<br />
892
980
</pre><p>This function returns block device (disk) stats for block devices attached to the domain. The @disk parameter is either the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"), or (since 0.9.8) an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>stats</tt></i>:</span></td><td>block device stats (returned)</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size of stats structure</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainBlockStatsFlags" id="virDomainBlockStatsFlags"><code>virDomainBlockStatsFlags</code></a></h3><pre class="programlisting">int     virDomainBlockStatsFlags        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)<br />
893
981
</pre><p>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 &lt;target dev='...'/&gt; sub-element, such as "xvda"), or (since 0.9.8) an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. 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(@virTypedParameter) * @nparams) bytes and call the API again. See <a href="libvirt-libvirt.html#virDomainGetMemoryParameters">virDomainGetMemoryParameters</a>() for more details.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to block stats parameter object (return value)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of block stats; input and output</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainCoreDump" id="virDomainCoreDump"><code>virDomainCoreDump</code></a></h3><pre class="programlisting">int      virDomainCoreDump               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * to, <br />                                         unsigned int flags)<br />
894
 
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DUMP_CRASH">VIR_DUMP_CRASH</a>, then leave the guest shut off with a crashed state after the dump completes. If @flags includes <a href="libvirt-libvirt.html#VIR_DUMP_LIVE">VIR_DUMP_LIVE</a>, then make the core dump while continuing to allow the guest to run; otherwise, the guest is suspended during the dump. <a href="libvirt-libvirt.html#VIR_DUMP_RESET">VIR_DUMP_RESET</a> flag forces reset of the quest after dump. The above three flags are mutually exclusive. Additionally, if @flags includes <a href="libvirt-libvirt.html#VIR_DUMP_BYPASS_CACHE">VIR_DUMP_BYPASS_CACHE</a>, 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>path for the core file</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainCoreDumpFlags">virDomainCoreDumpFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainCreate" id="virDomainCreate"><code>virDomainCreate</code></a></h3><pre class="programlisting">int     virDomainCreate                 (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
982
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DUMP_CRASH">VIR_DUMP_CRASH</a>, then leave the guest shut off with a crashed state after the dump completes. If @flags includes <a href="libvirt-libvirt.html#VIR_DUMP_LIVE">VIR_DUMP_LIVE</a>, then make the core dump while continuing to allow the guest to run; otherwise, the guest is suspended during the dump. <a href="libvirt-libvirt.html#VIR_DUMP_RESET">VIR_DUMP_RESET</a> flag forces reset of the quest after dump. The above three flags are mutually exclusive. Additionally, if @flags includes <a href="libvirt-libvirt.html#VIR_DUMP_BYPASS_CACHE">VIR_DUMP_BYPASS_CACHE</a>, 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>path for the core file</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainCoreDumpFlags">virDomainCoreDumpFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainCreate" id="virDomainCreate"><code>virDomainCreate</code></a></h3><pre class="programlisting">int       virDomainCreate                 (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
895
983
</pre><p>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 <a href="libvirt-libvirt.html#virDomainCreateWithFlags">virDomainCreateWithFlags</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainCreateLinux" id="virDomainCreateLinux"><code>virDomainCreateLinux</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>  virDomainCreateLinux    (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xmlDesc, <br />                                    unsigned int flags)<br />
896
 
</pre><p>Deprecated after 0.4.6. Renamed to <a href="libvirt-libvirt.html#virDomainCreateXML">virDomainCreateXML</a>() providing identical functionality. This existing name will left indefinitely for API compatibility.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new domain object or NULL in case of failure</td></tr></tbody></table></div><h3><a name="virDomainCreateWithFlags" id="virDomainCreateWithFlags"><code>virDomainCreateWithFlags</code></a></h3><pre class="programlisting">int    virDomainCreateWithFlags        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
897
 
</pre><p>Launch a defined domain. If the call succeeds the domain moves from the defined to the running domains pools. If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_PAUSED">VIR_DOMAIN_START_PAUSED</a> flag is set, or if the guest domain has a managed save image that requested paused state (see <a href="libvirt-libvirt.html#virDomainManagedSave">virDomainManagedSave</a>()) the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using <a href="libvirt-libvirt.html#virDomainResume">virDomainResume</a>(). In all other cases, the guest domain will be running. If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_AUTODESTROY">VIR_DOMAIN_START_AUTODESTROY</a> flag is set, the guest domain will be automatically destroyed when the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_START_BYPASS_CACHE">VIR_DOMAIN_START_BYPASS_CACHE</a> flag is set, and there is a managed save file for this domain (created by <a href="libvirt-libvirt.html#virDomainManagedSave">virDomainManagedSave</a>()), 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_START_FORCE_BOOT">VIR_DOMAIN_START_FORCE_BOOT</a> flag is set, then any managed save file for this domain is discarded, and the domain boots from scratch.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainCreateFlags">virDomainCreateFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainCreateXML" id="virDomainCreateXML"><code>virDomainCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>      virDomainCreateXML      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xmlDesc, <br />                                    unsigned int flags)<br />
898
 
</pre><p>Launch a new guest domain, based on an XML description similar to the one returned by <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() 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 <a href="libvirt-libvirt.html#virDomainDefineXML">virDomainDefineXML</a>() to define persistent domains). If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_PAUSED">VIR_DOMAIN_START_PAUSED</a> flag is set, the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using <a href="libvirt-libvirt.html#virDomainResume">virDomainResume</a>. If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_AUTODESTROY">VIR_DOMAIN_START_AUTODESTROY</a> flag is set, the guest domain will be automatically destroyed when the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainCreateFlags">virDomainCreateFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new domain object or NULL in case of failure</td></tr></tbody></table></div><h3><a name="virDomainDefineXML" id="virDomainDefineXML"><code>virDomainDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>   virDomainDefineXML      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xml)<br />
899
 
</pre><p>Define a domain, but does not start it. This definition is persistent, until explicitly undefined with <a href="libvirt-libvirt.html#virDomainUndefine">virDomainUndefine</a>(). A previous definition for this domain would be overriden if it already exists.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>the XML description for the domain, preferably in UTF-8</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of error, a pointer to the domain otherwise</td></tr></tbody></table></div><h3><a name="virDomainDestroy" id="virDomainDestroy"><code>virDomainDestroy</code></a></h3><pre class="programlisting">int  virDomainDestroy                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
900
 
</pre><p>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 <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object. This function may require privileged access If the domain is transient and has any snapshot metadata (see <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), then that metadata will automatically be deleted when the domain quits.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainDestroyFlags" id="virDomainDestroyFlags"><code>virDomainDestroyFlags</code></a></h3><pre class="programlisting">int      virDomainDestroyFlags           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
901
 
</pre><p>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 <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object. This function may require privileged access. Calling this function with no @flags set (equal to zero) is equivalent to calling <a href="libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a>. Using <a href="libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a>() may produce cleaner results for the guest's disks, but depends on guest support.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of virDomainDestroyFlagsValues</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainDetachDevice" id="virDomainDetachDevice"><code>virDomainDetachDevice</code></a></h3><pre class="programlisting">int      virDomainDetachDevice           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * xml)<br />
 
984
</pre><p>Deprecated after 0.4.6. Renamed to <a href="libvirt-libvirt.html#virDomainCreateXML">virDomainCreateXML</a>() providing identical functionality. This existing name will left indefinitely for API compatibility.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new domain object or NULL in case of failure</td></tr></tbody></table></div><h3><a name="virDomainCreateWithFlags" id="virDomainCreateWithFlags"><code>virDomainCreateWithFlags</code></a></h3><pre class="programlisting">int      virDomainCreateWithFlags        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
 
985
</pre><p>Launch a defined domain. If the call succeeds the domain moves from the defined to the running domains pools. If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_PAUSED">VIR_DOMAIN_START_PAUSED</a> flag is set, or if the guest domain has a managed save image that requested paused state (see <a href="libvirt-libvirt.html#virDomainManagedSave">virDomainManagedSave</a>()) the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using <a href="libvirt-libvirt.html#virDomainResume">virDomainResume</a>(). In all other cases, the guest domain will be running. If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_AUTODESTROY">VIR_DOMAIN_START_AUTODESTROY</a> flag is set, the guest domain will be automatically destroyed when the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_START_BYPASS_CACHE">VIR_DOMAIN_START_BYPASS_CACHE</a> flag is set, and there is a managed save file for this domain (created by <a href="libvirt-libvirt.html#virDomainManagedSave">virDomainManagedSave</a>()), 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_START_FORCE_BOOT">VIR_DOMAIN_START_FORCE_BOOT</a> flag is set, then any managed save file for this domain is discarded, and the domain boots from scratch.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainCreateFlags">virDomainCreateFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainCreateXML" id="virDomainCreateXML"><code>virDomainCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>      virDomainCreateXML      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xmlDesc, <br />                                    unsigned int flags)<br />
 
986
</pre><p>Launch a new guest domain, based on an XML description similar to the one returned by <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() 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 <a href="libvirt-libvirt.html#virDomainDefineXML">virDomainDefineXML</a>() to define persistent domains). If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_PAUSED">VIR_DOMAIN_START_PAUSED</a> flag is set, the guest domain will be started, but its CPUs will remain paused. The CPUs can later be manually started using <a href="libvirt-libvirt.html#virDomainResume">virDomainResume</a>. If the <a href="libvirt-libvirt.html#VIR_DOMAIN_START_AUTODESTROY">VIR_DOMAIN_START_AUTODESTROY</a> flag is set, the guest domain will be automatically destroyed when the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainCreateFlags">virDomainCreateFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new domain object or NULL in case of failure</td></tr></tbody></table></div><h3><a name="virDomainDefineXML" id="virDomainDefineXML"><code>virDomainDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>   virDomainDefineXML      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xml)<br />
 
987
</pre><p>Define a domain, but does not start it. This definition is persistent, until explicitly undefined with <a href="libvirt-libvirt.html#virDomainUndefine">virDomainUndefine</a>(). A previous definition for this domain would be overriden if it already exists. Some hypervisors may prevent this operation if there is a current block copy operation on a transient domain with the same id as the domain being defined; in that case, use <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>() to stop the block copy first.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>the XML description for the domain, preferably in UTF-8</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of error, a pointer to the domain otherwise</td></tr></tbody></table></div><h3><a name="virDomainDestroy" id="virDomainDestroy"><code>virDomainDestroy</code></a></h3><pre class="programlisting">int    virDomainDestroy                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
988
</pre><p>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 <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object. This function may require privileged access <a href="libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a> first requests that a guest terminate (e.g. SIGTERM), then waits for it to comply. After a reasonable timeout, if the guest still exists, virDomainDestory 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 <a href="libvirt-libvirt.html#virDomainDestroyFlags">virDomainDestroyFlags</a>, sending the <a href="libvirt-libvirt.html#VIR_DOMAIN_DESTROY_GRACEFUL">VIR_DOMAIN_DESTROY_GRACEFUL</a> flag. If the domain is transient and has any snapshot metadata (see <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), then that metadata will automatically be deleted when the domain quits.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainDestroyFlags" id="virDomainDestroyFlags"><code>virDomainDestroyFlags</code></a></h3><pre class="programlisting">int     virDomainDestroyFlags           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
 
989
</pre><p>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 <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> object. This function may require privileged access. Calling this function with no @flags set (equal to zero) is equivalent to calling <a href="libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_DESTROY_GRACEFUL">VIR_DOMAIN_DESTROY_GRACEFUL</a> in the flags will prevent the forceful termination of the guest, and <a href="libvirt-libvirt.html#virDomainDestroyFlags">virDomainDestroyFlags</a> 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_DESTROY_GRACEFUL">VIR_DOMAIN_DESTROY_GRACEFUL</a> is appropriate. Another alternative which may produce cleaner results for the guest's disks is to use <a href="libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a>() instead, but that depends on guest support (some hypervisor/guest combinations may ignore the shutdown request).</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainDestroyFlagsValues">virDomainDestroyFlagsValues</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainDetachDevice" id="virDomainDetachDevice"><code>virDomainDetachDevice</code></a></h3><pre class="programlisting">int  virDomainDetachDevice           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * xml)<br />
902
990
</pre><p>Destroy a virtual device attachment to backend. This function, having hot-unplug semantics, is only allowed on an active domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainDetachDeviceFlags" id="virDomainDetachDeviceFlags"><code>virDomainDetachDeviceFlags</code></a></h3><pre class="programlisting">int        virDomainDetachDeviceFlags      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
903
 
</pre><p>Detach a virtual device from a domain, using the flags parameter to control how the device is detached. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a> specifies that the device allocation is removed based on current domain state. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> specifies that the device shall be deallocated from the active domain instance only and is not from the persisted domain configuration. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainDeviceModifyFlags">virDomainDeviceModifyFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainFree" id="virDomainFree"><code>virDomainFree</code></a></h3><pre class="programlisting">int        virDomainFree                   (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
991
</pre><p>Detach a virtual device from a domain, using the flags parameter to control how the device is detached. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a> specifies that the device allocation is removed based on current domain state. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> specifies that the device shall be deallocated from the active domain instance only and is not from the persisted domain configuration. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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 copy operation on the device being detached; in that case, use <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>() to stop the block copy first.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainDeviceModifyFlags">virDomainDeviceModifyFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainFree" id="virDomainFree"><code>virDomainFree</code></a></h3><pre class="programlisting">int  virDomainFree                   (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
904
992
</pre><p>Free the domain object. The running instance is kept alive. The data structure is freed and should not be used thereafter.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetAutostart" id="virDomainGetAutostart"><code>virDomainGetAutostart</code></a></h3><pre class="programlisting">int    virDomainGetAutostart           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int * autostart)<br />
905
993
</pre><p>Provides a boolean value indicating whether the domain configured to be automatically started when the host machine boots.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>autostart</tt></i>:</span></td><td>the value returned</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virDomainGetBlkioParameters" id="virDomainGetBlkioParameters"><code>virDomainGetBlkioParameters</code></a></h3><pre class="programlisting">int       virDomainGetBlkioParameters     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)<br />
906
994
</pre><p>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(@virTypedParameter) * @nparams) bytes and call the API again. See <a href="libvirt-libvirt.html#virDomainGetMemoryParameters">virDomainGetMemoryParameters</a>() for an equivalent usage example. This function may require privileged access to the hypervisor. This function expects the caller to allocate the @params.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to blkio parameter object (return value, allocated by the caller)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of blkio parameters; input and output</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> and <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetBlockInfo" id="virDomainGetBlockInfo"><code>virDomainGetBlockInfo</code></a></h3><pre class="programlisting">int     virDomainGetBlockInfo           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockInfoPtr">virDomainBlockInfoPtr</a> info, <br />                                     unsigned int flags)<br />
907
 
</pre><p>Extract information about a domain's block device. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainBlockInfo">virDomainBlockInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, pass zero</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetBlockIoTune" id="virDomainGetBlockIoTune"><code>virDomainGetBlockIoTune</code></a></h3><pre class="programlisting">int    virDomainGetBlockIoTune         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)<br />
908
 
</pre><p>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(@virTypedParameter) * @nparams) bytes and call the API again. See <a href="libvirt-libvirt.html#virDomainGetMemoryParameters">virDomainGetMemoryParameters</a>() for more details. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. This parameter cannot be NULL unless @nparams is 0 on input.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>Pointer to blkio parameter object (return value, allocated by the caller)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>Pointer to number of blkio parameters</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>An OR'ed set of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetBlockJobInfo" id="virDomainGetBlockJobInfo"><code>virDomainGetBlockJobInfo</code></a></h3><pre class="programlisting">int virDomainGetBlockJobInfo        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockJobInfoPtr">virDomainBlockJobInfoPtr</a> info, <br />                                       unsigned int flags)<br />
909
 
</pre><p>Request block job information for the given disk. If an operation is active @info will be updated with the current progress. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainBlockJobInfo">virDomainBlockJobInfo</a> structure</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, for future extension</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 when nothing found, 1 when info was found.</td></tr></tbody></table></div><h3><a name="virDomainGetConnect" id="virDomainGetConnect"><code>virDomainGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>      virDomainGetConnect     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)<br />
 
995
</pre><p>Extract information about a domain's block device. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainBlockInfo">virDomainBlockInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetBlockIoTune" id="virDomainGetBlockIoTune"><code>virDomainGetBlockIoTune</code></a></h3><pre class="programlisting">int     virDomainGetBlockIoTune         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)<br />
 
996
</pre><p>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(@virTypedParameter) * @nparams) bytes and call the API again. See <a href="libvirt-libvirt.html#virDomainGetMemoryParameters">virDomainGetMemoryParameters</a>() for more details. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk. This parameter cannot be NULL unless @nparams is 0 on input.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>Pointer to blkio parameter object (return value, allocated by the caller)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>Pointer to number of blkio parameters</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> and <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetBlockJobInfo" id="virDomainGetBlockJobInfo"><code>virDomainGetBlockJobInfo</code></a></h3><pre class="programlisting">int      virDomainGetBlockJobInfo        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virDomainBlockJobInfoPtr">virDomainBlockJobInfoPtr</a> info, <br />                                       unsigned int flags)<br />
 
997
</pre><p>Request block job information for the given disk. If an operation is active @info will be updated with the current progress. The @disk parameter is either an unambiguous source name of the block device (the &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or (since 0.9.5) the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainBlockJobInfo">virDomainBlockJobInfo</a> structure</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 when nothing found, 1 when info was found.</td></tr></tbody></table></div><h3><a name="virDomainGetCPUStats" id="virDomainGetCPUStats"><code>virDomainGetCPUStats</code></a></h3><pre class="programlisting">int  virDomainGetCPUStats            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     unsigned int nparams, <br />                                    int start_cpu, <br />                                   unsigned int ncpus, <br />                                      unsigned int flags)<br />
 
998
</pre><p>Get statistics relating to CPU usage attributable to a single domain (in contrast to the statistics returned by <a href="libvirt-libvirt.html#virNodeGetCPUStats">virNodeGetCPUStats</a>() 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 <a href="libvirt-libvirt.html#virNodeGetInfo">virNodeGetInfo</a>(), 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 <a href="libvirt-libvirt.html#virDomainGetVcpusFlags">virDomainGetVcpusFlags</a>() rather than <a href="libvirt-libvirt.html#virNodeGetInfo">virNodeGetInfo</a>(). 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) =&gt; nparams params = calloc(nparams, sizeof(virTypedParameter)) virDomainGetCPUStats(dom, params, nparams, -1, 1, 0) =&gt; total stats. getting per-cpu stats: virDomainGetCPUStats(dom, NULL, 0, 0, 0, 0) =&gt; ncpus virDomainGetCPUStats(dom, NULL, 0, 0, 1, 0) =&gt; nparams params = calloc(ncpus * nparams, sizeof(virTypedParameter)) virDomainGetCPUStats(dom, params, nparams, 0, ncpus, 0) =&gt; per-cpu stats</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>domain to query</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>array to populate on output</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of parameters per cpu</td></tr><tr><td><span class="term"><i><tt>start_cpu</tt></i>:</span></td><td>which cpu to start with, or -1 for summary</td></tr><tr><td><span class="term"><i><tt>ncpus</tt></i>:</span></td><td>how many cpus to query</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-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.</td></tr></tbody></table></div><h3><a name="virDomainGetConnect" id="virDomainGetConnect"><code>virDomainGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>     virDomainGetConnect     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)<br />
910
999
</pre><p>Provides the connection pointer associated with a domain. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the domain object together.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to a domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or NULL in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetControlInfo" id="virDomainGetControlInfo"><code>virDomainGetControlInfo</code></a></h3><pre class="programlisting">int     virDomainGetControlInfo         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virDomainControlInfoPtr">virDomainControlInfoPtr</a> info, <br />                                         unsigned int flags)<br />
911
 
</pre><p>Extract details about current state of control interface to a domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainControlInfo">virDomainControlInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>additional flags, 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetID" id="virDomainGetID"><code>virDomainGetID</code></a></h3><pre class="programlisting">unsigned int    virDomainGetID          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
1000
</pre><p>Extract details about current state of control interface to a domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainControlInfo">virDomainControlInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetDiskErrors" id="virDomainGetDiskErrors"><code>virDomainGetDiskErrors</code></a></h3><pre class="programlisting">int      virDomainGetDiskErrors          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        <a href="libvirt-libvirt.html#virDomainDiskErrorPtr">virDomainDiskErrorPtr</a> errors, <br />                                   unsigned int maxerrors, <br />                                  unsigned int flags)<br />
 
1001
</pre><p>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</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>errors</tt></i>:</span></td><td>array to populate on output</td></tr><tr><td><span class="term"><i><tt>maxerrors</tt></i>:</span></td><td>size of @errors array</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>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. Returns number of disks with errors filled in the @errors array or -1 on error.</td></tr></tbody></table></div><h3><a name="virDomainGetID" id="virDomainGetID"><code>virDomainGetID</code></a></h3><pre class="programlisting">unsigned int   virDomainGetID          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
912
1002
</pre><p>Get the hypervisor ID number for the domain</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the domain ID number or (unsigned int) -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainGetInfo" id="virDomainGetInfo"><code>virDomainGetInfo</code></a></h3><pre class="programlisting">int       virDomainGetInfo                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virDomainInfoPtr">virDomainInfoPtr</a> info)<br />
913
 
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainInfo">virDomainInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetJobInfo" id="virDomainGetJobInfo"><code>virDomainGetJobInfo</code></a></h3><pre class="programlisting">int      virDomainGetJobInfo             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virDomainJobInfoPtr">virDomainJobInfoPtr</a> info)<br />
 
1003
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainInfo">virDomainInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetInterfaceParameters" id="virDomainGetInterfaceParameters"><code>virDomainGetInterfaceParameters</code></a></h3><pre class="programlisting">int  virDomainGetInterfaceParameters (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * device, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)<br />
 
1004
</pre><p>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(@virTypedParameter) * @nparams) bytes and call the API again. See <a href="libvirt-libvirt.html#virDomainGetMemoryParameters">virDomainGetMemoryParameters</a>() for an equivalent usage example. This function may require privileged access to the hypervisor. This function expects the caller to allocate the @params.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>device</tt></i>:</span></td><td>the interface name or mac address</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to interface parameter objects (return value, allocated by the caller)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of interface parameter; input and output</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> and <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetJobInfo" id="virDomainGetJobInfo"><code>virDomainGetJobInfo</code></a></h3><pre class="programlisting">int  virDomainGetJobInfo             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virDomainJobInfoPtr">virDomainJobInfoPtr</a> info)<br />
914
1005
</pre><p>Extract information about progress of a background job on a domain. Will return an error if the domain is not active.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virDomainJobInfo">virDomainJobInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetMaxMemory" id="virDomainGetMaxMemory"><code>virDomainGetMaxMemory</code></a></h3><pre class="programlisting">unsigned long    virDomainGetMaxMemory   (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
915
 
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the memory size in kilobytes or 0 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainGetMaxVcpus" id="virDomainGetMaxVcpus"><code>virDomainGetMaxVcpus</code></a></h3><pre class="programlisting">int  virDomainGetMaxVcpus            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
1006
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the memory size in kibibytes (blocks of 1024 bytes), or 0 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainGetMaxVcpus" id="virDomainGetMaxVcpus"><code>virDomainGetMaxVcpus</code></a></h3><pre class="programlisting">int  virDomainGetMaxVcpus            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
916
1007
</pre><p>Provides the maximum number of virtual CPUs supported for the guest VM. If the guest is inactive, this is basically the same as <a href="libvirt-libvirt.html#virConnectGetMaxVcpus">virConnectGetMaxVcpus</a>(). If the guest is running this will reflect the maximum number of virtual CPUs the guest was booted with. For more details, see <a href="libvirt-libvirt.html#virDomainGetVcpusFlags">virDomainGetVcpusFlags</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the maximum of virtual CPU or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainGetMemoryParameters" id="virDomainGetMemoryParameters"><code>virDomainGetMemoryParameters</code></a></h3><pre class="programlisting">int  virDomainGetMemoryParameters    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)<br />
917
 
</pre><p>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(@virTypedParameter) * @nparams) bytes and call the API again. Here is a sample code snippet: if ((virDomainGetMemoryParameters(dom, NULL, &amp;nparams, 0) == 0) &amp;&amp; (nparams != 0)) { if ((params = malloc(sizeof(*params) * nparams)) == NULL) goto error; memset(params, 0, sizeof(*params) * nparams); if (virDomainGetMemoryParameters(dom, params, &amp;nparams, 0)) goto error; } This function may require privileged access to the hypervisor. This function expects the caller to allocate the @params.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to memory parameter object (return value, allocated by the caller)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of memory parameters; input and output</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> and <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetName" id="virDomainGetName"><code>virDomainGetName</code></a></h3><pre class="programlisting">const char *  virDomainGetName        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
918
 
</pre><p>Get the public name for that domain</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the domain object.</td></tr></tbody></table></div><h3><a name="virDomainGetOSType" id="virDomainGetOSType"><code>virDomainGetOSType</code></a></h3><pre class="programlisting">char *   virDomainGetOSType              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
1008
</pre><p>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(@virTypedParameter) * @nparams) bytes and call the API again. Here is a sample code snippet: if ((virDomainGetMemoryParameters(dom, NULL, &amp;nparams, 0) == 0) &amp;&amp; (nparams != 0)) { if ((params = malloc(sizeof(*params) * nparams)) == NULL) goto error; memset(params, 0, sizeof(*params) * nparams); if (virDomainGetMemoryParameters(dom, params, &amp;nparams, 0)) goto error; } This function may require privileged access to the hypervisor. This function expects the caller to allocate the @params.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to memory parameter object (return value, allocated by the caller)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of memory parameters; input and output</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> and <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetMetadata" id="virDomainGetMetadata"><code>virDomainGetMetadata</code></a></h3><pre class="programlisting">char *    virDomainGetMetadata            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int type, <br />                                        const char * uri, <br />                                        unsigned int flags)<br />
 
1009
</pre><p>Retrieves the appropriate domain element given by @type. If <a href="libvirt-libvirt.html#VIR_DOMAIN_METADATA_ELEMENT">VIR_DOMAIN_METADATA_ELEMENT</a> 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 <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN_METADATA">VIR_ERR_NO_DOMAIN_METADATA</a>. This method forms a shortcut for seeing information from <a href="libvirt-libvirt.html#virDomainSetMetadata">virDomainSetMetadata</a>() without having to go through <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>(). @flags controls whether the live domain or persistent configuration will be queried.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of description, from <a href="libvirt-libvirt.html#virDomainMetadataType">virDomainMetadataType</a></td></tr><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>XML namespace identifier</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the metadata string on success (caller must free), or NULL in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetName" id="virDomainGetName"><code>virDomainGetName</code></a></h3><pre class="programlisting">const char *  virDomainGetName        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
1010
</pre><p>Get the public name for that domain</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the domain object.</td></tr></tbody></table></div><h3><a name="virDomainGetNumaParameters" id="virDomainGetNumaParameters"><code>virDomainGetNumaParameters</code></a></h3><pre class="programlisting">int      virDomainGetNumaParameters      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams, <br />                                   unsigned int flags)<br />
 
1011
</pre><p>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(@virTypedParameter) * @nparams) bytes and call the API again. See <a href="libvirt-libvirt.html#virDomainGetMemoryParameters">virDomainGetMemoryParameters</a>() for an equivalent usage example. This function may require privileged access to the hypervisor. This function expects the caller to allocate the @params.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to numa parameter object (return value, allocated by the caller)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of numa parameters</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> and <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetOSType" id="virDomainGetOSType"><code>virDomainGetOSType</code></a></h3><pre class="programlisting">char *        virDomainGetOSType              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
919
1012
</pre><p>Get the type of domain operation system.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new string or NULL in case of error, the string must be freed by the caller.</td></tr></tbody></table></div><h3><a name="virDomainGetSchedulerParameters" id="virDomainGetSchedulerParameters"><code>virDomainGetSchedulerParameters</code></a></h3><pre class="programlisting">int       virDomainGetSchedulerParameters (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int * nparams)<br />
920
1013
</pre><p>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 <a href="libvirt-libvirt.html#virDomainGetSchedulerParametersFlags">virDomainGetSchedulerParametersFlags</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to scheduler parameter objects (return value)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of scheduler parameter objects (this value should generally be as large as the returned value nparams of <a href="libvirt-libvirt.html#virDomainGetSchedulerType">virDomainGetSchedulerType</a>()); input and output</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetSchedulerParametersFlags" id="virDomainGetSchedulerParametersFlags"><code>virDomainGetSchedulerParametersFlags</code></a></h3><pre class="programlisting">int virDomainGetSchedulerParametersFlags    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                             <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                             int * nparams, <br />                                           unsigned int flags)<br />
921
1014
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>, <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a>, or <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a>. Here is a sample code snippet: char *ret = virDomainGetSchedulerType(dom, &amp;nparams); if (ret &amp;&amp; nparams != 0) { if ((params = malloc(sizeof(*params) * nparams)) == NULL) goto error; memset(params, 0, sizeof(*params) * nparams); if (virDomainGetSchedulerParametersFlags(dom, params, &amp;nparams, 0)) goto error; }</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to scheduler parameter object (return value)</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of scheduler parameter (this value should be same than the returned value nparams of <a href="libvirt-libvirt.html#virDomainGetSchedulerType">virDomainGetSchedulerType</a>()); input and output</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> and <a href="libvirt-libvirt.html#virTypedParameterFlags">virTypedParameterFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainGetSchedulerType" id="virDomainGetSchedulerType"><code>virDomainGetSchedulerType</code></a></h3><pre class="programlisting">char *   virDomainGetSchedulerType       (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int * nparams)<br />
922
1015
</pre><p>Get the scheduler type and the number of scheduler parameters.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>pointer to number of scheduler parameters, can be NULL (return value)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of error. The caller must free the returned string.</td></tr></tbody></table></div><h3><a name="virDomainGetSecurityLabel" id="virDomainGetSecurityLabel"><code>virDomainGetSecurityLabel</code></a></h3><pre class="programlisting">int        virDomainGetSecurityLabel       (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virSecurityLabelPtr">virSecurityLabelPtr</a> seclabel)<br />
923
1016
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>seclabel</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virSecurityLabel">virSecurityLabel</a> structure</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure</td></tr></tbody></table></div><h3><a name="virDomainGetState" id="virDomainGetState"><code>virDomainGetState</code></a></h3><pre class="programlisting">int virDomainGetState               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int * state, <br />                                     int * reason, <br />                                    unsigned int flags)<br />
924
 
</pre><p>Extract domain state. Each state can be accompanied with a reason (if known) which led to the state.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>state</tt></i>:</span></td><td>returned state of the domain (one of <a href="libvirt-libvirt.html#virDomainState">virDomainState</a>)</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>returned reason which led to @state (one of virDomain*Reason corresponding to the current state); it is allowed to be NULL</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>additional flags, 0 for now.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetUUID" id="virDomainGetUUID"><code>virDomainGetUUID</code></a></h3><pre class="programlisting">int   virDomainGetUUID                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned char * uuid)<br />
 
1017
</pre><p>Extract domain state. Each state can be accompanied with a reason (if known) which led to the state.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>state</tt></i>:</span></td><td>returned state of the domain (one of <a href="libvirt-libvirt.html#virDomainState">virDomainState</a>)</td></tr><tr><td><span class="term"><i><tt>reason</tt></i>:</span></td><td>returned reason which led to @state (one of virDomain*Reason corresponding to the current state); it is allowed to be NULL</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetUUID" id="virDomainGetUUID"><code>virDomainGetUUID</code></a></h3><pre class="programlisting">int     virDomainGetUUID                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned char * uuid)<br />
925
1018
</pre><p>Get the UUID for a domain</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virDomainGetUUIDString" id="virDomainGetUUIDString"><code>virDomainGetUUIDString</code></a></h3><pre class="programlisting">int   virDomainGetUUIDString          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     char * buf)<br />
926
1019
</pre><p>Get the UUID for a domain as string. For more information about UUID see RFC4122.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a> bytes array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virDomainGetVcpuPinInfo" id="virDomainGetVcpuPinInfo"><code>virDomainGetVcpuPinInfo</code></a></h3><pre class="programlisting">int   virDomainGetVcpuPinInfo         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int ncpumaps, <br />                                    unsigned char * cpumaps, <br />                                         int maplen, <br />                                      unsigned int flags)<br />
927
 
</pre><p>Query the CPU affinity setting of all virtual CPUs of domain, store it in cpumaps.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>ncpumaps</tt></i>:</span></td><td>the number of cpumap (listed first to match <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>)</td></tr><tr><td><span class="term"><i><tt>cpumaps</tt></i>:</span></td><td>pointer to a bit map of real CPUs for all vcpus of this domain (in 8-bit bytes) (OUT) It's assumed there is &lt;ncpumaps&gt; 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 <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. Must not be NULL.</td></tr><tr><td><span class="term"><i><tt>maplen</tt></i>:</span></td><td>the number of bytes in one cpumap, from 1 up to size of CPU map. Must be positive.</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> Must not be <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> and <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> concurrently.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of virtual CPUs in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetVcpus" id="virDomainGetVcpus"><code>virDomainGetVcpus</code></a></h3><pre class="programlisting">int    virDomainGetVcpus               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virVcpuInfoPtr">virVcpuInfoPtr</a> info, <br />                                   int maxinfo, <br />                                     unsigned char * cpumaps, <br />                                         int maplen)<br />
 
1020
</pre><p>Query the CPU affinity setting of all virtual CPUs of domain, store it in cpumaps.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>ncpumaps</tt></i>:</span></td><td>the number of cpumap (listed first to match <a href="libvirt-libvirt.html#virDomainGetVcpus">virDomainGetVcpus</a>)</td></tr><tr><td><span class="term"><i><tt>cpumaps</tt></i>:</span></td><td>pointer to a bit map of real CPUs for all vcpus of this domain (in 8-bit bytes) (OUT) It's assumed there is &lt;ncpumaps&gt; 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 <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API. Must not be NULL.</td></tr><tr><td><span class="term"><i><tt>maplen</tt></i>:</span></td><td>the number of bytes in one cpumap, from 1 up to size of CPU map. Must be positive.</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a> Must not be <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> and <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> concurrently.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of virtual CPUs in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetVcpus" id="virDomainGetVcpus"><code>virDomainGetVcpus</code></a></h3><pre class="programlisting">int      virDomainGetVcpus               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virVcpuInfoPtr">virVcpuInfoPtr</a> info, <br />                                   int maxinfo, <br />                                     unsigned char * cpumaps, <br />                                         int maplen)<br />
928
1021
</pre><p>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 <a href="libvirt-libvirt.html#virDomainGetVcpuPinInfo">virDomainGetVcpuPinInfo</a> for querying just cpumaps, including on an inactive domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to an array of <a href="libvirt-libvirt.html#virVcpuInfo">virVcpuInfo</a> structures (OUT)</td></tr><tr><td><span class="term"><i><tt>maxinfo</tt></i>:</span></td><td>number of structures in info array</td></tr><tr><td><span class="term"><i><tt>cpumaps</tt></i>:</span></td><td>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 &lt;maxinfo&gt; 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 <a href="libvirt-libvirt.html#virDomainPinVcpu">virDomainPinVcpu</a>() API.</td></tr><tr><td><span class="term"><i><tt>maplen</tt></i>:</span></td><td>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.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of info filled in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetVcpusFlags" id="virDomainGetVcpusFlags"><code>virDomainGetVcpusFlags</code></a></h3><pre class="programlisting">int        virDomainGetVcpusFlags          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
929
 
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a>, this will query a running domain (which will fail if domain is not active); if it includes <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a>, this will query the XML description of the domain. It is an error to set both flags. If neither flag is set (that is, <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>), then the configuration queried depends on whether the domain is currently running. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_VCPU_MAXIMUM">VIR_DOMAIN_VCPU_MAXIMUM</a>, then the maximum virtual CPU limit is queried. Otherwise, this call queries the current virtual CPU limit.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainVcpuFlags">virDomainVcpuFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetXMLDesc" id="virDomainGetXMLDesc"><code>virDomainGetXMLDesc</code></a></h3><pre class="programlisting">char *        virDomainGetXMLDesc             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
930
 
</pre><p>Provide an XML description of the domain. The description may be reused later to relaunch the domain with <a href="libvirt-libvirt.html#virDomainCreateXML">virDomainCreateXML</a>(). No security-sensitive data will be included unless @flags contains <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_SECURE">VIR_DOMAIN_XML_SECURE</a>; this flag is rejected on read-only connections. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_INACTIVE">VIR_DOMAIN_XML_INACTIVE</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_UPDATE_CPU">VIR_DOMAIN_XML_UPDATE_CPU</a>, then the portion of the domain XML describing CPU capabilities is modified to match actual capabilities of the host.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainXMLFlags">virDomainXMLFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virDomainHasCurrentSnapshot" id="virDomainHasCurrentSnapshot"><code>virDomainHasCurrentSnapshot</code></a></h3><pre class="programlisting">int virDomainHasCurrentSnapshot     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
931
 
</pre><p>Determine if the domain has a current snapshot.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused flag parameters; callers should pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if such snapshot exists, 0 if it doesn't, -1 on error.</td></tr></tbody></table></div><h3><a name="virDomainHasManagedSaveImage" id="virDomainHasManagedSaveImage"><code>virDomainHasManagedSaveImage</code></a></h3><pre class="programlisting">int    virDomainHasManagedSaveImage    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int flags)<br />
932
 
</pre><p>Check if a domain has a managed save image as created by <a href="libvirt-libvirt.html#virDomainManagedSave">virDomainManagedSave</a>(). Note that any running domain should not have such an image, as it should have been removed on restart.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>optional flags currently unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no image is present, 1 if an image is present, and -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainInjectNMI" id="virDomainInjectNMI"><code>virDomainInjectNMI</code></a></h3><pre class="programlisting">int       virDomainInjectNMI              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
933
 
</pre><p>Send NMI to the guest</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>the flags for controlling behavior, pass 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainInterfaceStats" id="virDomainInterfaceStats"><code>virDomainInterfaceStats</code></a></h3><pre class="programlisting">int   virDomainInterfaceStats         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * path, <br />                                       <a href="libvirt-libvirt.html#virDomainInterfaceStatsPtr">virDomainInterfaceStatsPtr</a> stats, <br />                                  size_t size)<br />
 
1022
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a>, this will query a running domain (which will fail if domain is not active); if it includes <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a>, this will query the XML description of the domain. It is an error to set both flags. If neither flag is set (that is, <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>), then the configuration queried depends on whether the domain is currently running. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_VCPU_MAXIMUM">VIR_DOMAIN_VCPU_MAXIMUM</a>, then the maximum virtual CPU limit is queried. Otherwise, this call queries the current virtual CPU limit.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainVcpuFlags">virDomainVcpuFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainGetXMLDesc" id="virDomainGetXMLDesc"><code>virDomainGetXMLDesc</code></a></h3><pre class="programlisting">char *  virDomainGetXMLDesc             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
 
1023
</pre><p>Provide an XML description of the domain. The description may be reused later to relaunch the domain with <a href="libvirt-libvirt.html#virDomainCreateXML">virDomainCreateXML</a>(). No security-sensitive data will be included unless @flags contains <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_SECURE">VIR_DOMAIN_XML_SECURE</a>; this flag is rejected on read-only connections. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_INACTIVE">VIR_DOMAIN_XML_INACTIVE</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_UPDATE_CPU">VIR_DOMAIN_XML_UPDATE_CPU</a>, then the portion of the domain XML describing CPU capabilities is modified to match actual capabilities of the host.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainXMLFlags">virDomainXMLFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virDomainHasCurrentSnapshot" id="virDomainHasCurrentSnapshot"><code>virDomainHasCurrentSnapshot</code></a></h3><pre class="programlisting">int   virDomainHasCurrentSnapshot     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
 
1024
</pre><p>Determine if the domain has a current snapshot.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if such snapshot exists, 0 if it doesn't, -1 on error.</td></tr></tbody></table></div><h3><a name="virDomainHasManagedSaveImage" id="virDomainHasManagedSaveImage"><code>virDomainHasManagedSaveImage</code></a></h3><pre class="programlisting">int       virDomainHasManagedSaveImage    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int flags)<br />
 
1025
</pre><p>Check if a domain has a managed save image as created by <a href="libvirt-libvirt.html#virDomainManagedSave">virDomainManagedSave</a>(). Note that any running domain should not have such an image, as it should have been removed on restart.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no image is present, 1 if an image is present, and -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainInjectNMI" id="virDomainInjectNMI"><code>virDomainInjectNMI</code></a></h3><pre class="programlisting">int    virDomainInjectNMI              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
 
1026
</pre><p>Send NMI to the guest</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainInterfaceStats" id="virDomainInterfaceStats"><code>virDomainInterfaceStats</code></a></h3><pre class="programlisting">int   virDomainInterfaceStats         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * path, <br />                                       <a href="libvirt-libvirt.html#virDomainInterfaceStatsPtr">virDomainInterfaceStatsPtr</a> stats, <br />                                  size_t size)<br />
934
1027
</pre><p>This function returns network interface stats for interfaces attached to the domain. The path parameter is the name of the network interface. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>path to the interface</td></tr><tr><td><span class="term"><i><tt>stats</tt></i>:</span></td><td>network interface stats (returned)</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size of stats structure</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainIsActive" id="virDomainIsActive"><code>virDomainIsActive</code></a></h3><pre class="programlisting">int  virDomainIsActive               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)<br />
935
1028
</pre><p>Determine if the domain is currently running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if running, 0 if inactive, -1 on error</td></tr></tbody></table></div><h3><a name="virDomainIsPersistent" id="virDomainIsPersistent"><code>virDomainIsPersistent</code></a></h3><pre class="programlisting">int       virDomainIsPersistent           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)<br />
936
1029
</pre><p>Determine if the domain has a persistent configuration which means it will still exist after shutting down</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if persistent, 0 if transient, -1 on error</td></tr></tbody></table></div><h3><a name="virDomainIsUpdated" id="virDomainIsUpdated"><code>virDomainIsUpdated</code></a></h3><pre class="programlisting">int      virDomainIsUpdated              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom)<br />
940
1033
</pre><p>Try to lookup a domain on the given hypervisor based on its UUID.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>the raw UUID for the domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new domain object or NULL in case of failure. If the domain cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainLookupByUUIDString" id="virDomainLookupByUUIDString"><code>virDomainLookupByUUIDString</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>    virDomainLookupByUUIDString     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * uuidstr)<br />
941
1034
</pre><p>Try to lookup a domain on the given hypervisor based on its UUID.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuidstr</tt></i>:</span></td><td>the string UUID for the domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new domain object or NULL in case of failure. If the domain cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainManagedSave" id="virDomainManagedSave"><code>virDomainManagedSave</code></a></h3><pre class="programlisting">int    virDomainManagedSave            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int flags)<br />
942
1035
</pre><p>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 <a href="libvirt-libvirt.html#virDomainSave">virDomainSave</a>() 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 <a href="libvirt-libvirt.html#virDomainCreate">virDomainCreate</a>() to restart it. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_BYPASS_CACHE">VIR_DOMAIN_SAVE_BYPASS_CACHE</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_RUNNING">VIR_DOMAIN_SAVE_RUNNING</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_PAUSED">VIR_DOMAIN_SAVE_PAUSED</a> in @flags will override the default saved into the file. These two flags are mutually exclusive.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSaveRestoreFlags">virDomainSaveRestoreFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure</td></tr></tbody></table></div><h3><a name="virDomainManagedSaveRemove" id="virDomainManagedSaveRemove"><code>virDomainManagedSaveRemove</code></a></h3><pre class="programlisting">int  virDomainManagedSaveRemove      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int flags)<br />
943
 
</pre><p>Remove any managed save image for this domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>optional flags currently unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, and -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainMemoryPeek" id="virDomainMemoryPeek"><code>virDomainMemoryPeek</code></a></h3><pre class="programlisting">int   virDomainMemoryPeek             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned long long start, <br />                                        size_t size, <br />                                     void * buffer, <br />                                   unsigned int flags)<br />
944
 
</pre><p>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 <a href="libvirt-libvirt.html#VIR_MEMORY_VIRTUAL">VIR_MEMORY_VIRTUAL</a> 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 &lt;= 65536 bytes.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>start</tt></i>:</span></td><td>start of memory to peek</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size of memory to peek</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>return buffer (must be at least size bytes)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, see below</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure. really 64 bits</td></tr></tbody></table></div><h3><a name="virDomainMemoryStats" id="virDomainMemoryStats"><code>virDomainMemoryStats</code></a></h3><pre class="programlisting">int      virDomainMemoryStats            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        <a href="libvirt-libvirt.html#virDomainMemoryStatPtr">virDomainMemoryStatPtr</a> stats, <br />                                  unsigned int nr_stats, <br />                                   unsigned int flags)<br />
945
 
</pre><p>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: <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_SWAP_IN">VIR_DOMAIN_MEMORY_STAT_SWAP_IN</a>: The total amount of data read from swap space (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_SWAP_OUT">VIR_DOMAIN_MEMORY_STAT_SWAP_OUT</a>: The total amount of memory written out to swap space (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT</a>: The number of page faults that required disk IO to service. <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT</a>: The number of page faults serviced without disk IO. <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_UNUSED">VIR_DOMAIN_MEMORY_STAT_UNUSED</a>: The amount of memory which is not being used for any purpose (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_AVAILABLE">VIR_DOMAIN_MEMORY_STAT_AVAILABLE</a>: The total amount of memory available to the domain's OS (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON">VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON</a>: Current balloon value (in kb).</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>stats</tt></i>:</span></td><td>nr_stats-sized array of stat structures (returned)</td></tr><tr><td><span class="term"><i><tt>nr_stats</tt></i>:</span></td><td>number of memory statistics requested</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused, always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>The number of stats provided or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainMigrate" id="virDomainMigrate"><code>virDomainMigrate</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>   virDomainMigrate        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn, <br />                                    unsigned long flags, <br />                                     const char * dname, <br />                                      const char * uri, <br />                                        unsigned long bandwidth)<br />
946
 
</pre><p>Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host). Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_PAUSED">VIR_MIGRATE_PAUSED</a> Leave the domain suspended on the remote side. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. Applications using the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag will probably prefer to invoke <a href="libvirt-libvirt.html#virDomainMigrateToURI">virDomainMigrateToURI</a>, avoiding the need to open connection to the destination host themselves. If a hypervisor supports renaming domains during migration, then you may set the dname parameter to the new name (otherwise it keeps the same name). If this is not supported by the hypervisor, dname must be NULL or else you will get an error. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is set, the uri parameter must be a valid libvirt connection URI, by which the source libvirt driver can connect to the destination libvirt. If omitted, the dconn connection object will be queried for its current URI. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, the URI parameter takes a hypervisor specific format. The hypervisor capabilities XML includes details of the support URI schemes. If omitted the dconn will be asked for a default URI. In either case it is typically only necessary to specify a URI if the destination host has multiple interfaces and a specific interface is required to transmit migration data. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dconn</tt></i>:</span></td><td>destination host (a connection object)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags</td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>(optional) dest hostname/URI as seen from the source host</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>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).</td></tr></tbody></table></div><h3><a name="virDomainMigrate2" id="virDomainMigrate2"><code>virDomainMigrate2</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>      virDomainMigrate2       (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn, <br />                                    const char * dxml, <br />                                       unsigned long flags, <br />                                     const char * dname, <br />                                      const char * uri, <br />                                        unsigned long bandwidth)<br />
947
 
</pre><p>Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host). Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_PAUSED">VIR_MIGRATE_PAUSED</a> Leave the domain suspended on the remote side. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. Applications using the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag will probably prefer to invoke <a href="libvirt-libvirt.html#virDomainMigrateToURI">virDomainMigrateToURI</a>, avoiding the need to open connection to the destination host themselves. If a hypervisor supports renaming domains during migration, then you may set the dname parameter to the new name (otherwise it keeps the same name). If this is not supported by the hypervisor, dname must be NULL or else you will get an error. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is set, the uri parameter must be a valid libvirt connection URI, by which the source libvirt driver can connect to the destination libvirt. If omitted, the dconn connection object will be queried for its current URI. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, the URI parameter takes a hypervisor specific format. The hypervisor capabilities XML includes details of the support URI schemes. If omitted the dconn will be asked for a default URI. In either case it is typically only necessary to specify a URI if the destination host has multiple interfaces and a specific interface is required to transmit migration data. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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. If the hypervisor supports it, @dxml can be used to alter host-specific portions of the domain XML that will be used on the destination. For example, it is possible to alter the backing filename that is associated with a disk device, in order to account for naming differences between source and destination in accessing the underlying storage. The migration will fail if @dxml would cause any guest-visible changes. Pass NULL if no changes are needed to the XML between source and destination. @dxml cannot be used to rename the domain during migration (use @dname for that purpose). Domain name in @dxml must either match the original domain name or @dname if it was specified.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dconn</tt></i>:</span></td><td>destination host (a connection object)</td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>(optional) XML config for launching guest on target</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags</td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>(optional) dest hostname/URI as seen from the source host</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>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).</td></tr></tbody></table></div><h3><a name="virDomainMigrateGetMaxSpeed" id="virDomainMigrateGetMaxSpeed"><code>virDomainMigrateGetMaxSpeed</code></a></h3><pre class="programlisting">int    virDomainMigrateGetMaxSpeed     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long * bandwidth, <br />                                       unsigned int flags)<br />
948
 
</pre><p>Get the current maximum bandwidth (in Mbps) that will be used if the domain is migrated. Not all hypervisors will support a bandwidth limit.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>return value of current migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>fine-tuning flags, currently unused, use 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 otherwise.</td></tr></tbody></table></div><h3><a name="virDomainMigrateSetMaxDowntime" id="virDomainMigrateSetMaxDowntime"><code>virDomainMigrateSetMaxDowntime</code></a></h3><pre class="programlisting">int      virDomainMigrateSetMaxDowntime  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long long downtime, <br />                                     unsigned int flags)<br />
949
 
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>downtime</tt></i>:</span></td><td>maximum tolerable downtime for live migration, in milliseconds</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>fine-tuning flags, currently unused, use 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 otherwise.</td></tr></tbody></table></div><h3><a name="virDomainMigrateSetMaxSpeed" id="virDomainMigrateSetMaxSpeed"><code>virDomainMigrateSetMaxSpeed</code></a></h3><pre class="programlisting">int virDomainMigrateSetMaxSpeed     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long bandwidth, <br />                                         unsigned int flags)<br />
950
 
</pre><p>The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. Not all hypervisors will support a bandwidth cap</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>fine-tuning flags, currently unused, use 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 otherwise.</td></tr></tbody></table></div><h3><a name="virDomainMigrateToURI" id="virDomainMigrateToURI"><code>virDomainMigrateToURI</code></a></h3><pre class="programlisting">int    virDomainMigrateToURI           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * duri, <br />                                       unsigned long flags, <br />                                     const char * dname, <br />                                      unsigned long bandwidth)<br />
951
 
</pre><p>Migrate the domain object from its current host to the destination host given by duri. Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). The operation of this API hinges on the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, the duri parameter takes a hypervisor specific format. The uri_transports element of the hypervisor capabilities XML includes details of the supported URI schemes. Not all hypervisors will support this mode of migration, so if the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is not set, then it may be necessary to use the alternative <a href="libvirt-libvirt.html#virDomainMigrate">virDomainMigrate</a> API providing and explicit <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> for the destination host. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> 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. <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. If a hypervisor supports renaming domains during migration, the dname parameter specifies the new name for the domain. Setting dname to NULL keeps the domain name the same. If domain renaming is not supported by the hypervisor, dname must be NULL or else an error will be returned. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>duri</tt></i>:</span></td><td>mandatory URI for the destination host</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags</td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the migration succeeded, -1 upon error.</td></tr></tbody></table></div><h3><a name="virDomainMigrateToURI2" id="virDomainMigrateToURI2"><code>virDomainMigrateToURI2</code></a></h3><pre class="programlisting">int      virDomainMigrateToURI2          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * dconnuri, <br />                                   const char * miguri, <br />                                     const char * dxml, <br />                                       unsigned long flags, <br />                                     const char * dname, <br />                                      unsigned long bandwidth)<br />
952
 
</pre><p>Migrate the domain object from its current host to the destination host given by duri. Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). The operation of this API hinges on the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> 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. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, then @dconnuri must be NULL. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> flag is NOT set, then the @miguri parameter allows specification of a URI to use to initiate the VM migration. It takes a hypervisor specific format. The uri_transports element of the hypervisor capabilities XML includes details of the supported URI schemes. <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. If a hypervisor supports changing the configuration of the guest during migration, the @dxml parameter specifies the new config for the guest. 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 will validate this and refuse to allow migration if the provided XML would cause a change in the guest ABI, If a hypervisor supports renaming domains during migration, the dname parameter specifies the new name for the domain. Setting dname to NULL keeps the domain name the same. If domain renaming is not supported by the hypervisor, dname must be NULL or else an error will be returned. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dconnuri</tt></i>:</span></td><td>(optional) URI for target libvirtd if @flags includes <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a></td></tr><tr><td><span class="term"><i><tt>miguri</tt></i>:</span></td><td>(optional) URI for invoking the migration, not if @flags includs <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a></td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>(optional) XML config for launching guest on target</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags</td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the migration succeeded, -1 upon error.</td></tr></tbody></table></div><h3><a name="virDomainOpenConsole" id="virDomainOpenConsole"><code>virDomainOpenConsole</code></a></h3><pre class="programlisting">int       virDomainOpenConsole            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * dev_name, <br />                                   <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> st, <br />                                         unsigned int flags)<br />
953
 
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dev_name</tt></i>:</span></td><td>the console, serial or parallel port device alias, or NULL</td></tr><tr><td><span class="term"><i><tt>st</tt></i>:</span></td><td>a stream to associate with the console</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused, pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the console was opened, -1 on error</td></tr></tbody></table></div><h3><a name="virDomainOpenGraphics" id="virDomainOpenGraphics"><code>virDomainOpenGraphics</code></a></h3><pre class="programlisting">int    virDomainOpenGraphics           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int idx, <br />                                        int fd, <br />                                  unsigned int flags)<br />
954
 
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH">VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH</a> 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</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>idx</tt></i>:</span></td><td>index of graphics config to open</td></tr><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to attach graphics to</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags to control open operation</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virDomainPinVcpu" id="virDomainPinVcpu"><code>virDomainPinVcpu</code></a></h3><pre class="programlisting">int    virDomainPinVcpu                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int vcpu, <br />                                       unsigned char * cpumap, <br />                                  int maplen)<br />
 
1036
</pre><p>Remove any managed save image for this domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, and -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainMemoryPeek" id="virDomainMemoryPeek"><code>virDomainMemoryPeek</code></a></h3><pre class="programlisting">int        virDomainMemoryPeek             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned long long start, <br />                                        size_t size, <br />                                     void * buffer, <br />                                   unsigned int flags)<br />
 
1037
</pre><p>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 <a href="libvirt-libvirt.html#VIR_MEMORY_VIRTUAL">VIR_MEMORY_VIRTUAL</a> 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 &lt;= 65536 bytes.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>start</tt></i>:</span></td><td>start of memory to peek</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>size of memory to peek</td></tr><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>return buffer (must be at least size bytes)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainMemoryFlags">virDomainMemoryFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success or -1 in case of failure. really 64 bits</td></tr></tbody></table></div><h3><a name="virDomainMemoryStats" id="virDomainMemoryStats"><code>virDomainMemoryStats</code></a></h3><pre class="programlisting">int    virDomainMemoryStats            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        <a href="libvirt-libvirt.html#virDomainMemoryStatPtr">virDomainMemoryStatPtr</a> stats, <br />                                  unsigned int nr_stats, <br />                                   unsigned int flags)<br />
 
1038
</pre><p>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: <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_SWAP_IN">VIR_DOMAIN_MEMORY_STAT_SWAP_IN</a>: The total amount of data read from swap space (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_SWAP_OUT">VIR_DOMAIN_MEMORY_STAT_SWAP_OUT</a>: The total amount of memory written out to swap space (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MAJOR_FAULT</a>: The number of page faults that required disk IO to service. <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT">VIR_DOMAIN_MEMORY_STAT_MINOR_FAULT</a>: The number of page faults serviced without disk IO. <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_UNUSED">VIR_DOMAIN_MEMORY_STAT_UNUSED</a>: The amount of memory which is not being used for any purpose (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_AVAILABLE">VIR_DOMAIN_MEMORY_STAT_AVAILABLE</a>: The total amount of memory available to the domain's OS (in kb). <a href="libvirt-libvirt.html#VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON">VIR_DOMAIN_MEMORY_STAT_ACTUAL_BALLOON</a>: Current balloon value (in kb).</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to the domain object</td></tr><tr><td><span class="term"><i><tt>stats</tt></i>:</span></td><td>nr_stats-sized array of stat structures (returned)</td></tr><tr><td><span class="term"><i><tt>nr_stats</tt></i>:</span></td><td>number of memory statistics requested</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>The number of stats provided or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainMigrate" id="virDomainMigrate"><code>virDomainMigrate</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>      virDomainMigrate        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn, <br />                                    unsigned long flags, <br />                                     const char * dname, <br />                                      const char * uri, <br />                                        unsigned long bandwidth)<br />
 
1039
</pre><p>Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host). Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_PAUSED">VIR_MIGRATE_PAUSED</a> Leave the domain suspended on the remote side. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). <a href="libvirt-libvirt.html#VIR_MIGRATE_UNSAFE">VIR_MIGRATE_UNSAFE</a> Force migration even if it is considered unsafe. <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. Applications using the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag will probably prefer to invoke <a href="libvirt-libvirt.html#virDomainMigrateToURI">virDomainMigrateToURI</a>, avoiding the need to open connection to the destination host themselves. If a hypervisor supports renaming domains during migration, then you may set the dname parameter to the new name (otherwise it keeps the same name). If this is not supported by the hypervisor, dname must be NULL or else you will get an error. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is set, the uri parameter must be a valid libvirt connection URI, by which the source libvirt driver can connect to the destination libvirt. If omitted, the dconn connection object will be queried for its current URI. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, the URI parameter takes a hypervisor specific format. The hypervisor capabilities XML includes details of the support URI schemes. If omitted the dconn will be asked for a default URI. In either case it is typically only necessary to specify a URI if the destination host has multiple interfaces and a specific interface is required to transmit migration data. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dconn</tt></i>:</span></td><td>destination host (a connection object)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainMigrateFlags">virDomainMigrateFlags</a></td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>(optional) dest hostname/URI as seen from the source host</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>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).</td></tr></tbody></table></div><h3><a name="virDomainMigrate2" id="virDomainMigrate2"><code>virDomainMigrate2</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>     virDomainMigrate2       (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> dconn, <br />                                    const char * dxml, <br />                                       unsigned long flags, <br />                                     const char * dname, <br />                                      const char * uri, <br />                                        unsigned long bandwidth)<br />
 
1040
</pre><p>Migrate the domain object from its current host to the destination host given by dconn (a connection to the destination host). Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_PAUSED">VIR_MIGRATE_PAUSED</a> Leave the domain suspended on the remote side. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). <a href="libvirt-libvirt.html#VIR_MIGRATE_UNSAFE">VIR_MIGRATE_UNSAFE</a> Force migration even if it is considered unsafe. <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. Applications using the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag will probably prefer to invoke <a href="libvirt-libvirt.html#virDomainMigrateToURI">virDomainMigrateToURI</a>, avoiding the need to open connection to the destination host themselves. If a hypervisor supports renaming domains during migration, then you may set the dname parameter to the new name (otherwise it keeps the same name). If this is not supported by the hypervisor, dname must be NULL or else you will get an error. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is set, the uri parameter must be a valid libvirt connection URI, by which the source libvirt driver can connect to the destination libvirt. If omitted, the dconn connection object will be queried for its current URI. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, the URI parameter takes a hypervisor specific format. The hypervisor capabilities XML includes details of the support URI schemes. If omitted the dconn will be asked for a default URI. In either case it is typically only necessary to specify a URI if the destination host has multiple interfaces and a specific interface is required to transmit migration data. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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. If the hypervisor supports it, @dxml can be used to alter host-specific portions of the domain XML that will be used on the destination. For example, it is possible to alter the backing filename that is associated with a disk device, in order to account for naming differences between source and destination in accessing the underlying storage. The migration will fail if @dxml would cause any guest-visible changes. Pass NULL if no changes are needed to the XML between source and destination. @dxml cannot be used to rename the domain during migration (use @dname for that purpose). Domain name in @dxml must match the original domain name.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dconn</tt></i>:</span></td><td>destination host (a connection object)</td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>(optional) XML config for launching guest on target</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainMigrateFlags">virDomainMigrateFlags</a></td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>(optional) dest hostname/URI as seen from the source host</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>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).</td></tr></tbody></table></div><h3><a name="virDomainMigrateGetMaxSpeed" id="virDomainMigrateGetMaxSpeed"><code>virDomainMigrateGetMaxSpeed</code></a></h3><pre class="programlisting">int        virDomainMigrateGetMaxSpeed     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long * bandwidth, <br />                                       unsigned int flags)<br />
 
1041
</pre><p>Get the current maximum bandwidth (in Mbps) that will be used if the domain is migrated. Not all hypervisors will support a bandwidth limit.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>return value of current migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 otherwise.</td></tr></tbody></table></div><h3><a name="virDomainMigrateSetMaxDowntime" id="virDomainMigrateSetMaxDowntime"><code>virDomainMigrateSetMaxDowntime</code></a></h3><pre class="programlisting">int      virDomainMigrateSetMaxDowntime  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long long downtime, <br />                                     unsigned int flags)<br />
 
1042
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>downtime</tt></i>:</span></td><td>maximum tolerable downtime for live migration, in milliseconds</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 otherwise.</td></tr></tbody></table></div><h3><a name="virDomainMigrateSetMaxSpeed" id="virDomainMigrateSetMaxSpeed"><code>virDomainMigrateSetMaxSpeed</code></a></h3><pre class="programlisting">int virDomainMigrateSetMaxSpeed     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long bandwidth, <br />                                         unsigned int flags)<br />
 
1043
</pre><p>The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. Not all hypervisors will support a bandwidth cap</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 otherwise.</td></tr></tbody></table></div><h3><a name="virDomainMigrateToURI" id="virDomainMigrateToURI"><code>virDomainMigrateToURI</code></a></h3><pre class="programlisting">int    virDomainMigrateToURI           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * duri, <br />                                       unsigned long flags, <br />                                     const char * dname, <br />                                      unsigned long bandwidth)<br />
 
1044
</pre><p>Migrate the domain object from its current host to the destination host given by duri. Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). <a href="libvirt-libvirt.html#VIR_MIGRATE_UNSAFE">VIR_MIGRATE_UNSAFE</a> Force migration even if it is considered unsafe. The operation of this API hinges on the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, the duri parameter takes a hypervisor specific format. The uri_transports element of the hypervisor capabilities XML includes details of the supported URI schemes. Not all hypervisors will support this mode of migration, so if the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is not set, then it may be necessary to use the alternative <a href="libvirt-libvirt.html#virDomainMigrate">virDomainMigrate</a> API providing and explicit <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> for the destination host. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> 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. <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. If a hypervisor supports renaming domains during migration, the dname parameter specifies the new name for the domain. Setting dname to NULL keeps the domain name the same. If domain renaming is not supported by the hypervisor, dname must be NULL or else an error will be returned. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>duri</tt></i>:</span></td><td>mandatory URI for the destination host</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainMigrateFlags">virDomainMigrateFlags</a></td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the migration succeeded, -1 upon error.</td></tr></tbody></table></div><h3><a name="virDomainMigrateToURI2" id="virDomainMigrateToURI2"><code>virDomainMigrateToURI2</code></a></h3><pre class="programlisting">int     virDomainMigrateToURI2          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * dconnuri, <br />                                   const char * miguri, <br />                                     const char * dxml, <br />                                       unsigned long flags, <br />                                     const char * dname, <br />                                      unsigned long bandwidth)<br />
 
1045
</pre><p>Migrate the domain object from its current host to the destination host given by duri. Flags may be one of more of the following: <a href="libvirt-libvirt.html#VIR_MIGRATE_LIVE">VIR_MIGRATE_LIVE</a> Do not pause the VM during migration <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> Direct connection between source &amp; destination hosts <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> Tunnel migration data over the libvirt RPC channel <a href="libvirt-libvirt.html#VIR_MIGRATE_PERSIST_DEST">VIR_MIGRATE_PERSIST_DEST</a> If the migration is successful, persist the domain on the destination host. <a href="libvirt-libvirt.html#VIR_MIGRATE_UNDEFINE_SOURCE">VIR_MIGRATE_UNDEFINE_SOURCE</a> If the migration is successful, undefine the domain on the source host. <a href="libvirt-libvirt.html#VIR_MIGRATE_CHANGE_PROTECTION">VIR_MIGRATE_CHANGE_PROTECTION</a> Protect against domain configuration changes during the migration process (set automatically when supported). <a href="libvirt-libvirt.html#VIR_MIGRATE_UNSAFE">VIR_MIGRATE_UNSAFE</a> Force migration even if it is considered unsafe. The operation of this API hinges on the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> 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. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> flag is NOT set, then @dconnuri must be NULL. If the <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> flag is NOT set, then the @miguri parameter allows specification of a URI to use to initiate the VM migration. It takes a hypervisor specific format. The uri_transports element of the hypervisor capabilities XML includes details of the supported URI schemes. <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a> requires that <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a> be set. If a hypervisor supports changing the configuration of the guest during migration, the @dxml parameter specifies the new config for the guest. 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 will validate this and refuse to allow migration if the provided XML would cause a change in the guest ABI, If a hypervisor supports renaming domains during migration, the dname parameter specifies the new name for the domain. Setting dname to NULL keeps the domain name the same. If domain renaming is not supported by the hypervisor, dname must be NULL or else an error will be returned. The maximum bandwidth (in Mbps) that will be used to do migration can be specified with the bandwidth parameter. If set to 0, libvirt will choose a suitable default. Some hypervisors do not support this feature and will return an error if bandwidth is not 0. To see which features are supported by the current hypervisor, see <a href="libvirt-libvirt.html#virConnectGetCapabilities">virConnectGetCapabilities</a>, /capabilities/host/migration_features. 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dconnuri</tt></i>:</span></td><td>(optional) URI for target libvirtd if @flags includes <a href="libvirt-libvirt.html#VIR_MIGRATE_PEER2PEER">VIR_MIGRATE_PEER2PEER</a></td></tr><tr><td><span class="term"><i><tt>miguri</tt></i>:</span></td><td>(optional) URI for invoking the migration, not if @flags includs <a href="libvirt-libvirt.html#VIR_MIGRATE_TUNNELLED">VIR_MIGRATE_TUNNELLED</a></td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>(optional) XML config for launching guest on target</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainMigrateFlags">virDomainMigrateFlags</a></td></tr><tr><td><span class="term"><i><tt>dname</tt></i>:</span></td><td>(optional) rename domain to this at destination</td></tr><tr><td><span class="term"><i><tt>bandwidth</tt></i>:</span></td><td>(optional) specify migration bandwidth limit in Mbps</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the migration succeeded, -1 upon error.</td></tr></tbody></table></div><h3><a name="virDomainOpenConsole" id="virDomainOpenConsole"><code>virDomainOpenConsole</code></a></h3><pre class="programlisting">int      virDomainOpenConsole            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * dev_name, <br />                                   <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> st, <br />                                         unsigned int flags)<br />
 
1046
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_CONSOLE_FORCE">VIR_DOMAIN_CONSOLE_FORCE</a> will cause libvirt to forcefully remove the other client prior to opening this console. If flag <a href="libvirt-libvirt.html#VIR_DOMAIN_CONSOLE_SAFE">VIR_DOMAIN_CONSOLE_SAFE</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>dev_name</tt></i>:</span></td><td>the console, serial or parallel port device alias, or NULL</td></tr><tr><td><span class="term"><i><tt>st</tt></i>:</span></td><td>a stream to associate with the console</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainConsoleFlags">virDomainConsoleFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the console was opened, -1 on error</td></tr></tbody></table></div><h3><a name="virDomainOpenGraphics" id="virDomainOpenGraphics"><code>virDomainOpenGraphics</code></a></h3><pre class="programlisting">int        virDomainOpenGraphics           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int idx, <br />                                        int fd, <br />                                  unsigned int flags)<br />
 
1047
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH">VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH</a> 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</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>idx</tt></i>:</span></td><td>index of graphics config to open</td></tr><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to attach graphics to</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainOpenGraphicsFlags">virDomainOpenGraphicsFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virDomainPMSuspendForDuration" id="virDomainPMSuspendForDuration"><code>virDomainPMSuspendForDuration</code></a></h3><pre class="programlisting">int      virDomainPMSuspendForDuration   (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int target, <br />                                     unsigned long long duration, <br />                                     unsigned int flags)<br />
 
1048
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>a value from <a href="libvirt-libvirt.html#virNodeSuspendTarget">virNodeSuspendTarget</a></td></tr><tr><td><span class="term"><i><tt>duration</tt></i>:</span></td><td>duration in seconds to suspend, or 0 for indefinite</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure.</td></tr></tbody></table></div><h3><a name="virDomainPMWakeup" id="virDomainPMWakeup"><code>virDomainPMWakeup</code></a></h3><pre class="programlisting">int      virDomainPMWakeup               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        unsigned int flags)<br />
 
1049
</pre><p>Inject a wakeup into the guest that previously used <a href="libvirt-libvirt.html#virDomainPMSuspendForDuration">virDomainPMSuspendForDuration</a>, rather than waiting for the previously requested duration (if any) to elapse.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure.</td></tr></tbody></table></div><h3><a name="virDomainPinVcpu" id="virDomainPinVcpu"><code>virDomainPinVcpu</code></a></h3><pre class="programlisting">int     virDomainPinVcpu                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int vcpu, <br />                                       unsigned char * cpumap, <br />                                  int maplen)<br />
955
1050
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>vcpu</tt></i>:</span></td><td>virtual CPU number</td></tr><tr><td><span class="term"><i><tt>cpumap</tt></i>:</span></td><td>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.</td></tr><tr><td><span class="term"><i><tt>maplen</tt></i>:</span></td><td>number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen &lt; size, missing bytes are set to zero. If maplen &gt; size, failure code is returned.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainPinVcpuFlags" id="virDomainPinVcpuFlags"><code>virDomainPinVcpuFlags</code></a></h3><pre class="programlisting">int     virDomainPinVcpuFlags           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int vcpu, <br />                                       unsigned char * cpumap, <br />                                  int maplen, <br />                                      unsigned int flags)<br />
956
1051
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a>. Both flags may be set. If <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> is set, the change affects a running domain and may fail if domain is not alive. If <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, @flags is <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>), 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 <a href="libvirt-libvirt.html#virDomainGetVcpuPinInfo">virDomainGetVcpuPinInfo</a> for querying this information.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>vcpu</tt></i>:</span></td><td>virtual CPU number</td></tr><tr><td><span class="term"><i><tt>cpumap</tt></i>:</span></td><td>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.</td></tr><tr><td><span class="term"><i><tt>maplen</tt></i>:</span></td><td>number of bytes in cpumap, from 1 up to size of CPU map in underlying virtualization system (Xen...). If maplen &lt; size, missing bytes are set to zero. If maplen &gt; size, failure code is returned.</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainReboot" id="virDomainReboot"><code>virDomainReboot</code></a></h3><pre class="programlisting">int      virDomainReboot                 (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
957
 
</pre><p>Reboot a domain, the domain object is still usable there after but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags for the reboot operation, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRef" id="virDomainRef"><code>virDomainRef</code></a></h3><pre class="programlisting">int     virDomainRef                    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
1052
</pre><p>Reboot a domain, the domain object is still usable there after but the domain OS is being stopped for a restart. Note that the guest OS may ignore the request. If @flags is set to zero, then the hypervisor will choose the method of shutdown it considers best. To have greater control pass exactly one of the <a href="libvirt-libvirt.html#virDomainRebootFlagValues">virDomainRebootFlagValues</a>. To use guest agent (<a href="libvirt-libvirt.html#VIR_DOMAIN_REBOOT_GUEST_AGENT">VIR_DOMAIN_REBOOT_GUEST_AGENT</a>) the domain XML must have &lt;channel&gt; configured.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainRebootFlagValues">virDomainRebootFlagValues</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRef" id="virDomainRef"><code>virDomainRef</code></a></h3><pre class="programlisting">int      virDomainRef                    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
958
1053
</pre><p>Increment the reference count on the domain. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virDomainFree">virDomainFree</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>the domain to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainReset" id="virDomainReset"><code>virDomainReset</code></a></h3><pre class="programlisting">int   virDomainReset                  (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
959
 
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags for the reboot operation, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRestore" id="virDomainRestore"><code>virDomainRestore</code></a></h3><pre class="programlisting">int  virDomainRestore                (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * from)<br />
 
1054
</pre><p>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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRestore" id="virDomainRestore"><code>virDomainRestore</code></a></h3><pre class="programlisting">int  virDomainRestore                (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * from)<br />
960
1055
</pre><p>This method will restore a domain saved to disk by <a href="libvirt-libvirt.html#virDomainSave">virDomainSave</a>(). See <a href="libvirt-libvirt.html#virDomainRestoreFlags">virDomainRestoreFlags</a>() for more control.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>from</tt></i>:</span></td><td>path to the input file</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRestoreFlags" id="virDomainRestoreFlags"><code>virDomainRestoreFlags</code></a></h3><pre class="programlisting">int        virDomainRestoreFlags           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * from, <br />                                       const char * dxml, <br />                                       unsigned int flags)<br />
961
1056
</pre><p>This method will restore a domain saved to disk by <a href="libvirt-libvirt.html#virDomainSave">virDomainSave</a>(). 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_BYPASS_CACHE">VIR_DOMAIN_SAVE_BYPASS_CACHE</a>, 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 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_RUNNING">VIR_DOMAIN_SAVE_RUNNING</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_PAUSED">VIR_DOMAIN_SAVE_PAUSED</a> in @flags will override the default read from the file. These two flags are mutually exclusive.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>from</tt></i>:</span></td><td>path to the input file</td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>(optional) XML config for adjusting guest xml used on restore</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSaveRestoreFlags">virDomainSaveRestoreFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainResume" id="virDomainResume"><code>virDomainResume</code></a></h3><pre class="programlisting">int       virDomainResume                 (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
962
1057
</pre><p>Resume a suspended domain, the process is restarted from the state where it was frozen by calling <a href="libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a>(). This function may require privileged access</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainRevertToSnapshot" id="virDomainRevertToSnapshot"><code>virDomainRevertToSnapshot</code></a></h3><pre class="programlisting">int     virDomainRevertToSnapshot       (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)<br />
963
1058
</pre><p>Revert the domain to a given snapshot. Normally, the domain will revert to the same state the domain was in while the snapshot was taken (whether inactive, running, or paused), except that disk snapshots default to reverting to inactive state. Including <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING">VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING</a> in @flags overrides the snapshot state to guarantee a running domain after the revert; or including <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED">VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED</a> in @flags guarantees a paused domain after the revert. These two flags are mutually exclusive. While a persistent domain does not need either flag, it is not possible to revert a transient domain into an inactive state, so transient domains require the use of one of these two flags. Reverting to any snapshot discards all configuration changes made since the last snapshot. Additionally, reverting to a snapshot from a running domain is a form of data loss, since it discards whatever is in the guest's RAM at the time. Since the very nature of keeping snapshots implies the intent to roll back state, no additional confirmation is normally required for these lossy effects. However, there are two particular situations where reverting will be refused by default, and where @flags must include <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_REVERT_FORCE">VIR_DOMAIN_SNAPSHOT_REVERT_FORCE</a> to acknowledge the risks. 1) Any attempt to revert to a snapshot that lacks the metadata to perform ABI compatibility checks (generally the case for snapshots that lack a full &lt;domain&gt; when listed by <a href="libvirt-libvirt.html#virDomainSnapshotGetXMLDesc">virDomainSnapshotGetXMLDesc</a>(), such as those created prior to libvirt 0.9.5). 2) Any attempt to revert a running domain to an active state that requires starting a new hypervisor instance rather than reusing the existing hypervisor (since this would terminate all connections to the domain, such as such as VNC or Spice graphics) - this condition arises from active snapshots that are provably ABI incomaptible, as well as from inactive snapshots with a @flags request to start the domain after the revert.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSnapshotRevertFlags">virDomainSnapshotRevertFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the creation is successful, -1 on error.</td></tr></tbody></table></div><h3><a name="virDomainSave" id="virDomainSave"><code>virDomainSave</code></a></h3><pre class="programlisting">int       virDomainSave                   (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * to)<br />
964
1059
</pre><p>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 <a href="libvirt-libvirt.html#virDomainRestore">virDomainRestore</a>() to restore a domain after saving. See <a href="libvirt-libvirt.html#virDomainSaveFlags">virDomainSaveFlags</a>() for more control. Also, a save file can be inspected or modified slightly with <a href="libvirt-libvirt.html#virDomainSaveImageGetXMLDesc">virDomainSaveImageGetXMLDesc</a>() and <a href="libvirt-libvirt.html#virDomainSaveImageDefineXML">virDomainSaveImageDefineXML</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>path for the output file</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSaveFlags" id="virDomainSaveFlags"><code>virDomainSaveFlags</code></a></h3><pre class="programlisting">int   virDomainSaveFlags              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * to, <br />                                         const char * dxml, <br />                                       unsigned int flags)<br />
965
 
</pre><p>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 <a href="libvirt-libvirt.html#virDomainRestore">virDomainRestore</a>() 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_BYPASS_CACHE">VIR_DOMAIN_SAVE_BYPASS_CACHE</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_RUNNING">VIR_DOMAIN_SAVE_RUNNING</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_PAUSED">VIR_DOMAIN_SAVE_PAUSED</a> 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 <a href="libvirt-libvirt.html#virDomainSaveImageGetXMLDesc">virDomainSaveImageGetXMLDesc</a>() and <a href="libvirt-libvirt.html#virDomainSaveImageDefineXML">virDomainSaveImageDefineXML</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>path for the output file</td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>(optional) XML config for adjusting guest xml used on restore</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSaveRestoreFlags">virDomainSaveRestoreFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSaveImageDefineXML" id="virDomainSaveImageDefineXML"><code>virDomainSaveImageDefineXML</code></a></h3><pre class="programlisting">int virDomainSaveImageDefineXML     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * file, <br />                                       const char * dxml, <br />                                       unsigned int flags)<br />
 
1060
</pre><p>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 <a href="libvirt-libvirt.html#virDomainRestore">virDomainRestore</a>() 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_BYPASS_CACHE">VIR_DOMAIN_SAVE_BYPASS_CACHE</a>, 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_RUNNING">VIR_DOMAIN_SAVE_RUNNING</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_PAUSED">VIR_DOMAIN_SAVE_PAUSED</a> 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 <a href="libvirt-libvirt.html#virDomainSaveImageGetXMLDesc">virDomainSaveImageGetXMLDesc</a>() and <a href="libvirt-libvirt.html#virDomainSaveImageDefineXML">virDomainSaveImageDefineXML</a>(). Some hypervisors may prevent this operation if there is a current block copy operation; in that case, use <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>() to stop the block copy first.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>path for the output file</td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>(optional) XML config for adjusting guest xml used on restore</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSaveRestoreFlags">virDomainSaveRestoreFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSaveImageDefineXML" id="virDomainSaveImageDefineXML"><code>virDomainSaveImageDefineXML</code></a></h3><pre class="programlisting">int      virDomainSaveImageDefineXML     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * file, <br />                                       const char * dxml, <br />                                       unsigned int flags)<br />
966
1061
</pre><p>This updates the definition of a domain stored in a saved state file. @file must be a file created previously by <a href="libvirt-libvirt.html#virDomainSave">virDomainSave</a>() or <a href="libvirt-libvirt.html#virDomainSaveFlags">virDomainSaveFlags</a>(). @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 <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_RUNNING">VIR_DOMAIN_SAVE_RUNNING</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_SAVE_PAUSED">VIR_DOMAIN_SAVE_PAUSED</a> in @flags will override the default saved into the file; omitting both leaves the file's default unchanged. These two flags are mutually exclusive.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>path to saved state file</td></tr><tr><td><span class="term"><i><tt>dxml</tt></i>:</span></td><td>XML config for adjusting guest xml used on restore</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSaveRestoreFlags">virDomainSaveRestoreFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSaveImageGetXMLDesc" id="virDomainSaveImageGetXMLDesc"><code>virDomainSaveImageGetXMLDesc</code></a></h3><pre class="programlisting">char *       virDomainSaveImageGetXMLDesc    (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * file, <br />                                       unsigned int flags)<br />
967
1062
</pre><p>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 <a href="libvirt-libvirt.html#virDomainSave">virDomainSave</a>() or <a href="libvirt-libvirt.html#virDomainSaveFlags">virDomainSaveFlags</a>(). No security-sensitive data will be included unless @flags contains <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_SECURE">VIR_DOMAIN_XML_SECURE</a>; this flag is rejected on read-only connections. For this API, @flags should not contain either <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_INACTIVE">VIR_DOMAIN_XML_INACTIVE</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_UPDATE_CPU">VIR_DOMAIN_XML_UPDATE_CPU</a>.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>path to saved state file</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of subset of <a href="libvirt-libvirt.html#virDomainXMLFlags">virDomainXMLFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. The caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virDomainScreenshot" id="virDomainScreenshot"><code>virDomainScreenshot</code></a></h3><pre class="programlisting">char *      virDomainScreenshot             (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     unsigned int screen, <br />                                     unsigned int flags)<br />
968
 
</pre><p>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 transfered, 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>stream to use as output</td></tr><tr><td><span class="term"><i><tt>screen</tt></i>:</span></td><td>monitor ID to take screenshot from</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags, currently unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a string representing the mime-type of the image format, or NULL upon error. The caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virDomainSendKey" id="virDomainSendKey"><code>virDomainSendKey</code></a></h3><pre class="programlisting">int    virDomainSendKey                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int codeset, <br />                                    unsigned int holdtime, <br />                                   unsigned int * keycodes, <br />                                         int nkeycodes, <br />                                   unsigned int flags)<br />
969
 
</pre><p>Send key(s) to the guest.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>codeset</tt></i>:</span></td><td>the code set of keycodes, from <a href="libvirt-libvirt.html#virKeycodeSet">virKeycodeSet</a></td></tr><tr><td><span class="term"><i><tt>holdtime</tt></i>:</span></td><td>the duration (in milliseconds) that the keys will be held</td></tr><tr><td><span class="term"><i><tt>keycodes</tt></i>:</span></td><td>array of keycodes</td></tr><tr><td><span class="term"><i><tt>nkeycodes</tt></i>:</span></td><td>number of keycodes, up to <a href="libvirt-libvirt.html#VIR_DOMAIN_SEND_KEY_MAX_KEYS">VIR_DOMAIN_SEND_KEY_MAX_KEYS</a></td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>the flags for controlling behavior, pass 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetAutostart" id="virDomainSetAutostart"><code>virDomainSetAutostart</code></a></h3><pre class="programlisting">int        virDomainSetAutostart           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int autostart)<br />
 
1063
</pre><p>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 transfered, 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>stream to use as output</td></tr><tr><td><span class="term"><i><tt>screen</tt></i>:</span></td><td>monitor ID to take screenshot from</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a string representing the mime-type of the image format, or NULL upon error. The caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virDomainSendKey" id="virDomainSendKey"><code>virDomainSendKey</code></a></h3><pre class="programlisting">int       virDomainSendKey                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int codeset, <br />                                    unsigned int holdtime, <br />                                   unsigned int * keycodes, <br />                                         int nkeycodes, <br />                                   unsigned int flags)<br />
 
1064
</pre><p>Send key(s) to the guest.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>codeset</tt></i>:</span></td><td>the code set of keycodes, from <a href="libvirt-libvirt.html#virKeycodeSet">virKeycodeSet</a></td></tr><tr><td><span class="term"><i><tt>holdtime</tt></i>:</span></td><td>the duration (in milliseconds) that the keys will be held</td></tr><tr><td><span class="term"><i><tt>keycodes</tt></i>:</span></td><td>array of keycodes</td></tr><tr><td><span class="term"><i><tt>nkeycodes</tt></i>:</span></td><td>number of keycodes, up to <a href="libvirt-libvirt.html#VIR_DOMAIN_SEND_KEY_MAX_KEYS">VIR_DOMAIN_SEND_KEY_MAX_KEYS</a></td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetAutostart" id="virDomainSetAutostart"><code>virDomainSetAutostart</code></a></h3><pre class="programlisting">int        virDomainSetAutostart           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int autostart)<br />
970
1065
</pre><p>Configure the domain to be automatically started when the host machine boots.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>autostart</tt></i>:</span></td><td>whether the domain should be automatically started 0 or 1</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virDomainSetBlkioParameters" id="virDomainSetBlkioParameters"><code>virDomainSetBlkioParameters</code></a></h3><pre class="programlisting">int     virDomainSetBlkioParameters     (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)<br />
971
1066
</pre><p>Change all or a subset of the blkio tunables. This function may require privileged access to the hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to blkio parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of blkio parameters (this value can be the same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetBlockIoTune" id="virDomainSetBlockIoTune"><code>virDomainSetBlockIoTune</code></a></h3><pre class="programlisting">int   virDomainSetBlockIoTune         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> dom, <br />                                        const char * disk, <br />                                       <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)<br />
972
 
</pre><p>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 &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>Pointer to blkio parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>Number of blkio parameters (this value can be the same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>An OR'ed set of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetMaxMemory" id="virDomainSetMaxMemory"><code>virDomainSetMaxMemory</code></a></h3><pre class="programlisting">int    virDomainSetMaxMemory           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)<br />
973
 
</pre><p>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 <a href="libvirt-libvirt.html#virDomainSetMemoryFlags">virDomainSetMemoryFlags</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kilobytes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMemory" id="virDomainSetMemory"><code>virDomainSetMemory</code></a></h3><pre class="programlisting">int    virDomainSetMemory              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)<br />
974
 
</pre><p>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 only changes the runtime configuration of the domain, so can only be called on an active domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kilobytes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMemoryFlags" id="virDomainSetMemoryFlags"><code>virDomainSetMemoryFlags</code></a></h3><pre class="programlisting">int    virDomainSetMemoryFlags         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory, <br />                                    unsigned int flags)<br />
975
 
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a>. Both flags may be set. If <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> is set, the change affects a running domain and will fail if domain is not active. If <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, @flags is <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>), 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_MEM_MAXIMUM">VIR_DOMAIN_MEM_MAXIMUM</a> is set, the change affects domain's maximum memory size rather than current memory size. Not all hypervisors can support all flag combinations.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kilobytes</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainMemoryModFlags">virDomainMemoryModFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMemoryParameters" id="virDomainSetMemoryParameters"><code>virDomainSetMemoryParameters</code></a></h3><pre class="programlisting">int virDomainSetMemoryParameters    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)<br />
976
 
</pre><p>Change all or a subset of the memory tunables. This function may require privileged access to the hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to memory parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of memory parameter (this value can be the same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetSchedulerParameters" id="virDomainSetSchedulerParameters"><code>virDomainSetSchedulerParameters</code></a></h3><pre class="programlisting">int virDomainSetSchedulerParameters (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams)<br />
 
1067
</pre><p>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 &lt;source file='...'/&gt; sub-element, such as "/path/to/image"), or the device target shorthand (the &lt;target dev='...'/&gt; sub-element, such as "xvda"). Valid names can be found by calling <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and inspecting elements within //domain/devices/disk.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dom</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>disk</tt></i>:</span></td><td>path to the block device, or device shorthand</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>Pointer to blkio parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>Number of blkio parameters (this value can be the same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetInterfaceParameters" id="virDomainSetInterfaceParameters"><code>virDomainSetInterfaceParameters</code></a></h3><pre class="programlisting">int        virDomainSetInterfaceParameters (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * device, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)<br />
 
1068
</pre><p>Change a subset or all parameters of interface; currently this includes bandwidth parameters. The value of @flags should be either <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>, or a bitwise-or of values <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> and <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a>, although hypervisors vary in which flags are supported. This function may require privileged access to the hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>device</tt></i>:</span></td><td>the interface name or mac address</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to interface parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of interface parameter (this value can be the same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetMaxMemory" id="virDomainSetMaxMemory"><code>virDomainSetMaxMemory</code></a></h3><pre class="programlisting">int   virDomainSetMaxMemory           (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)<br />
 
1069
</pre><p>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 <a href="libvirt-libvirt.html#virDomainSetMemoryFlags">virDomainSetMemoryFlags</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kibibytes (blocks of 1024 bytes)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMemory" id="virDomainSetMemory"><code>virDomainSetMemory</code></a></h3><pre class="programlisting">int     virDomainSetMemory              (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory)<br />
 
1070
</pre><p>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 only changes the runtime configuration of the domain, so can only be called on an active domain.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kibibytes (blocks of 1024 bytes)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMemoryFlags" id="virDomainSetMemoryFlags"><code>virDomainSetMemoryFlags</code></a></h3><pre class="programlisting">int     virDomainSetMemoryFlags         (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned long memory, <br />                                    unsigned int flags)<br />
 
1071
</pre><p>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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a>. Both flags may be set. If <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> is set, the change affects a running domain and will fail if domain is not active. If <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> is set, the change affects persistent state, and will fail for transient domains. If neither flag is specified (that is, @flags is <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>), 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_MEM_MAXIMUM">VIR_DOMAIN_MEM_MAXIMUM</a> is set, the change affects domain's maximum memory size rather than current memory size. Not all hypervisors can support all flag combinations.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object or NULL</td></tr><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>the memory size in kibibytes (blocks of 1024 bytes)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainMemoryModFlags">virDomainMemoryModFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetMemoryParameters" id="virDomainSetMemoryParameters"><code>virDomainSetMemoryParameters</code></a></h3><pre class="programlisting">int    virDomainSetMemoryParameters    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)<br />
 
1072
</pre><p>Change all or a subset of the memory tunables. This function may require privileged access to the hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to memory parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of memory parameter (this value can be the same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetMetadata" id="virDomainSetMetadata"><code>virDomainSetMetadata</code></a></h3><pre class="programlisting">int  virDomainSetMetadata            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     int type, <br />                                        const char * metadata, <br />                                   const char * key, <br />                                        const char * uri, <br />                                        unsigned int flags)<br />
 
1073
</pre><p>Sets the appropriate domain element given by @type to the value of @description. A @type of <a href="libvirt-libvirt.html#VIR_DOMAIN_METADATA_DESCRIPTION">VIR_DOMAIN_METADATA_DESCRIPTION</a> is free-form text; <a href="libvirt-libvirt.html#VIR_DOMAIN_METADATA_TITLE">VIR_DOMAIN_METADATA_TITLE</a> 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_METADATA_ELEMENT">VIR_DOMAIN_METADATA_ELEMENT</a> @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 <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>(), as well as quick access through <a href="libvirt-libvirt.html#virDomainGetMetadata">virDomainGetMetadata</a>(). @flags controls whether the live domain, persistent configuration, or both will be modified.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>type of description, from <a href="libvirt-libvirt.html#virDomainMetadataType">virDomainMetadataType</a></td></tr><tr><td><span class="term"><i><tt>metadata</tt></i>:</span></td><td>new metadata text</td></tr><tr><td><span class="term"><i><tt>key</tt></i>:</span></td><td>XML namespace key, or NULL</td></tr><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>XML namespace URI, or NULL</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetNumaParameters" id="virDomainSetNumaParameters"><code>virDomainSetNumaParameters</code></a></h3><pre class="programlisting">int  virDomainSetNumaParameters      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams, <br />                                     unsigned int flags)<br />
 
1074
</pre><p>Change all or a subset of the numa tunables. This function may require privileged access to the hypervisor.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to numa parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of numa parameters (this value can be the same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetSchedulerParameters" id="virDomainSetSchedulerParameters"><code>virDomainSetSchedulerParameters</code></a></h3><pre class="programlisting">int      virDomainSetSchedulerParameters (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                     int nparams)<br />
977
1075
</pre><p>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 <a href="libvirt-libvirt.html#virDomainSetSchedulerParametersFlags">virDomainSetSchedulerParametersFlags</a>.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to scheduler parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of scheduler parameter objects (this value can be the same or less than the returned value nparams of <a href="libvirt-libvirt.html#virDomainGetSchedulerType">virDomainGetSchedulerType</a>)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetSchedulerParametersFlags" id="virDomainSetSchedulerParametersFlags"><code>virDomainSetSchedulerParametersFlags</code></a></h3><pre class="programlisting">int   virDomainSetSchedulerParametersFlags    (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                             <a href="libvirt-libvirt.html#virTypedParameterPtr">virTypedParameterPtr</a> params, <br />                                             int nparams, <br />                                             unsigned int flags)<br />
978
1076
</pre><p>Change a subset or all scheduler parameters. The value of @flags should be either <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>, or a bitwise-or of values from <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> and <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>, although hypervisors vary in which flags are supported.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to scheduler parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of scheduler parameter objects (this value can be the same or less than the returned value nparams of <a href="libvirt-libvirt.html#virDomainGetSchedulerType">virDomainGetSchedulerType</a>)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainModificationImpact">virDomainModificationImpact</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virDomainSetVcpus" id="virDomainSetVcpus"><code>virDomainSetVcpus</code></a></h3><pre class="programlisting">int   virDomainSetVcpus               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int nvcpus)<br />
979
1077
</pre><p>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 arbitrary limited. 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. It is hypervisor-dependent whether it also affects persistent configuration; for more control, use <a href="libvirt-libvirt.html#virDomainSetVcpusFlags">virDomainSetVcpusFlags</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>nvcpus</tt></i>:</span></td><td>the new number of virtual CPUs for this domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSetVcpusFlags" id="virDomainSetVcpusFlags"><code>virDomainSetVcpusFlags</code></a></h3><pre class="programlisting">int     virDomainSetVcpusFlags          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int nvcpus, <br />                                     unsigned int flags)<br />
980
 
</pre><p>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 arbitrary limited. This function may require privileged access to the hypervisor. @flags may include <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> to affect a running domain (which may fail if domain is not active), or <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>), 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 @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_VCPU_MAXIMUM">VIR_DOMAIN_VCPU_MAXIMUM</a>, then <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> must be clear, and only the maximum virtual CPU limit is altered; generally, this value must be less than or equal to <a href="libvirt-libvirt.html#virConnectGetMaxVcpus">virConnectGetMaxVcpus</a>(). Otherwise, this call affects the current virtual CPU limit, which must be less than or equal to the maximum limit. Not all hypervisors can support all flag combinations.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>nvcpus</tt></i>:</span></td><td>the new number of virtual CPUs for this domain, must be at least 1</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainVcpuFlags">virDomainVcpuFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainShutdown" id="virDomainShutdown"><code>virDomainShutdown</code></a></h3><pre class="programlisting">int     virDomainShutdown               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
981
 
</pre><p>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. For guests that react to a shutdown request, the differences from <a href="libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a>() 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 <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), then that metadata will automatically be deleted when the domain quits.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotCreateXML" id="virDomainSnapshotCreateXML"><code>virDomainSnapshotCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a>       virDomainSnapshotCreateXML      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     const char * xmlDesc, <br />                                                    unsigned int flags)<br />
982
 
</pre><p>Creates a new snapshot of a domain based on the snapshot xml contained in xmlDesc. If @flags is 0, the domain can be active, in which case the snapshot will be a system checkpoint (both disk state and runtime VM state such as RAM contents), where reverting to the snapshot is the same as resuming from hibernation (TCP connections may have timed out, but everything else picks up where it left off); or the domain can be inactive, in which case the snapshot includes just the disk state prior to booting. The newly created snapshot becomes current (see <a href="libvirt-libvirt.html#virDomainSnapshotCurrent">virDomainSnapshotCurrent</a>()), and is a child of any previous current snapshot. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>, then this is a request to reinstate snapshot metadata that was previously discarded, rather than creating a new snapshot. This can be used to recreate a snapshot hierarchy on a destination, then remove it on the source, in order to allow migration (since migration normally fails if snapshot metadata still remains on the source machine). When redefining snapshot metadata, the current snapshot will not be altered unless the <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT">VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT</a> flag is also present. It is an error to request the <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT">VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT</a> flag without <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>. On some hypervisors, redefining an existing snapshot can be used to alter host-specific portions of the domain XML to be used during revert (such as backing filenames associated with disk devices), but must not alter guest-visible layout. When redefining a snapshot name that does not exist, the hypervisor may validate that reverting to the snapshot appears to be possible (for example, disk images have snapshot contents by the requested name). Not all hypervisors support these flags. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA">VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA</a>, then the domain's disk images are modified according to @xmlDesc, but then the just-created snapshot has its metadata deleted. This flag is incompatible with <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_HALT">VIR_DOMAIN_SNAPSHOT_CREATE_HALT</a>, then the domain will be inactive after the snapshot completes, regardless of whether it was active before; otherwise, a running domain will still be running after the snapshot. This flag is invalid on transient domains, and is incompatible with <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY">VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</a>, then the snapshot will be limited to the disks described in @xmlDesc, and no VM state will be saved. For an active guest, the disk image may be inconsistent (as if power had been pulled), and specifying this with the <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_HALT">VIR_DOMAIN_SNAPSHOT_CREATE_HALT</a> flag risks data loss.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSnapshotCreateFlags">virDomainSnapshotCreateFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an (opaque) <a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> on success, NULL on failure.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotCurrent" id="virDomainSnapshotCurrent"><code>virDomainSnapshotCurrent</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a>      virDomainSnapshotCurrent        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     unsigned int flags)<br />
983
 
</pre><p>Get the current snapshot for a domain, if any.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused flag parameters; callers should pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a domain snapshot object or NULL in case of failure. If the current domain snapshot cannot be found, then the <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN_SNAPSHOT">VIR_ERR_NO_DOMAIN_SNAPSHOT</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotDelete" id="virDomainSnapshotDelete"><code>virDomainSnapshotDelete</code></a></h3><pre class="programlisting">int        virDomainSnapshotDelete         (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)<br />
984
 
</pre><p>Delete the snapshot. If @flags is 0, then just this snapshot is deleted, and changes from this snapshot are automatically merged into children snapshots. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN">VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN</a>, then this snapshot and any descendant snapshots are deleted. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY">VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY</a>, then any descendant snapshots are deleted, but this snapshot remains. These two flags are mutually exclusive. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY">VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY</a>, then any snapshot metadata tracked by libvirt is removed while keeping the snapshot contents intact; if a hypervisor does not require any libvirt metadata to track snapshots, then this flag is silently ignored.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainSnapshotDeleteFlags">virDomainSnapshotDeleteFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the selected snapshot(s) were successfully deleted, -1 on error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotFree" id="virDomainSnapshotFree"><code>virDomainSnapshotFree</code></a></h3><pre class="programlisting">int      virDomainSnapshotFree           (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot)<br />
 
1078
</pre><p>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 arbitrary limited. This function may require privileged access to the hypervisor. @flags may include <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> to affect a running domain (which may fail if domain is not active), or <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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 <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a>), 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 @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_VCPU_MAXIMUM">VIR_DOMAIN_VCPU_MAXIMUM</a>, then <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> must be clear, and only the maximum virtual CPU limit is altered; generally, this value must be less than or equal to <a href="libvirt-libvirt.html#virConnectGetMaxVcpus">virConnectGetMaxVcpus</a>(). Otherwise, this call affects the current virtual CPU limit, which must be less than or equal to the maximum limit. Not all hypervisors can support all flag combinations.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object, or NULL for Domain0</td></tr><tr><td><span class="term"><i><tt>nvcpus</tt></i>:</span></td><td>the new number of virtual CPUs for this domain, must be at least 1</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainVcpuFlags">virDomainVcpuFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainShutdown" id="virDomainShutdown"><code>virDomainShutdown</code></a></h3><pre class="programlisting">int       virDomainShutdown               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
1079
</pre><p>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. For guests that react to a shutdown request, the differences from <a href="libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a>() 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 <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), then that metadata will automatically be deleted when the domain quits.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainShutdownFlags" id="virDomainShutdownFlags"><code>virDomainShutdownFlags</code></a></h3><pre class="programlisting">int    virDomainShutdownFlags          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
 
1080
</pre><p>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. For guests that react to a shutdown request, the differences from <a href="libvirt-libvirt.html#virDomainDestroy">virDomainDestroy</a>() 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 <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), 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 exactly one of the <a href="libvirt-libvirt.html#virDomainShutdownFlagValues">virDomainShutdownFlagValues</a>.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainShutdownFlagValues">virDomainShutdownFlagValues</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotCreateXML" id="virDomainSnapshotCreateXML"><code>virDomainSnapshotCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a>   virDomainSnapshotCreateXML      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     const char * xmlDesc, <br />                                                    unsigned int flags)<br />
 
1081
</pre><p>Creates a new snapshot of a domain based on the snapshot xml contained in xmlDesc. If @flags is 0, the domain can be active, in which case the snapshot will be a system checkpoint (both disk state and runtime VM state such as RAM contents), where reverting to the snapshot is the same as resuming from hibernation (TCP connections may have timed out, but everything else picks up where it left off); or the domain can be inactive, in which case the snapshot includes just the disk state prior to booting. The newly created snapshot becomes current (see <a href="libvirt-libvirt.html#virDomainSnapshotCurrent">virDomainSnapshotCurrent</a>()), and is a child of any previous current snapshot. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>, then this is a request to reinstate snapshot metadata that was previously discarded, rather than creating a new snapshot. This can be used to recreate a snapshot hierarchy on a destination, then remove it on the source, in order to allow migration (since migration normally fails if snapshot metadata still remains on the source machine). When redefining snapshot metadata, the current snapshot will not be altered unless the <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT">VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT</a> flag is also present. It is an error to request the <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT">VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT</a> flag without <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>. On some hypervisors, redefining an existing snapshot can be used to alter host-specific portions of the domain XML to be used during revert (such as backing filenames associated with disk devices), but must not alter guest-visible layout. When redefining a snapshot name that does not exist, the hypervisor may validate that reverting to the snapshot appears to be possible (for example, disk images have snapshot contents by the requested name). Not all hypervisors support these flags. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA">VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA</a>, then the domain's disk images are modified according to @xmlDesc, but then the just-created snapshot has its metadata deleted. This flag is incompatible with <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_HALT">VIR_DOMAIN_SNAPSHOT_CREATE_HALT</a>, then the domain will be inactive after the snapshot completes, regardless of whether it was active before; otherwise, a running domain will still be running after the snapshot. This flag is invalid on transient domains, and is incompatible with <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE">VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE</a>. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY">VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</a>, then the snapshot will be limited to the disks described in @xmlDesc, and no VM state will be saved. For an active guest, the disk image may be inconsistent (as if power had been pulled), and specifying this with the <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_HALT">VIR_DOMAIN_SNAPSHOT_CREATE_HALT</a> flag risks data loss. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE">VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE</a>, then the libvirt will attempt to use guest agent to freeze and thaw all file systems in use within domain OS. However, if the guest agent is not present, an error is thrown. Moreover, this flag requires <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY">VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY</a> to be passed as well. By default, if the snapshot involves external files, and any of the destination files already exist as a non-empty regular file, the snapshot is rejected to avoid losing contents of those files. However, if @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT">VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT</a>, then the destination files must already exist and contain content identical to the source files (this allows a management app to pre-create files with relative backing file names, rather than the default of creating with absolute backing file names). Be aware that although libvirt prefers to report errors up front with no other effect, some hypervisors have certain types of failures where the overall command can easily fail even though the guest configuration was partially altered (for example, if a disk snapshot request for two disks fails on the second disk, but the first disk alteration cannot be rolled back). If this API call fails, it is therefore normally necessary to follow up with <a href="libvirt-libvirt.html#virDomainGetXMLDesc">virDomainGetXMLDesc</a>() and check each disk to determine if any partial changes occurred. However, if @flags contains <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC">VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC</a>, then libvirt guarantees that this command will not alter any disks unless the entire set of changes can be done atomically, making failure recovery simpler (note that it is still possible to fail after disks have changed, but only in the much rarer cases of running out of memory or disk space). Some hypervisors may prevent this operation if there is a current block copy operation; in that case, use <a href="libvirt-libvirt.html#virDomainBlockJobAbort">virDomainBlockJobAbort</a>() to stop the block copy first.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainSnapshotCreateFlags">virDomainSnapshotCreateFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an (opaque) <a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> on success, NULL on failure.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotCurrent" id="virDomainSnapshotCurrent"><code>virDomainSnapshotCurrent</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a>      virDomainSnapshotCurrent        (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     unsigned int flags)<br />
 
1082
</pre><p>Get the current snapshot for a domain, if any.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a domain snapshot object or NULL in case of failure. If the current domain snapshot cannot be found, then the <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN_SNAPSHOT">VIR_ERR_NO_DOMAIN_SNAPSHOT</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotDelete" id="virDomainSnapshotDelete"><code>virDomainSnapshotDelete</code></a></h3><pre class="programlisting">int   virDomainSnapshotDelete         (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)<br />
 
1083
</pre><p>Delete the snapshot. If @flags is 0, then just this snapshot is deleted, and changes from this snapshot are automatically merged into children snapshots. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN">VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN</a>, then this snapshot and any descendant snapshots are deleted. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY">VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY</a>, then any descendant snapshots are deleted, but this snapshot remains. These two flags are mutually exclusive. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY">VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY</a>, then any snapshot metadata tracked by libvirt is removed while keeping the snapshot contents intact; if a hypervisor does not require any libvirt metadata to track snapshots, then this flag is silently ignored.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainSnapshotDeleteFlags">virDomainSnapshotDeleteFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the selected snapshot(s) were successfully deleted, -1 on error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotFree" id="virDomainSnapshotFree"><code>virDomainSnapshotFree</code></a></h3><pre class="programlisting">int      virDomainSnapshotFree           (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot)<br />
985
1084
</pre><p>Free the domain snapshot object. The snapshot itself is not modified. The data structure is freed and should not be used thereafter.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotGetConnect" id="virDomainSnapshotGetConnect"><code>virDomainSnapshotGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>  virDomainSnapshotGetConnect     (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot)<br />
986
1085
</pre><p>Get the connection that owns the domain that a snapshot was created for</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a snapshot object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the connection or NULL.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotGetDomain" id="virDomainSnapshotGetDomain"><code>virDomainSnapshotGetDomain</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>   virDomainSnapshotGetDomain      (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot)<br />
987
1086
</pre><p>Get the domain that a snapshot was created for</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a snapshot object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the domain or NULL.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotGetName" id="virDomainSnapshotGetName"><code>virDomainSnapshotGetName</code></a></h3><pre class="programlisting">const char *      virDomainSnapshotGetName        (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot)<br />
988
1087
</pre><p>Get the public name for that snapshot</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a snapshot object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the name or NULL, the string need not be deallocated as its lifetime will be the same as the snapshot object.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotGetParent" id="virDomainSnapshotGetParent"><code>virDomainSnapshotGetParent</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a>  virDomainSnapshotGetParent      (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                                   unsigned int flags)<br />
989
 
</pre><p>Get the parent snapshot for @snapshot, if any.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused flag parameters; callers should pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a domain snapshot object or NULL in case of failure. If the given snapshot is a root (no parent), then the <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN_SNAPSHOT">VIR_ERR_NO_DOMAIN_SNAPSHOT</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotGetXMLDesc" id="virDomainSnapshotGetXMLDesc"><code>virDomainSnapshotGetXMLDesc</code></a></h3><pre class="programlisting">char *        virDomainSnapshotGetXMLDesc     (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)<br />
 
1088
</pre><p>Get the parent snapshot for @snapshot, if any.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a domain snapshot object or NULL in case of failure. If the given snapshot is a root (no parent), then the <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN_SNAPSHOT">VIR_ERR_NO_DOMAIN_SNAPSHOT</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotGetXMLDesc" id="virDomainSnapshotGetXMLDesc"><code>virDomainSnapshotGetXMLDesc</code></a></h3><pre class="programlisting">char *   virDomainSnapshotGetXMLDesc     (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)<br />
990
1089
</pre><p>Provide an XML description of the domain snapshot. No security-sensitive data will be included unless @flags contains <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_SECURE">VIR_DOMAIN_XML_SECURE</a>; this flag is rejected on read-only connections. For this API, @flags should not contain either <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_INACTIVE">VIR_DOMAIN_XML_INACTIVE</a> or <a href="libvirt-libvirt.html#VIR_DOMAIN_XML_UPDATE_CPU">VIR_DOMAIN_XML_UPDATE_CPU</a>.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of subset of <a href="libvirt-libvirt.html#virDomainXMLFlags">virDomainXMLFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotListChildrenNames" id="virDomainSnapshotListChildrenNames"><code>virDomainSnapshotListChildrenNames</code></a></h3><pre class="programlisting">int virDomainSnapshotListChildrenNames      (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                           char ** names, <br />                                           int nameslen, <br />                                            unsigned int flags)<br />
991
 
</pre><p>Collect the list of domain snapshots that are children of the given snapshot, and store their names in @names. Caller is responsible for freeing each member of the array. The value to use for @nameslen can be determined by <a href="libvirt-libvirt.html#virDomainSnapshotNumChildren">virDomainSnapshotNumChildren</a>() with the same @flags. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS">VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS</a>, then the result includes all descendants, otherwise it is limited to direct children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of snapshots</td></tr><tr><td><span class="term"><i><tt>nameslen</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotListNames" id="virDomainSnapshotListNames"><code>virDomainSnapshotListNames</code></a></h3><pre class="programlisting">int       virDomainSnapshotListNames      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     char ** names, <br />                                   int nameslen, <br />                                    unsigned int flags)<br />
992
 
</pre><p>Collect the list of domain snapshots for the given domain, and store their names in @names. Caller is responsible for freeing each member of the array. The value to use for @nameslen can be determined by <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>() with the same @flags. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_ROOTS">VIR_DOMAIN_SNAPSHOT_LIST_ROOTS</a>, then the result is filtered to the number of snapshots that have no parents. Likewise, if @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. Both flags can be used together to find unrelated snapshots. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of snapshots</td></tr><tr><td><span class="term"><i><tt>nameslen</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotLookupByName" id="virDomainSnapshotLookupByName"><code>virDomainSnapshotLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> virDomainSnapshotLookupByName   (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     const char * name, <br />                                                       unsigned int flags)<br />
993
 
</pre><p>Try to lookup a domain snapshot based on its name.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>name for the domain snapshot</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>unused flag parameters; callers should pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a domain snapshot object or NULL in case of failure. If the domain snapshot cannot be found, then the <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN_SNAPSHOT">VIR_ERR_NO_DOMAIN_SNAPSHOT</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotNum" id="virDomainSnapshotNum"><code>virDomainSnapshotNum</code></a></h3><pre class="programlisting">int       virDomainSnapshotNum            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
994
 
</pre><p>Provides the number of domain snapshots for this domain. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_ROOTS">VIR_DOMAIN_SNAPSHOT_LIST_ROOTS</a>, then the result is filtered to the number of snapshots that have no parents. Likewise, if @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. Both flags can be used together to find unrelated snapshots. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotNumChildren" id="virDomainSnapshotNumChildren"><code>virDomainSnapshotNumChildren</code></a></h3><pre class="programlisting">int   virDomainSnapshotNumChildren    (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)<br />
995
 
</pre><p>Provides the number of child snapshots for this domain snapshot. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS">VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS</a>, then the result includes all descendants, otherwise it is limited to direct children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSuspend" id="virDomainSuspend"><code>virDomainSuspend</code></a></h3><pre class="programlisting">int      virDomainSuspend                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
 
1090
</pre><p>Collect the list of domain snapshots that are children of the given snapshot, and store their names in @names. Caller is responsible for freeing each member of the array. The value to use for @nameslen can be determined by <a href="libvirt-libvirt.html#virDomainSnapshotNumChildren">virDomainSnapshotNumChildren</a>() with the same @flags. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS">VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS</a>, then the result includes all descendants, otherwise it is limited to direct children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of snapshots</td></tr><tr><td><span class="term"><i><tt>nameslen</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotListNames" id="virDomainSnapshotListNames"><code>virDomainSnapshotListNames</code></a></h3><pre class="programlisting">int       virDomainSnapshotListNames      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     char ** names, <br />                                   int nameslen, <br />                                    unsigned int flags)<br />
 
1091
</pre><p>Collect the list of domain snapshots for the given domain, and store their names in @names. Caller is responsible for freeing each member of the array. The value to use for @nameslen can be determined by <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>() with the same @flags. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_ROOTS">VIR_DOMAIN_SNAPSHOT_LIST_ROOTS</a>, then the result is filtered to the number of snapshots that have no parents. Likewise, if @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. Both flags can be used together to find unrelated snapshots. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of names of snapshots</td></tr><tr><td><span class="term"><i><tt>nameslen</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotLookupByName" id="virDomainSnapshotLookupByName"><code>virDomainSnapshotLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> virDomainSnapshotLookupByName   (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                                     const char * name, <br />                                                       unsigned int flags)<br />
 
1092
</pre><p>Try to lookup a domain snapshot based on its name.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>name for the domain snapshot</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a domain snapshot object or NULL in case of failure. If the domain snapshot cannot be found, then the <a href="libvirt-virterror.html#VIR_ERR_NO_DOMAIN_SNAPSHOT">VIR_ERR_NO_DOMAIN_SNAPSHOT</a> error is raised.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotNum" id="virDomainSnapshotNum"><code>virDomainSnapshotNum</code></a></h3><pre class="programlisting">int  virDomainSnapshotNum            (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
 
1093
</pre><p>Provides the number of domain snapshots for this domain. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_ROOTS">VIR_DOMAIN_SNAPSHOT_LIST_ROOTS</a>, then the result is filtered to the number of snapshots that have no parents. Likewise, if @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. Both flags can be used together to find unrelated snapshots. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSnapshotNumChildren" id="virDomainSnapshotNumChildren"><code>virDomainSnapshotNumChildren</code></a></h3><pre class="programlisting">int   virDomainSnapshotNumChildren    (<a href="libvirt-libvirt.html#virDomainSnapshotPtr">virDomainSnapshotPtr</a> snapshot, <br />                                   unsigned int flags)<br />
 
1094
</pre><p>Provides the number of child snapshots for this domain snapshot. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS">VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS</a>, then the result includes all descendants, otherwise it is limited to direct children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_LEAVES">VIR_DOMAIN_SNAPSHOT_LIST_LEAVES</a>, then the result is filtered to the number of snapshots that have no children. If @flags includes <a href="libvirt-libvirt.html#VIR_DOMAIN_SNAPSHOT_LIST_METADATA">VIR_DOMAIN_SNAPSHOT_LIST_METADATA</a>, then the result is the number of snapshots that also include metadata that would prevent the removal of the last reference to a domain; this value will either be 0 or the same value as if the flag were not given.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>snapshot</tt></i>:</span></td><td>a domain snapshot object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainSnapshotListFlags">virDomainSnapshotListFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of domain snapshots found or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virDomainSuspend" id="virDomainSuspend"><code>virDomainSuspend</code></a></h3><pre class="programlisting">int      virDomainSuspend                (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
996
1095
</pre><p>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 <a href="libvirt-libvirt.html#virDomainResume">virDomainResume</a>() to reactivate the domain. This function may require privileged access.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>a domain object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virDomainUndefine" id="virDomainUndefine"><code>virDomainUndefine</code></a></h3><pre class="programlisting">int   virDomainUndefine               (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain)<br />
997
1096
</pre><p>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 <a href="libvirt-libvirt.html#virDomainHasManagedSaveImage">virDomainHasManagedSaveImage</a>()), or if it is inactive and has any snapshot metadata (see <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), then the undefine will fail. See <a href="libvirt-libvirt.html#virDomainUndefineFlags">virDomainUndefineFlags</a>() for more control.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainUndefineFlags" id="virDomainUndefineFlags"><code>virDomainUndefineFlags</code></a></h3><pre class="programlisting">int    virDomainUndefineFlags          (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     unsigned int flags)<br />
998
 
</pre><p>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 <a href="libvirt-libvirt.html#virDomainHasManagedSaveImage">virDomainHasManagedSaveImage</a>()), then including <a href="libvirt-libvirt.html#VIR_DOMAIN_UNDEFINE_MANAGED_SAVE">VIR_DOMAIN_UNDEFINE_MANAGED_SAVE</a> 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 <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), then including <a href="libvirt-libvirt.html#VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA">VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA</a> in @flags will also remove that metadata. Omitting the flag will cause the undefine of an inactive domain to fail. Active snapshots will retain snapshot metadata until the (now-transient) domain halts, regardless of whether this flag is present. On hypervisors where snapshots do not use libvirt metadata, this flag has no effect.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-or of supported <a href="libvirt-libvirt.html#virDomainUndefineFlagsValues">virDomainUndefineFlagsValues</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainUpdateDeviceFlags" id="virDomainUpdateDeviceFlags"><code>virDomainUpdateDeviceFlags</code></a></h3><pre class="programlisting">int      virDomainUpdateDeviceFlags      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
999
 
</pre><p>Change a virtual device on a domain, using the flags parameter to control how the device is changed. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a> specifies that the device change is made based on current domain state. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> specifies that the device shall be changed on the active domain instance only and is not added to the persisted domain configuration. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of <a href="libvirt-libvirt.html#virDomainDeviceModifyFlags">virDomainDeviceModifyFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virEventAddHandle" id="virEventAddHandle"><code>virEventAddHandle</code></a></h3><pre class="programlisting">int      virEventAddHandle               (int fd, <br />                                  int events, <br />                                      <a href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a> cb, <br />                                     void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)<br />
 
1097
</pre><p>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 <a href="libvirt-libvirt.html#virDomainHasManagedSaveImage">virDomainHasManagedSaveImage</a>()), then including <a href="libvirt-libvirt.html#VIR_DOMAIN_UNDEFINE_MANAGED_SAVE">VIR_DOMAIN_UNDEFINE_MANAGED_SAVE</a> 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 <a href="libvirt-libvirt.html#virDomainSnapshotNum">virDomainSnapshotNum</a>()), then including <a href="libvirt-libvirt.html#VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA">VIR_DOMAIN_UNDEFINE_SNAPSHOTS_METADATA</a> in @flags will also remove that metadata. Omitting the flag will cause the undefine of an inactive domain to fail. Active snapshots will retain snapshot metadata until the (now-transient) domain halts, regardless of whether this flag is present. On hypervisors where snapshots do not use libvirt metadata, this flag has no effect.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to a defined domain</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of supported <a href="libvirt-libvirt.html#virDomainUndefineFlagsValues">virDomainUndefineFlagsValues</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virDomainUpdateDeviceFlags" id="virDomainUpdateDeviceFlags"><code>virDomainUpdateDeviceFlags</code></a></h3><pre class="programlisting">int      virDomainUpdateDeviceFlags      (<a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a> domain, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
 
1098
</pre><p>Change a virtual device on a domain, using the flags parameter to control how the device is changed. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CURRENT">VIR_DOMAIN_AFFECT_CURRENT</a> specifies that the device change is made based on current domain state. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_LIVE">VIR_DOMAIN_AFFECT_LIVE</a> specifies that the device shall be changed on the active domain instance only and is not added to the persisted domain configuration. <a href="libvirt-libvirt.html#VIR_DOMAIN_AFFECT_CONFIG">VIR_DOMAIN_AFFECT_CONFIG</a> 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.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>domain</tt></i>:</span></td><td>pointer to domain object</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>pointer to XML description of one device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainDeviceModifyFlags">virDomainDeviceModifyFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virEventAddHandle" id="virEventAddHandle"><code>virEventAddHandle</code></a></h3><pre class="programlisting">int        virEventAddHandle               (int fd, <br />                                  int events, <br />                                      <a href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a> cb, <br />                                     void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)<br />
1000
1099
</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>events</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>ff</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virEventAddHandleFunc" id="virEventAddHandleFunc"><code>virEventAddHandleFunc</code></a></h3><pre class="programlisting">typedef int        (*virEventAddHandleFunc )       (int fd, <br />                                  int event, <br />                                       <a href="libvirt-libvirt.html#virEventHandleCallback">virEventHandleCallback</a> cb, <br />                                     void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)
1001
1100
</pre><p>Part of the EventImpl, this callback adds a file handle callback to listen for specific events. The same file handle can be registered multiple times provided the requested event sets are non-overlapping If the opaque user data requires free'ing when the handle is unregistered, then a 2nd callback can be supplied for this purpose. This callback needs to be invoked from a clean stack. If 'ff' callbacks are invoked directly from the <a href="libvirt-libvirt.html#virEventRemoveHandleFunc">virEventRemoveHandleFunc</a> they will likely deadlock in libvirt.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fd</tt></i>:</span></td><td>file descriptor to listen on</td></tr><tr><td><span class="term"><i><tt>event</tt></i>:</span></td><td>bitset of events on which to fire the callback</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>the callback to be called when an event occurrs</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data to pass to the callback</td></tr><tr><td><span class="term"><i><tt>ff</tt></i>:</span></td><td>the callback invoked to free opaque data blob</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a handle watch number to be used for updating and unregistering for events</td></tr></tbody></table></div><br /><h3><a name="virEventAddTimeout" id="virEventAddTimeout"><code>virEventAddTimeout</code></a></h3><pre class="programlisting">int      virEventAddTimeout              (int timeout, <br />                                     <a href="libvirt-libvirt.html#virEventTimeoutCallback">virEventTimeoutCallback</a> cb, <br />                                   void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)<br />
1002
1101
</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>timeout</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>ff</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="virEventAddTimeoutFunc" id="virEventAddTimeoutFunc"><code>virEventAddTimeoutFunc</code></a></h3><pre class="programlisting">typedef int    (*virEventAddTimeoutFunc        )       (int timeout, <br />                                     <a href="libvirt-libvirt.html#virEventTimeoutCallback">virEventTimeoutCallback</a> cb, <br />                                   void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)
1017
1116
</pre><p>Type for a domain event callback when the event is deregistered and need to be freed, @opaque is provided along with the callback at registration time</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>opaque user data provided at registration</td></tr></tbody></table></div><br /><h3><a name="virGetVersion" id="virGetVersion"><code>virGetVersion</code></a></h3><pre class="programlisting">int    virGetVersion                   (unsigned long * libVer, <br />                                  const char * type, <br />                                       unsigned long * typeVer)<br />
1018
1117
</pre><p>Provides version information. @libVer is the version of the library and will always be set unless an error occurs, in which case an error code will be returned. @typeVer exists for historical compatibility; if it is not NULL it will duplicate @libVer (it was originally intended to return hypervisor information based on @type, but due to the design of remote clients this is not reliable). To get the version of the running hypervisor use the <a href="libvirt-libvirt.html#virConnectGetVersion">virConnectGetVersion</a> function instead. To get the libvirt library version used by a connection use the <a href="libvirt-libvirt.html#virConnectGetLibVersion">virConnectGetLibVersion</a> instead.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>libVer</tt></i>:</span></td><td>return value for the library version (OUT)</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>ignored; pass NULL</td></tr><tr><td><span class="term"><i><tt>typeVer</tt></i>:</span></td><td>pass NULL; for historical purposes duplicates @libVer if non-NULL</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.</td></tr></tbody></table></div><h3><a name="virInitialize" id="virInitialize"><code>virInitialize</code></a></h3><pre class="programlisting">int      virInitialize                   (void)<br />
1019
1118
</pre><p>Initialize the library. It's better to call this routine at startup in multithreaded applications to avoid potential race when initializing the library. Calling <a href="libvirt-libvirt.html#virInitialize">virInitialize</a> is mandatory, unless your first API call is one of virConnectOpen*.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virInterfaceChangeBegin" id="virInterfaceChangeBegin"><code>virInterfaceChangeBegin</code></a></h3><pre class="programlisting">int      virInterfaceChangeBegin         (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int flags)<br />
1020
 
</pre><p>This functions creates a restore point to which one can return later by calling <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>(). This function should be called before any transaction with interface configuration. Once knowing, new configuration works, it can be commited via <a href="libvirt-libvirt.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>(), which frees the restore point. If <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() is called when a transaction is already opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceChangeCommit" id="virInterfaceChangeCommit"><code>virInterfaceChangeCommit</code></a></h3><pre class="programlisting">int   virInterfaceChangeCommit        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int flags)<br />
1021
 
</pre><p>This commits the changes made to interfaces and frees the restore point created by <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>(). If <a href="libvirt-libvirt.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>() is called when a transaction is not opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceChangeRollback" id="virInterfaceChangeRollback"><code>virInterfaceChangeRollback</code></a></h3><pre class="programlisting">int   virInterfaceChangeRollback      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int flags)<br />
1022
 
</pre><p>This cancels changes made to interfaces settings by restoring previous state created by <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>(). If <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called when a transaction is not opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceCreate" id="virInterfaceCreate"><code>virInterfaceCreate</code></a></h3><pre class="programlisting">int  virInterfaceCreate              (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface, <br />                                        unsigned int flags)<br />
1023
 
</pre><p>Activate an interface (i.e. call "ifup"). If there was an open network config transaction at the time this interface was defined (that is, if <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() had been called), the interface will be brought back down (and then undefined) if <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called. p *</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>pointer to a defined interface</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>and OR'ed set of extraction flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virInterfaceDefineXML" id="virInterfaceDefineXML"><code>virInterfaceDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a>       virInterfaceDefineXML   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
1024
 
</pre><p>Define an interface (or modify existing interface configuration). Normally this change in the interface configuration is immediately permanent/persistent, but if <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() has been previously called (i.e. if an interface config transaction is open), the new interface definition will only become permanent if <a href="libvirt-libvirt.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>() is called prior to the next reboot of the system running libvirtd. Prior to that time, it can be explicitly removed using <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>(), or will be automatically removed during the next reboot of the system running libvirtd.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>the XML description for the interface, preferably in UTF-8</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>and OR'ed set of extraction flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of error, a pointer to the interface otherwise</td></tr></tbody></table></div><h3><a name="virInterfaceDestroy" id="virInterfaceDestroy"><code>virInterfaceDestroy</code></a></h3><pre class="programlisting">int    virInterfaceDestroy             (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface, <br />                                        unsigned int flags)<br />
1025
 
</pre><p>deactivate an interface (ie call "ifdown") This does not remove the interface from the config, and does not free the associated <a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> object. If there is an open network config transaction at the time this interface is destroyed (that is, if <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() had been called), and if the interface is later undefined and then <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called, the restoral of the interface definition will also bring the interface back up.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>an interface object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>and OR'ed set of extraction flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceFree" id="virInterfaceFree"><code>virInterfaceFree</code></a></h3><pre class="programlisting">int    virInterfaceFree                (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
 
1119
</pre><p>This function creates a restore point to which one can return later by calling <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>(). This function should be called before any transaction with interface configuration. Once it is known that a new configuration works, it can be committed via <a href="libvirt-libvirt.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>(), which frees the restore point. If <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() is called when a transaction is already opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceChangeCommit" id="virInterfaceChangeCommit"><code>virInterfaceChangeCommit</code></a></h3><pre class="programlisting">int  virInterfaceChangeCommit        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int flags)<br />
 
1120
</pre><p>This commits the changes made to interfaces and frees the restore point created by <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>(). If <a href="libvirt-libvirt.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>() is called when a transaction is not opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceChangeRollback" id="virInterfaceChangeRollback"><code>virInterfaceChangeRollback</code></a></h3><pre class="programlisting">int    virInterfaceChangeRollback      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int flags)<br />
 
1121
</pre><p>This cancels changes made to interfaces settings by restoring previous state created by <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>(). If <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called when a transaction is not opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceCreate" id="virInterfaceCreate"><code>virInterfaceCreate</code></a></h3><pre class="programlisting">int   virInterfaceCreate              (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface, <br />                                        unsigned int flags)<br />
 
1122
</pre><p>Activate an interface (i.e. call "ifup"). If there was an open network config transaction at the time this interface was defined (that is, if <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() had been called), the interface will be brought back down (and then undefined) if <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called. p *</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>pointer to a defined interface</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virInterfaceDefineXML" id="virInterfaceDefineXML"><code>virInterfaceDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a>    virInterfaceDefineXML   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
 
1123
</pre><p>Define an interface (or modify existing interface configuration). Normally this change in the interface configuration is immediately permanent/persistent, but if <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() has been previously called (i.e. if an interface config transaction is open), the new interface definition will only become permanent if <a href="libvirt-libvirt.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>() is called prior to the next reboot of the system running libvirtd. Prior to that time, it can be explicitly removed using <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>(), or will be automatically removed during the next reboot of the system running libvirtd.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>the XML description for the interface, preferably in UTF-8</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of error, a pointer to the interface otherwise</td></tr></tbody></table></div><h3><a name="virInterfaceDestroy" id="virInterfaceDestroy"><code>virInterfaceDestroy</code></a></h3><pre class="programlisting">int virInterfaceDestroy             (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface, <br />                                        unsigned int flags)<br />
 
1124
</pre><p>deactivate an interface (ie call "ifdown") This does not remove the interface from the config, and does not free the associated <a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> object. If there is an open network config transaction at the time this interface is destroyed (that is, if <a href="libvirt-libvirt.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() had been called), and if the interface is later undefined and then <a href="libvirt-libvirt.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called, the restoral of the interface definition will also bring the interface back up.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>an interface object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceFree" id="virInterfaceFree"><code>virInterfaceFree</code></a></h3><pre class="programlisting">int virInterfaceFree                (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
1026
1125
</pre><p>Free the interface object. The interface itself is unaltered. The data structure is freed and should not be used thereafter.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>an interface object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceGetConnect" id="virInterfaceGetConnect"><code>virInterfaceGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> virInterfaceGetConnect  (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
1027
1126
</pre><p>Provides the connection pointer associated with an interface. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the interface object together.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>pointer to an interface</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or NULL in case of failure.</td></tr></tbody></table></div><h3><a name="virInterfaceGetMACString" id="virInterfaceGetMACString"><code>virInterfaceGetMACString</code></a></h3><pre class="programlisting">const char *    virInterfaceGetMACString        (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
1028
1127
</pre><p>Get the MAC for an interface as string. For more information about MAC see RFC4122.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>an interface object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the MAC address (in null-terminated ASCII format) or NULL, the string need not be deallocated its lifetime will be the same as the interface object.</td></tr></tbody></table></div><h3><a name="virInterfaceGetName" id="virInterfaceGetName"><code>virInterfaceGetName</code></a></h3><pre class="programlisting">const char *   virInterfaceGetName     (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
1029
1128
</pre><p>Get the public name for that interface</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>an interface object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the interface object.</td></tr></tbody></table></div><h3><a name="virInterfaceGetXMLDesc" id="virInterfaceGetXMLDesc"><code>virInterfaceGetXMLDesc</code></a></h3><pre class="programlisting">char *      virInterfaceGetXMLDesc          (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface, <br />                                        unsigned int flags)<br />
1030
 
</pre><p><a href="libvirt-libvirt.html#VIR_INTERFACE_XML_INACTIVE">VIR_INTERFACE_XML_INACTIVE</a> - return the static configuration, suitable for use redefining the interface via <a href="libvirt-libvirt.html#virInterfaceDefineXML">virInterfaceDefineXML</a>() Provide an XML description of the interface. If <a href="libvirt-libvirt.html#VIR_INTERFACE_XML_INACTIVE">VIR_INTERFACE_XML_INACTIVE</a> is set, the description may be reused later to redefine the interface with <a href="libvirt-libvirt.html#virInterfaceDefineXML">virInterfaceDefineXML</a>(). If it is not set, the ip address and netmask will be the current live setting of the interface, not the settings from the config files.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>an interface object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of extraction flags. Current valid bits:</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virInterfaceIsActive" id="virInterfaceIsActive"><code>virInterfaceIsActive</code></a></h3><pre class="programlisting">int      virInterfaceIsActive            (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
 
1129
</pre><p><a href="libvirt-libvirt.html#VIR_INTERFACE_XML_INACTIVE">VIR_INTERFACE_XML_INACTIVE</a> - return the static configuration, suitable for use redefining the interface via <a href="libvirt-libvirt.html#virInterfaceDefineXML">virInterfaceDefineXML</a>() Provide an XML description of the interface. If <a href="libvirt-libvirt.html#VIR_INTERFACE_XML_INACTIVE">VIR_INTERFACE_XML_INACTIVE</a> is set, the description may be reused later to redefine the interface with <a href="libvirt-libvirt.html#virInterfaceDefineXML">virInterfaceDefineXML</a>(). If it is not set, the ip address and netmask will be the current live setting of the interface, not the settings from the config files.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>an interface object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of extraction flags. Current valid bits:</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virInterfaceIsActive" id="virInterfaceIsActive"><code>virInterfaceIsActive</code></a></h3><pre class="programlisting">int        virInterfaceIsActive            (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
1031
1130
</pre><p>Determine if the interface is currently running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iface</tt></i>:</span></td><td>pointer to the interface object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if running, 0 if inactive, -1 on error</td></tr></tbody></table></div><h3><a name="virInterfaceLookupByMACString" id="virInterfaceLookupByMACString"><code>virInterfaceLookupByMACString</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a>        virInterfaceLookupByMACString   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * macstr)<br />
1032
1131
</pre><p>Try to lookup an interface on the given hypervisor based on its MAC.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>macstr</tt></i>:</span></td><td>the MAC for the interface (null-terminated ASCII format)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</td></tr></tbody></table></div><h3><a name="virInterfaceLookupByName" id="virInterfaceLookupByName"><code>virInterfaceLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> virInterfaceLookupByName        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * name)<br />
1033
1132
</pre><p>Try to lookup an interface on the given hypervisor based on its name.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>name for the interface</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</td></tr></tbody></table></div><h3><a name="virInterfaceRef" id="virInterfaceRef"><code>virInterfaceRef</code></a></h3><pre class="programlisting">int      virInterfaceRef                 (<a href="libvirt-libvirt.html#virInterfacePtr">virInterfacePtr</a> iface)<br />
1038
1137
</pre><p>Get the public name for the network filter</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>nwfilter</tt></i>:</span></td><td>a nwfilter object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the nwfilter object.</td></tr></tbody></table></div><h3><a name="virNWFilterGetUUID" id="virNWFilterGetUUID"><code>virNWFilterGetUUID</code></a></h3><pre class="programlisting">int virNWFilterGetUUID              (<a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a> nwfilter, <br />                                       unsigned char * uuid)<br />
1039
1138
</pre><p>Get the UUID for a network filter</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>nwfilter</tt></i>:</span></td><td>a nwfilter object</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virNWFilterGetUUIDString" id="virNWFilterGetUUIDString"><code>virNWFilterGetUUIDString</code></a></h3><pre class="programlisting">int virNWFilterGetUUIDString        (<a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a> nwfilter, <br />                                       char * buf)<br />
1040
1139
</pre><p>Get the UUID for a network filter as string. For more information about UUID see RFC4122.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>nwfilter</tt></i>:</span></td><td>a nwfilter object</td></tr><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a> bytes array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virNWFilterGetXMLDesc" id="virNWFilterGetXMLDesc"><code>virNWFilterGetXMLDesc</code></a></h3><pre class="programlisting">char *  virNWFilterGetXMLDesc           (<a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a> nwfilter, <br />                                       unsigned int flags)<br />
1041
 
</pre><p>Provide an XML description of the network filter. The description may be reused later to redefine the network filter with virNWFilterCreateXML().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>nwfilter</tt></i>:</span></td><td>a nwfilter object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of extraction flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virNWFilterLookupByName" id="virNWFilterLookupByName"><code>virNWFilterLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a>     virNWFilterLookupByName (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * name)<br />
 
1140
</pre><p>Provide an XML description of the network filter. The description may be reused later to redefine the network filter with virNWFilterCreateXML().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>nwfilter</tt></i>:</span></td><td>a nwfilter object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virNWFilterLookupByName" id="virNWFilterLookupByName"><code>virNWFilterLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a> virNWFilterLookupByName (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * name)<br />
1042
1141
</pre><p>Try to lookup a network filter on the given hypervisor based on its name.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>name for the network filter</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new nwfilter object or NULL in case of failure. If the network filter cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NWFILTER">VIR_ERR_NO_NWFILTER</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNWFilterLookupByUUID" id="virNWFilterLookupByUUID"><code>virNWFilterLookupByUUID</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a>      virNWFilterLookupByUUID (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const unsigned char * uuid)<br />
1043
1142
</pre><p>Try to lookup a network filter on the given hypervisor based on its UUID.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>the raw UUID for the network filter</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new nwfilter object or NULL in case of failure. If the nwfdilter cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NWFILTER">VIR_ERR_NO_NWFILTER</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNWFilterLookupByUUIDString" id="virNWFilterLookupByUUIDString"><code>virNWFilterLookupByUUIDString</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a> virNWFilterLookupByUUIDString   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * uuidstr)<br />
1044
1143
</pre><p>Try to lookup an nwfilter on the given hypervisor based on its UUID.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuidstr</tt></i>:</span></td><td>the string UUID for the nwfilter</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new nwfilter object or NULL in case of failure. If the nwfilter cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NWFILTER">VIR_ERR_NO_NWFILTER</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNWFilterRef" id="virNWFilterRef"><code>virNWFilterRef</code></a></h3><pre class="programlisting">int virNWFilterRef                  (<a href="libvirt-libvirt.html#virNWFilterPtr">virNWFilterPtr</a> nwfilter)<br />
1055
1154
</pre><p>Get the public name for that network</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the network object.</td></tr></tbody></table></div><h3><a name="virNetworkGetUUID" id="virNetworkGetUUID"><code>virNetworkGetUUID</code></a></h3><pre class="programlisting">int     virNetworkGetUUID               (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br />                                  unsigned char * uuid)<br />
1056
1155
</pre><p>Get the UUID for a network</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virNetworkGetUUIDString" id="virNetworkGetUUIDString"><code>virNetworkGetUUIDString</code></a></h3><pre class="programlisting">int     virNetworkGetUUIDString         (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br />                                  char * buf)<br />
1057
1156
</pre><p>Get the UUID for a network as string. For more information about UUID see RFC4122.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a> bytes array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virNetworkGetXMLDesc" id="virNetworkGetXMLDesc"><code>virNetworkGetXMLDesc</code></a></h3><pre class="programlisting">char *      virNetworkGetXMLDesc            (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br />                                  unsigned int flags)<br />
1058
 
</pre><p>Provide an XML description of the network. The description may be reused later to relaunch the network with <a href="libvirt-libvirt.html#virNetworkCreateXML">virNetworkCreateXML</a>().</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>an OR'ed set of extraction flags, not used yet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virNetworkIsActive" id="virNetworkIsActive"><code>virNetworkIsActive</code></a></h3><pre class="programlisting">int   virNetworkIsActive              (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net)<br />
 
1157
</pre><p>Provide an XML description of the network. The description may be reused later to relaunch the network with <a href="libvirt-libvirt.html#virNetworkCreateXML">virNetworkCreateXML</a>(). Normally, if a network included a physical function, the output includes all virtual functions tied to that physical interface. If @flags includes <a href="libvirt-libvirt.html#VIR_NETWORK_XML_INACTIVE">VIR_NETWORK_XML_INACTIVE</a>, then the expansion of virtual interfaces is not performed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virNetworkXMLFlags">virNetworkXMLFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. the caller must free() the returned value.</td></tr></tbody></table></div><h3><a name="virNetworkIsActive" id="virNetworkIsActive"><code>virNetworkIsActive</code></a></h3><pre class="programlisting">int       virNetworkIsActive              (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net)<br />
1059
1158
</pre><p>Determine if the network is currently running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>net</tt></i>:</span></td><td>pointer to the network object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if running, 0 if inactive, -1 on error</td></tr></tbody></table></div><h3><a name="virNetworkIsPersistent" id="virNetworkIsPersistent"><code>virNetworkIsPersistent</code></a></h3><pre class="programlisting">int  virNetworkIsPersistent          (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> net)<br />
1060
1159
</pre><p>Determine if the network has a persistent configuration which means it will still exist after shutting down</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>net</tt></i>:</span></td><td>pointer to the network object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if persistent, 0 if transient, -1 on error</td></tr></tbody></table></div><h3><a name="virNetworkLookupByName" id="virNetworkLookupByName"><code>virNetworkLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>     virNetworkLookupByName  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * name)<br />
1061
1160
</pre><p>Try to lookup a network on the given hypervisor based on its name.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>name for the network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new network object or NULL in case of failure. If the network cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> error is raised.</td></tr></tbody></table></div><h3><a name="virNetworkLookupByUUID" id="virNetworkLookupByUUID"><code>virNetworkLookupByUUID</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>   virNetworkLookupByUUID  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const unsigned char * uuid)<br />
1064
1163
</pre><p>Increment the reference count on the network. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virNetworkFree">virNetworkFree</a> 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 network would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>the network to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNetworkSetAutostart" id="virNetworkSetAutostart"><code>virNetworkSetAutostart</code></a></h3><pre class="programlisting">int        virNetworkSetAutostart          (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network, <br />                                  int autostart)<br />
1065
1164
</pre><p>Configure the network to be automatically started when the host machine boots.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>a network object</td></tr><tr><td><span class="term"><i><tt>autostart</tt></i>:</span></td><td>whether the network should be automatically started 0 or 1</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virNetworkUndefine" id="virNetworkUndefine"><code>virNetworkUndefine</code></a></h3><pre class="programlisting">int    virNetworkUndefine              (<a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a> network)<br />
1066
1165
</pre><p>Undefine a network but does not stop it if it is running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>network</tt></i>:</span></td><td>pointer to a defined network</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="virNodeDeviceCreateXML" id="virNodeDeviceCreateXML"><code>virNodeDeviceCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>  virNodeDeviceCreateXML  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * xmlDesc, <br />                                            unsigned int flags)<br />
1067
 
</pre><p>Create a new device on the VM host machine, for example, virtual HBAs created using vport_create.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the device to be created</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a node device object if successful, NULL in case of failure</td></tr></tbody></table></div><h3><a name="virNodeDeviceDestroy" id="virNodeDeviceDestroy"><code>virNodeDeviceDestroy</code></a></h3><pre class="programlisting">int     virNodeDeviceDestroy            (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
 
1166
</pre><p>Create a new device on the VM host machine, for example, virtual HBAs created using vport_create.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>string containing an XML description of the device to be created</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a node device object if successful, NULL in case of failure</td></tr></tbody></table></div><h3><a name="virNodeDeviceDestroy" id="virNodeDeviceDestroy"><code>virNodeDeviceDestroy</code></a></h3><pre class="programlisting">int       virNodeDeviceDestroy            (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1068
1167
</pre><p>Destroy the device object. The virtual device is removed from the host operating system. This function may require privileged access</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>a device object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNodeDeviceDettach" id="virNodeDeviceDettach"><code>virNodeDeviceDettach</code></a></h3><pre class="programlisting">int        virNodeDeviceDettach            (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1069
1168
</pre><p>Dettach the node device from the node itself so that it may be assigned to a guest domain. Depending on the hypervisor, this may involve operations such as unbinding any device drivers from the device, binding the device to a dummy device driver and resetting the device. If the device is currently in use by the node, this method may fail. Once the device is not assigned to any guest, it may be re-attached to the node using the virNodeDeviceReattach() method.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNodeDeviceFree" id="virNodeDeviceFree"><code>virNodeDeviceFree</code></a></h3><pre class="programlisting">int       virNodeDeviceFree               (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1070
1169
</pre><p>Drops a reference to the node device, freeing it if this was the last reference.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the 0 for success, -1 for error.</td></tr></tbody></table></div><h3><a name="virNodeDeviceGetName" id="virNodeDeviceGetName"><code>virNodeDeviceGetName</code></a></h3><pre class="programlisting">const char *       virNodeDeviceGetName    (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1071
1170
</pre><p>Just return the device name</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the device name or NULL in case of error</td></tr></tbody></table></div><h3><a name="virNodeDeviceGetParent" id="virNodeDeviceGetParent"><code>virNodeDeviceGetParent</code></a></h3><pre class="programlisting">const char *      virNodeDeviceGetParent  (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1072
1171
</pre><p>Accessor for the parent of the device</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the name of the device's parent, or NULL if the device has no parent.</td></tr></tbody></table></div><h3><a name="virNodeDeviceGetXMLDesc" id="virNodeDeviceGetXMLDesc"><code>virNodeDeviceGetXMLDesc</code></a></h3><pre class="programlisting">char *  virNodeDeviceGetXMLDesc         (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev, <br />                                        unsigned int flags)<br />
1073
 
</pre><p>Fetch an XML document describing all aspects of the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for XML generation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virNodeDeviceListCaps" id="virNodeDeviceListCaps"><code>virNodeDeviceListCaps</code></a></h3><pre class="programlisting">int    virNodeDeviceListCaps           (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev, <br />                                        char ** const names, <br />                                     int maxnames)<br />
 
1172
</pre><p>Fetch an XML document describing all aspects of the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virNodeDeviceListCaps" id="virNodeDeviceListCaps"><code>virNodeDeviceListCaps</code></a></h3><pre class="programlisting">int   virNodeDeviceListCaps           (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev, <br />                                        char ** const names, <br />                                     int maxnames)<br />
1074
1173
</pre><p>Lists the names of the capabilities supported by the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of capability names</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of capability names listed in @names.</td></tr></tbody></table></div><h3><a name="virNodeDeviceLookupByName" id="virNodeDeviceLookupByName"><code>virNodeDeviceLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a>        virNodeDeviceLookupByName       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     const char * name)<br />
1075
1174
</pre><p>Lookup a node device by its name.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>unique device name</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> if found, NULL otherwise.</td></tr></tbody></table></div><h3><a name="virNodeDeviceNumOfCaps" id="virNodeDeviceNumOfCaps"><code>virNodeDeviceNumOfCaps</code></a></h3><pre class="programlisting">int  virNodeDeviceNumOfCaps          (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1076
1175
</pre><p>Accessor for the number of capabilities supported by the device.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of capabilities supported by the device.</td></tr></tbody></table></div><h3><a name="virNodeDeviceReAttach" id="virNodeDeviceReAttach"><code>virNodeDeviceReAttach</code></a></h3><pre class="programlisting">int  virNodeDeviceReAttach           (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1077
1176
</pre><p>Re-attach a previously dettached node device to the node so that it may be used by the node again. Depending on the hypervisor, this may involve operations such as resetting the device, unbinding it from a dummy device driver and binding it to its appropriate driver. If the device is currently in use by a guest, this method may fail.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNodeDeviceRef" id="virNodeDeviceRef"><code>virNodeDeviceRef</code></a></h3><pre class="programlisting">int virNodeDeviceRef                (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1078
1177
</pre><p>Increment the reference count on the dev. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virNodeDeviceFree">virNodeDeviceFree</a> 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 dev would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>the dev to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNodeDeviceReset" id="virNodeDeviceReset"><code>virNodeDeviceReset</code></a></h3><pre class="programlisting">int      virNodeDeviceReset              (<a href="libvirt-libvirt.html#virNodeDevicePtr">virNodeDevicePtr</a> dev)<br />
1079
1178
</pre><p>Reset a previously dettached node device to the node before or after assigning it to a guest. The exact reset semantics depends on the hypervisor and device type but, for example, KVM will attempt to reset PCI devices with a Function Level Reset, Secondary Bus Reset or a Power Management D-State reset. If the reset will affect other devices which are currently in use, this function may fail.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>dev</tt></i>:</span></td><td>pointer to the node device</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNodeGetCPUStats" id="virNodeGetCPUStats"><code>virNodeGetCPUStats</code></a></h3><pre class="programlisting">int        virNodeGetCPUStats              (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     int cpuNum, <br />                                      <a href="libvirt-libvirt.html#virNodeCPUStatsPtr">virNodeCPUStatsPtr</a> params, <br />                                         int * nparams, <br />                                   unsigned int flags)<br />
1080
 
</pre><p>This function provides individual cpu statistics of the node. If you want to get total cpu statistics of the node, you must specify <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_ALL_CPUS">VIR_NODE_CPU_STATS_ALL_CPUS</a> to @cpuNum. The @params array will be filled with the values equal to the number of parameters suggested by @nparams As the value of @nparams is dynamic, call the API setting @nparams to 0 and @params as NULL, the API returns the number of parameters supported by the HV by updating @nparams on SUCCESS. The caller should then allocate @params array, i.e. (sizeof(@virNodeCPUStats) * @nparams) bytes and call the API again. Here is a sample code snippet: if ((virNodeGetCPUStats(conn, cpuNum, NULL, &amp;nparams, 0) == 0) &amp;&amp; (nparams != 0)) { if ((params = malloc(sizeof(virNodeCPUStats) * nparams)) == NULL) goto error; memset(params, 0, sizeof(virNodeCPUStats) * nparams); if (virNodeGetCPUStats(conn, cpuNum, params, &amp;nparams, 0)) goto error; } This function doesn't require privileged access to the hypervisor. This function expects the caller to allocate the @params. CPU time Statistics: <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_KERNEL">VIR_NODE_CPU_STATS_KERNEL</a>: The cumulative CPU time which spends by kernel, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_USER">VIR_NODE_CPU_STATS_USER</a>: The cumulative CPU time which spends by user processes, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_IDLE">VIR_NODE_CPU_STATS_IDLE</a>: The cumulative idle CPU time, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_IOWAIT">VIR_NODE_CPU_STATS_IOWAIT</a>: The cumulative I/O wait CPU time, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_UTILIZATION">VIR_NODE_CPU_STATS_UTILIZATION</a>: The CPU utilization. The usage value is in percent and 100% represents all CPUs on the server.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection.</td></tr><tr><td><span class="term"><i><tt>cpuNum</tt></i>:</span></td><td>number of node cpu. (<a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_ALL_CPUS">VIR_NODE_CPU_STATS_ALL_CPUS</a> means total cpu statistics)</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to node cpu time parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of node cpu time parameter (this value should be same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, for future extension. always pass 0.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virNodeGetCellsFreeMemory" id="virNodeGetCellsFreeMemory"><code>virNodeGetCellsFreeMemory</code></a></h3><pre class="programlisting">int      virNodeGetCellsFreeMemory       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned long long * freeMems, <br />                                   int startCell, <br />                                   int maxCells)<br />
 
1179
</pre><p>This function provides individual cpu statistics of the node. If you want to get total cpu statistics of the node, you must specify <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_ALL_CPUS">VIR_NODE_CPU_STATS_ALL_CPUS</a> to @cpuNum. The @params array will be filled with the values equal to the number of parameters suggested by @nparams As the value of @nparams is dynamic, call the API setting @nparams to 0 and @params as NULL, the API returns the number of parameters supported by the HV by updating @nparams on SUCCESS. The caller should then allocate @params array, i.e. (sizeof(@virNodeCPUStats) * @nparams) bytes and call the API again. Here is a sample code snippet: if ((virNodeGetCPUStats(conn, cpuNum, NULL, &amp;nparams, 0) == 0) &amp;&amp; (nparams != 0)) { if ((params = malloc(sizeof(virNodeCPUStats) * nparams)) == NULL) goto error; memset(params, 0, sizeof(virNodeCPUStats) * nparams); if (virNodeGetCPUStats(conn, cpuNum, params, &amp;nparams, 0)) goto error; } This function doesn't require privileged access to the hypervisor. This function expects the caller to allocate the @params. CPU time Statistics: <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_KERNEL">VIR_NODE_CPU_STATS_KERNEL</a>: The cumulative CPU time which spends by kernel, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_USER">VIR_NODE_CPU_STATS_USER</a>: The cumulative CPU time which spends by user processes, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_IDLE">VIR_NODE_CPU_STATS_IDLE</a>: The cumulative idle CPU time, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_IOWAIT">VIR_NODE_CPU_STATS_IOWAIT</a>: The cumulative I/O wait CPU time, when the node booting up.(nanoseconds) <a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_UTILIZATION">VIR_NODE_CPU_STATS_UTILIZATION</a>: The CPU utilization. The usage value is in percent and 100% represents all CPUs on the server.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection.</td></tr><tr><td><span class="term"><i><tt>cpuNum</tt></i>:</span></td><td>number of node cpu. (<a href="libvirt-libvirt.html#VIR_NODE_CPU_STATS_ALL_CPUS">VIR_NODE_CPU_STATS_ALL_CPUS</a> means total cpu statistics)</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to node cpu time parameter objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of node cpu time parameter (this value should be same or less than the number of parameters supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virNodeGetCellsFreeMemory" id="virNodeGetCellsFreeMemory"><code>virNodeGetCellsFreeMemory</code></a></h3><pre class="programlisting">int  virNodeGetCellsFreeMemory       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned long long * freeMems, <br />                                   int startCell, <br />                                   int maxCells)<br />
1081
1180
</pre><p>This call returns the amount of free memory in one or more NUMA cells. The @freeMems array must be allocated by the caller and will be filled with the amount of free memory in bytes for each cell requested, starting with startCell (in freeMems[0]), up to either (startCell + maxCells), or the number of additional cells in the node, whichever is smaller.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>freeMems</tt></i>:</span></td><td>pointer to the array of unsigned long long</td></tr><tr><td><span class="term"><i><tt>startCell</tt></i>:</span></td><td>index of first cell to return freeMems info on.</td></tr><tr><td><span class="term"><i><tt>maxCells</tt></i>:</span></td><td>Maximum number of cells for which freeMems information can be returned.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of entries filled in freeMems, or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virNodeGetFreeMemory" id="virNodeGetFreeMemory"><code>virNodeGetFreeMemory</code></a></h3><pre class="programlisting">unsigned long long        virNodeGetFreeMemory    (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br />
1082
 
</pre><p>provides the free memory available on the Node Note: most libvirt APIs provide memory sizes in kilobytes, but in this function the returned value is in bytes. Divide by 1024 as necessary.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the available free memory in bytes or 0 in case of error</td></tr></tbody></table></div><h3><a name="virNodeGetInfo" id="virNodeGetInfo"><code>virNodeGetInfo</code></a></h3><pre class="programlisting">int    virNodeGetInfo                  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a> info)<br />
 
1181
</pre><p>provides the free memory available on the Node Note: most libvirt APIs provide memory sizes in kibibytes, but in this function the returned value is in bytes. Divide by 1024 as necessary.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the available free memory in bytes or 0 in case of error</td></tr></tbody></table></div><h3><a name="virNodeGetInfo" id="virNodeGetInfo"><code>virNodeGetInfo</code></a></h3><pre class="programlisting">int    virNodeGetInfo                  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virNodeInfoPtr">virNodeInfoPtr</a> info)<br />
1083
1182
</pre><p>Extract hardware information about the node.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virNodeInfo">virNodeInfo</a> structure allocated by the user</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virNodeGetMemoryStats" id="virNodeGetMemoryStats"><code>virNodeGetMemoryStats</code></a></h3><pre class="programlisting">int      virNodeGetMemoryStats           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     int cellNum, <br />                                     <a href="libvirt-libvirt.html#virNodeMemoryStatsPtr">virNodeMemoryStatsPtr</a> params, <br />                                   int * nparams, <br />                                   unsigned int flags)<br />
1084
 
</pre><p>This function provides memory stats of the node. If you want to get total cpu statistics of the node, you must specify <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a> to @cellNum. The @params array will be filled with the values equal to the number of stats suggested by @nparams As the value of @nparams is dynamic, call the API setting @nparams to 0 and @params as NULL, the API returns the number of parameters supported by the HV by updating @nparams on SUCCESS. The caller should then allocate @params array, i.e. (sizeof(@virNodeMemoryStats) * @nparams) bytes and call the API again. Here is the sample code snippet: if ((virNodeGetMemoryStats(conn, cellNum, NULL, &amp;nparams, 0) == 0) &amp;&amp; (nparams != 0)) { if ((params = malloc(sizeof(virNodeMemoryStats) * nparams)) == NULL) goto error; memset(params, cellNum, 0, sizeof(virNodeMemoryStats) * nparams); if (virNodeGetMemoryStats(conn, params, &amp;nparams, 0)) goto error; } This function doesn't require privileged access to the hypervisor. This function expects the caller to allocate the @params. Memory Stats: <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_TOTAL">VIR_NODE_MEMORY_STATS_TOTAL</a>: The total memory usage.(KB) <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_FREE">VIR_NODE_MEMORY_STATS_FREE</a>: The free memory usage.(KB) On linux, this usage includes buffers and cached. <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_BUFFERS">VIR_NODE_MEMORY_STATS_BUFFERS</a>: The buffers memory usage.(KB) <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_CACHED">VIR_NODE_MEMORY_STATS_CACHED</a>: The cached memory usage.(KB)</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection.</td></tr><tr><td><span class="term"><i><tt>cellNum</tt></i>:</span></td><td>number of node cell. (<a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a> means total cell statistics)</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to node memory stats objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of node memory stats (this value should be same or less than the number of stats supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>currently unused, for future extension. always pass 0.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virNodeGetSecurityModel" id="virNodeGetSecurityModel"><code>virNodeGetSecurityModel</code></a></h3><pre class="programlisting">int    virNodeGetSecurityModel         (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virSecurityModelPtr">virSecurityModelPtr</a> secmodel)<br />
 
1183
</pre><p>This function provides memory stats of the node. If you want to get total cpu statistics of the node, you must specify <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a> to @cellNum. The @params array will be filled with the values equal to the number of stats suggested by @nparams As the value of @nparams is dynamic, call the API setting @nparams to 0 and @params as NULL, the API returns the number of parameters supported by the HV by updating @nparams on SUCCESS. The caller should then allocate @params array, i.e. (sizeof(@virNodeMemoryStats) * @nparams) bytes and call the API again. Here is the sample code snippet: if ((virNodeGetMemoryStats(conn, cellNum, NULL, &amp;nparams, 0) == 0) &amp;&amp; (nparams != 0)) { if ((params = malloc(sizeof(virNodeMemoryStats) * nparams)) == NULL) goto error; memset(params, cellNum, 0, sizeof(virNodeMemoryStats) * nparams); if (virNodeGetMemoryStats(conn, params, &amp;nparams, 0)) goto error; } This function doesn't require privileged access to the hypervisor. This function expects the caller to allocate the @params. Memory Stats: <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_TOTAL">VIR_NODE_MEMORY_STATS_TOTAL</a>: The total memory usage.(KB) <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_FREE">VIR_NODE_MEMORY_STATS_FREE</a>: The free memory usage.(KB) On linux, this usage includes buffers and cached. <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_BUFFERS">VIR_NODE_MEMORY_STATS_BUFFERS</a>: The buffers memory usage.(KB) <a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_CACHED">VIR_NODE_MEMORY_STATS_CACHED</a>: The cached memory usage.(KB)</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection.</td></tr><tr><td><span class="term"><i><tt>cellNum</tt></i>:</span></td><td>number of node cell. (<a href="libvirt-libvirt.html#VIR_NODE_MEMORY_STATS_ALL_CELLS">VIR_NODE_MEMORY_STATS_ALL_CELLS</a> means total cell statistics)</td></tr><tr><td><span class="term"><i><tt>params</tt></i>:</span></td><td>pointer to node memory stats objects</td></tr><tr><td><span class="term"><i><tt>nparams</tt></i>:</span></td><td>number of node memory stats (this value should be same or less than the number of stats supported)</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success.</td></tr></tbody></table></div><h3><a name="virNodeGetSecurityModel" id="virNodeGetSecurityModel"><code>virNodeGetSecurityModel</code></a></h3><pre class="programlisting">int        virNodeGetSecurityModel         (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     <a href="libvirt-libvirt.html#virSecurityModelPtr">virSecurityModelPtr</a> secmodel)<br />
1085
1184
</pre><p>Extract the security model of a hypervisor. The 'model' field in the @secmodel argument may be initialized to the empty string if the driver has not activated a security model.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>a connection object</td></tr><tr><td><span class="term"><i><tt>secmodel</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#virSecurityModel">virSecurityModel</a> structure</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure</td></tr></tbody></table></div><h3><a name="virNodeListDevices" id="virNodeListDevices"><code>virNodeListDevices</code></a></h3><pre class="programlisting">int        virNodeListDevices              (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * cap, <br />                                        char ** const names, <br />                                     int maxnames, <br />                                    unsigned int flags)<br />
1086
 
</pre><p>Collect the list of node devices, and store their names in @names If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>cap</tt></i>:</span></td><td>capability name</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of node device names</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of node devices found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virNodeNumOfDevices" id="virNodeNumOfDevices"><code>virNodeNumOfDevices</code></a></h3><pre class="programlisting">int   virNodeNumOfDevices             (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * cap, <br />                                        unsigned int flags)<br />
1087
 
</pre><p>Provides the number of node devices. If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>cap</tt></i>:</span></td><td>capability name</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of node devices or -1 in case of error</td></tr></tbody></table></div><h3><a name="virNodeSuspendForDuration" id="virNodeSuspendForDuration"><code>virNodeSuspendForDuration</code></a></h3><pre class="programlisting">int virNodeSuspendForDuration       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int target, <br />                                     unsigned long long duration, <br />                                     unsigned int flags)<br />
1088
 
</pre><p>Attempt to suspend the node (host machine) for the given duration of time in the specified state (Suspend-to-RAM, Suspend-to-Disk or Hybrid-Suspend). Schedule the node's Real-Time-Clock interrupt to resume the node after the duration is complete.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>the state to which the host must be suspended to, such as: <a href="libvirt-libvirt.html#VIR_NODE_SUSPEND_TARGET_MEM">VIR_NODE_SUSPEND_TARGET_MEM</a> (Suspend-to-RAM) <a href="libvirt-libvirt.html#VIR_NODE_SUSPEND_TARGET_DISK">VIR_NODE_SUSPEND_TARGET_DISK</a> (Suspend-to-Disk) <a href="libvirt-libvirt.html#VIR_NODE_SUSPEND_TARGET_HYBRID">VIR_NODE_SUSPEND_TARGET_HYBRID</a> (Hybrid-Suspend, which is a combination of the former modes).</td></tr><tr><td><span class="term"><i><tt>duration</tt></i>:</span></td><td>the time duration in seconds for which the host has to be suspended</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>any flag values that might need to be passed; currently unused (0).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success (i.e., the node will be suspended after a short delay), -1 on failure (the operation is not supported, or an attempted suspend is already underway).</td></tr></tbody></table></div><h3><a name="virSecretDefineXML" id="virSecretDefineXML"><code>virSecretDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a>    virSecretDefineXML      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
1089
 
</pre><p>If XML specifies a UUID, locates the specified secret and replaces all attributes of the secret specified by UUID by attributes specified in xml (any attributes not specified in xml are discarded). Otherwise, creates a new secret with an automatically chosen UUID, and initializes its attributes from xml.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>XML describing the secret.</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a the secret on success, NULL on failure.</td></tr></tbody></table></div><h3><a name="virSecretFree" id="virSecretFree"><code>virSecretFree</code></a></h3><pre class="programlisting">int       virSecretFree                   (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
 
1185
</pre><p>Collect the list of node devices, and store their names in @names If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>cap</tt></i>:</span></td><td>capability name</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array to collect the list of node device names</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of @names</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of node devices found or -1 in case of error</td></tr></tbody></table></div><h3><a name="virNodeNumOfDevices" id="virNodeNumOfDevices"><code>virNodeNumOfDevices</code></a></h3><pre class="programlisting">int       virNodeNumOfDevices             (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * cap, <br />                                        unsigned int flags)<br />
 
1186
</pre><p>Provides the number of node devices. If the optional 'cap' argument is non-NULL, then the count will be restricted to devices with the specified capability</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>cap</tt></i>:</span></td><td>capability name</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of node devices or -1 in case of error</td></tr></tbody></table></div><h3><a name="virNodeSuspendForDuration" id="virNodeSuspendForDuration"><code>virNodeSuspendForDuration</code></a></h3><pre class="programlisting">int     virNodeSuspendForDuration       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int target, <br />                                     unsigned long long duration, <br />                                     unsigned int flags)<br />
 
1187
</pre><p>Attempt to suspend the node (host machine) for the given duration of time in the specified state (Suspend-to-RAM, Suspend-to-Disk or Hybrid-Suspend). Schedule the node's Real-Time-Clock interrupt to resume the node after the duration is complete.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>target</tt></i>:</span></td><td>the state to which the host must be suspended to, such as: <a href="libvirt-libvirt.html#VIR_NODE_SUSPEND_TARGET_MEM">VIR_NODE_SUSPEND_TARGET_MEM</a> (Suspend-to-RAM) <a href="libvirt-libvirt.html#VIR_NODE_SUSPEND_TARGET_DISK">VIR_NODE_SUSPEND_TARGET_DISK</a> (Suspend-to-Disk) <a href="libvirt-libvirt.html#VIR_NODE_SUSPEND_TARGET_HYBRID">VIR_NODE_SUSPEND_TARGET_HYBRID</a> (Hybrid-Suspend, which is a combination of the former modes).</td></tr><tr><td><span class="term"><i><tt>duration</tt></i>:</span></td><td>the time duration in seconds for which the host has to be suspended</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success (i.e., the node will be suspended after a short delay), -1 on failure (the operation is not supported, or an attempted suspend is already underway).</td></tr></tbody></table></div><h3><a name="virSecretDefineXML" id="virSecretDefineXML"><code>virSecretDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a>     virSecretDefineXML      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const char * xml, <br />                                        unsigned int flags)<br />
 
1188
</pre><p>If XML specifies a UUID, locates the specified secret and replaces all attributes of the secret specified by UUID by attributes specified in xml (any attributes not specified in xml are discarded). Otherwise, creates a new secret with an automatically chosen UUID, and initializes its attributes from xml.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td><a href="libvirt-libvirt.html#virConnect">virConnect</a> connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>XML describing the secret.</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a the secret on success, NULL on failure.</td></tr></tbody></table></div><h3><a name="virSecretFree" id="virSecretFree"><code>virSecretFree</code></a></h3><pre class="programlisting">int virSecretFree                   (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
1090
1189
</pre><p>Release the secret handle. The underlying secret continues to exist.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>pointer to a secret</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virSecretGetConnect" id="virSecretGetConnect"><code>virSecretGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>    virSecretGetConnect     (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
1091
1190
</pre><p>Provides the connection pointer associated with a secret. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the secret object together.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> secret</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or NULL in case of failure.</td></tr></tbody></table></div><h3><a name="virSecretGetUUID" id="virSecretGetUUID"><code>virSecretGetUUID</code></a></h3><pre class="programlisting">int   virSecretGetUUID                (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret, <br />                                     unsigned char * uuid)<br />
1092
1191
</pre><p>Fetches the UUID of the secret.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> secret</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>buffer of <a href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes in size</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success with the uuid buffer being filled, or -1 upon failure.</td></tr></tbody></table></div><h3><a name="virSecretGetUUIDString" id="virSecretGetUUIDString"><code>virSecretGetUUIDString</code></a></h3><pre class="programlisting">int    virSecretGetUUIDString          (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret, <br />                                     char * buf)<br />
1093
1192
</pre><p>Get the UUID for a secret as string. For more information about UUID see RFC4122.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>a secret object</td></tr><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>pointer to a <a href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a> bytes array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 in case of success</td></tr></tbody></table></div><h3><a name="virSecretGetUsageID" id="virSecretGetUsageID"><code>virSecretGetUsageID</code></a></h3><pre class="programlisting">const char *      virSecretGetUsageID     (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
1094
1193
</pre><p>Get the unique identifier of the object with which this secret is to be used. The format of the identifier is dependant on the usage type of the secret. For a secret with a usage type of <a href="libvirt-libvirt.html#VIR_SECRET_USAGE_TYPE_VOLUME">VIR_SECRET_USAGE_TYPE_VOLUME</a> the identifier will be a fully qualfied path name. The identifiers are intended to be unique within the set of all secrets sharing the same usage type. ie, there shall only ever be one secret for each volume path.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>a secret object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a string identifying the object using the secret, or NULL upon error</td></tr></tbody></table></div><h3><a name="virSecretGetUsageType" id="virSecretGetUsageType"><code>virSecretGetUsageType</code></a></h3><pre class="programlisting">int    virSecretGetUsageType           (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
1095
1194
</pre><p>Get the type of object which uses this secret. The returned value is one of the constants defined in the <a href="libvirt-libvirt.html#virSecretUsageType">virSecretUsageType</a> enumeration. More values may be added to this enumeration in the future, so callers should expect to see usage types they do not explicitly know about.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>a secret object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a positive integer identifying the type of object, or -1 upon error.</td></tr></tbody></table></div><h3><a name="virSecretGetValue" id="virSecretGetValue"><code>virSecretGetValue</code></a></h3><pre class="programlisting">unsigned char *        virSecretGetValue       (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret, <br />                                     size_t * value_size, <br />                                     unsigned int flags)<br />
1096
 
</pre><p>Fetches the value of a secret.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> connection</td></tr><tr><td><span class="term"><i><tt>value_size</tt></i>:</span></td><td>Place for storing size of the secret value</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the secret value on success, NULL on failure. The caller must free() the secret value.</td></tr></tbody></table></div><h3><a name="virSecretGetXMLDesc" id="virSecretGetXMLDesc"><code>virSecretGetXMLDesc</code></a></h3><pre class="programlisting">char *       virSecretGetXMLDesc             (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret, <br />                                     unsigned int flags)<br />
1097
 
</pre><p>Fetches an XML document describing attributes of the secret.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> secret</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document on success, NULL on failure. The caller must free() the XML.</td></tr></tbody></table></div><h3><a name="virSecretLookupByUUID" id="virSecretLookupByUUID"><code>virSecretLookupByUUID</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a>    virSecretLookupByUUID   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const unsigned char * uuid)<br />
 
1195
</pre><p>Fetches the value of a secret.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> connection</td></tr><tr><td><span class="term"><i><tt>value_size</tt></i>:</span></td><td>Place for storing size of the secret value</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the secret value on success, NULL on failure. The caller must free() the secret value.</td></tr></tbody></table></div><h3><a name="virSecretGetXMLDesc" id="virSecretGetXMLDesc"><code>virSecretGetXMLDesc</code></a></h3><pre class="programlisting">char * virSecretGetXMLDesc             (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret, <br />                                     unsigned int flags)<br />
 
1196
</pre><p>Fetches an XML document describing attributes of the secret.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> secret</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document on success, NULL on failure. The caller must free() the XML.</td></tr></tbody></table></div><h3><a name="virSecretLookupByUUID" id="virSecretLookupByUUID"><code>virSecretLookupByUUID</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a>      virSecretLookupByUUID   (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     const unsigned char * uuid)<br />
1098
1197
</pre><p>Try to lookup a secret on the given hypervisor based on its UUID. Uses the 16 bytes of raw data to describe the UUID</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>the raw UUID for the secret</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new secret object or NULL in case of failure. If the secret cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_SECRET">VIR_ERR_NO_SECRET</a> error is raised.</td></tr></tbody></table></div><h3><a name="virSecretLookupByUUIDString" id="virSecretLookupByUUIDString"><code>virSecretLookupByUUIDString</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> virSecretLookupByUUIDString     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * uuidstr)<br />
1099
1198
</pre><p>Try to lookup a secret on the given hypervisor based on its UUID. Uses the printable string value to describe the UUID</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>uuidstr</tt></i>:</span></td><td>the string UUID for the secret</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new secret object or NULL in case of failure. If the secret cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_SECRET">VIR_ERR_NO_SECRET</a> error is raised.</td></tr></tbody></table></div><h3><a name="virSecretLookupByUsage" id="virSecretLookupByUsage"><code>virSecretLookupByUsage</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a>        virSecretLookupByUsage  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     int usageType, <br />                                   const char * usageID)<br />
1100
1199
</pre><p>Try to lookup a secret on the given hypervisor based on its usage The usageID is unique within the set of secrets sharing the same usageType value.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the hypervisor connection</td></tr><tr><td><span class="term"><i><tt>usageType</tt></i>:</span></td><td>the type of secret usage</td></tr><tr><td><span class="term"><i><tt>usageID</tt></i>:</span></td><td>identifier of the object using the secret</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new secret object or NULL in case of failure. If the secret cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_SECRET">VIR_ERR_NO_SECRET</a> error is raised.</td></tr></tbody></table></div><h3><a name="virSecretRef" id="virSecretRef"><code>virSecretRef</code></a></h3><pre class="programlisting">int        virSecretRef                    (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
1101
1200
</pre><p>Increment the reference count on the secret. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virSecretFree">virSecretFree</a> 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 secret would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>the secret to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virSecretSetValue" id="virSecretSetValue"><code>virSecretSetValue</code></a></h3><pre class="programlisting">int     virSecretSetValue               (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret, <br />                                     const unsigned char * value, <br />                                     size_t value_size, <br />                                       unsigned int flags)<br />
1102
 
</pre><p>Sets the value of a secret.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> secret</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>Value of the secret</td></tr><tr><td><span class="term"><i><tt>value_size</tt></i>:</span></td><td>Size of the value</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure.</td></tr></tbody></table></div><h3><a name="virSecretUndefine" id="virSecretUndefine"><code>virSecretUndefine</code></a></h3><pre class="programlisting">int    virSecretUndefine               (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
 
1201
</pre><p>Sets the value of a secret.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> secret</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>Value of the secret</td></tr><tr><td><span class="term"><i><tt>value_size</tt></i>:</span></td><td>Size of the value</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure.</td></tr></tbody></table></div><h3><a name="virSecretUndefine" id="virSecretUndefine"><code>virSecretUndefine</code></a></h3><pre class="programlisting">int      virSecretUndefine               (<a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> secret)<br />
1103
1202
</pre><p>Deletes the specified secret. This does not free the associated <a href="libvirt-libvirt.html#virSecretPtr">virSecretPtr</a> object.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>secret</tt></i>:</span></td><td>A <a href="libvirt-libvirt.html#virSecret">virSecret</a> secret</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure.</td></tr></tbody></table></div><h3><a name="virStoragePoolBuild" id="virStoragePoolBuild"><code>virStoragePoolBuild</code></a></h3><pre class="programlisting">int   virStoragePoolBuild             (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned int flags)<br />
1104
 
</pre><p>Currently only filesystem pool accepts flags <a href="libvirt-libvirt.html#VIR_STORAGE_POOL_BUILD_OVERWRITE">VIR_STORAGE_POOL_BUILD_OVERWRITE</a> and <a href="libvirt-libvirt.html#VIR_STORAGE_POOL_BUILD_NO_OVERWRITE">VIR_STORAGE_POOL_BUILD_NO_OVERWRITE</a>. Build the underlying storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags to control pool build behaviour</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 upon failure</td></tr></tbody></table></div><h3><a name="virStoragePoolCreate" id="virStoragePoolCreate"><code>virStoragePoolCreate</code></a></h3><pre class="programlisting">int       virStoragePoolCreate            (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned int flags)<br />
1105
 
</pre><p>Starts an inactive storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 if it could not be started</td></tr></tbody></table></div><h3><a name="virStoragePoolCreateXML" id="virStoragePoolCreateXML"><code>virStoragePoolCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>   virStoragePoolCreateXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * xmlDesc, <br />                                            unsigned int flags)<br />
1106
 
</pre><p>Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>XML description for new pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if creation failed</td></tr></tbody></table></div><h3><a name="virStoragePoolDefineXML" id="virStoragePoolDefineXML"><code>virStoragePoolDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>  virStoragePoolDefineXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * xml, <br />                                                unsigned int flags)<br />
1107
 
</pre><p>Define a new inactive storage pool based on its XML description. The pool is persistent, until explicitly undefined.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>XML description for new pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if creation failed</td></tr></tbody></table></div><h3><a name="virStoragePoolDelete" id="virStoragePoolDelete"><code>virStoragePoolDelete</code></a></h3><pre class="programlisting">int       virStoragePoolDelete            (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned int flags)<br />
1108
 
</pre><p>Delete the underlying pool resources. This is a non-recoverable operation. The <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object itself is not free'd.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for obliteration process</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 if it could not be obliterate</td></tr></tbody></table></div><h3><a name="virStoragePoolDestroy" id="virStoragePoolDestroy"><code>virStoragePoolDestroy</code></a></h3><pre class="programlisting">int   virStoragePoolDestroy           (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
 
1203
</pre><p>Currently only filesystem pool accepts flags <a href="libvirt-libvirt.html#VIR_STORAGE_POOL_BUILD_OVERWRITE">VIR_STORAGE_POOL_BUILD_OVERWRITE</a> and <a href="libvirt-libvirt.html#VIR_STORAGE_POOL_BUILD_NO_OVERWRITE">VIR_STORAGE_POOL_BUILD_NO_OVERWRITE</a>. Build the underlying storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virStoragePoolBuildFlags">virStoragePoolBuildFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 upon failure</td></tr></tbody></table></div><h3><a name="virStoragePoolCreate" id="virStoragePoolCreate"><code>virStoragePoolCreate</code></a></h3><pre class="programlisting">int  virStoragePoolCreate            (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned int flags)<br />
 
1204
</pre><p>Starts an inactive storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 if it could not be started</td></tr></tbody></table></div><h3><a name="virStoragePoolCreateXML" id="virStoragePoolCreateXML"><code>virStoragePoolCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>    virStoragePoolCreateXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * xmlDesc, <br />                                            unsigned int flags)<br />
 
1205
</pre><p>Create a new storage based on its XML description. The pool is not persistent, so its definition will disappear when it is destroyed, or if the host is restarted</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xmlDesc</tt></i>:</span></td><td>XML description for new pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if creation failed</td></tr></tbody></table></div><h3><a name="virStoragePoolDefineXML" id="virStoragePoolDefineXML"><code>virStoragePoolDefineXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>   virStoragePoolDefineXML (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                             const char * xml, <br />                                                unsigned int flags)<br />
 
1206
</pre><p>Define a new inactive storage pool based on its XML description. The pool is persistent, until explicitly undefined.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>xml</tt></i>:</span></td><td>XML description for new pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if creation failed</td></tr></tbody></table></div><h3><a name="virStoragePoolDelete" id="virStoragePoolDelete"><code>virStoragePoolDelete</code></a></h3><pre class="programlisting">int        virStoragePoolDelete            (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned int flags)<br />
 
1207
</pre><p>Delete the underlying pool resources. This is a non-recoverable operation. The <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object itself is not free'd.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virStoragePoolDeleteFlags">virStoragePoolDeleteFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 if it could not be obliterate</td></tr></tbody></table></div><h3><a name="virStoragePoolDestroy" id="virStoragePoolDestroy"><code>virStoragePoolDestroy</code></a></h3><pre class="programlisting">int     virStoragePoolDestroy           (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1109
1208
</pre><p>Destroy an active storage pool. This will deactivate the pool on the host, but keep any persistent config associated with it. If it has a persistent config it can later be restarted with <a href="libvirt-libvirt.html#virStoragePoolCreate">virStoragePoolCreate</a>(). This does not free the associated <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 if it could not be destroyed</td></tr></tbody></table></div><h3><a name="virStoragePoolFree" id="virStoragePoolFree"><code>virStoragePoolFree</code></a></h3><pre class="programlisting">int     virStoragePoolFree              (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1110
1209
</pre><p>Free a storage pool object, releasing all memory associated with it. Does not change the state of the pool on the host.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 if it could not be free'd.</td></tr></tbody></table></div><h3><a name="virStoragePoolGetAutostart" id="virStoragePoolGetAutostart"><code>virStoragePoolGetAutostart</code></a></h3><pre class="programlisting">int   virStoragePoolGetAutostart      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     int * autostart)<br />
1111
1210
</pre><p>Fetches the value of the autostart flag, which determines whether the pool is automatically started at boot time</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>autostart</tt></i>:</span></td><td>location in which to store autostart flag</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolGetConnect" id="virStoragePoolGetConnect"><code>virStoragePoolGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>        virStoragePoolGetConnect        (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1114
1213
</pre><p>Fetch the locally unique name of the storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the name of the pool, or NULL on error</td></tr></tbody></table></div><h3><a name="virStoragePoolGetUUID" id="virStoragePoolGetUUID"><code>virStoragePoolGetUUID</code></a></h3><pre class="programlisting">int        virStoragePoolGetUUID           (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned char * uuid)<br />
1115
1214
</pre><p>Fetch the globally unique ID of the storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>uuid</tt></i>:</span></td><td>buffer of <a href="libvirt-libvirt.html#VIR_UUID_BUFLEN">VIR_UUID_BUFLEN</a> bytes in size</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error;</td></tr></tbody></table></div><h3><a name="virStoragePoolGetUUIDString" id="virStoragePoolGetUUIDString"><code>virStoragePoolGetUUIDString</code></a></h3><pre class="programlisting">int    virStoragePoolGetUUIDString     (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     char * buf)<br />
1116
1215
</pre><p>Fetch the globally unique ID of the storage pool as a string</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>buffer of <a href="libvirt-libvirt.html#VIR_UUID_STRING_BUFLEN">VIR_UUID_STRING_BUFLEN</a> bytes in size</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error;</td></tr></tbody></table></div><h3><a name="virStoragePoolGetXMLDesc" id="virStoragePoolGetXMLDesc"><code>virStoragePoolGetXMLDesc</code></a></h3><pre class="programlisting">char * virStoragePoolGetXMLDesc        (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned int flags)<br />
1117
 
</pre><p>Fetch an XML document describing all aspects of the storage pool. This is suitable for later feeding back into the <a href="libvirt-libvirt.html#virStoragePoolCreateXML">virStoragePoolCreateXML</a> method.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for XML format options (set of <a href="libvirt-libvirt.html#virDomainXMLFlags">virDomainXMLFlags</a>)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virStoragePoolIsActive" id="virStoragePoolIsActive"><code>virStoragePoolIsActive</code></a></h3><pre class="programlisting">int        virStoragePoolIsActive          (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
 
1216
</pre><p>Fetch an XML document describing all aspects of the storage pool. This is suitable for later feeding back into the <a href="libvirt-libvirt.html#virStoragePoolCreateXML">virStoragePoolCreateXML</a> method.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virDomainXMLFlags">virDomainXMLFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virStoragePoolIsActive" id="virStoragePoolIsActive"><code>virStoragePoolIsActive</code></a></h3><pre class="programlisting">int        virStoragePoolIsActive          (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1118
1217
</pre><p>Determine if the storage pool is currently running</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to the storage pool object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if running, 0 if inactive, -1 on error</td></tr></tbody></table></div><h3><a name="virStoragePoolIsPersistent" id="virStoragePoolIsPersistent"><code>virStoragePoolIsPersistent</code></a></h3><pre class="programlisting">int   virStoragePoolIsPersistent      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1119
1218
</pre><p>Determine if the storage pool has a persistent configuration which means it will still exist after shutting down</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to the storage pool object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if persistent, 0 if transient, -1 on error</td></tr></tbody></table></div><h3><a name="virStoragePoolListVolumes" id="virStoragePoolListVolumes"><code>virStoragePoolListVolumes</code></a></h3><pre class="programlisting">int    virStoragePoolListVolumes       (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     char ** const names, <br />                                     int maxnames)<br />
1120
1219
</pre><p>Fetch list of storage volume names, limiting to at most maxnames.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>names</tt></i>:</span></td><td>array in which to storage volume names</td></tr><tr><td><span class="term"><i><tt>maxnames</tt></i>:</span></td><td>size of names array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of names fetched, or -1 on error</td></tr></tbody></table></div><h3><a name="virStoragePoolLookupByName" id="virStoragePoolLookupByName"><code>virStoragePoolLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a>       virStoragePoolLookupByName      (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     const char * name)<br />
1124
1223
</pre><p>Fetch a storage pool which contains a particular volume</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a <a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> object, or NULL if no matching pool is found</td></tr></tbody></table></div><h3><a name="virStoragePoolNumOfVolumes" id="virStoragePoolNumOfVolumes"><code>virStoragePoolNumOfVolumes</code></a></h3><pre class="programlisting">int   virStoragePoolNumOfVolumes      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1125
1224
</pre><p>Fetch the number of storage volumes within a pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of storage pools, or -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolRef" id="virStoragePoolRef"><code>virStoragePoolRef</code></a></h3><pre class="programlisting">int     virStoragePoolRef               (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1126
1225
</pre><p>Increment the reference count on the pool. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStoragePoolFree">virStoragePoolFree</a> 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 pool would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>the pool to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virStoragePoolRefresh" id="virStoragePoolRefresh"><code>virStoragePoolRefresh</code></a></h3><pre class="programlisting">int       virStoragePoolRefresh           (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     unsigned int flags)<br />
1127
 
</pre><p>Request that the pool refresh its list of volumes. This may involve communicating with a remote server, and/or initializing new devices at the OS layer</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags to control refresh behaviour (currently unused, use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the volume list was refreshed, -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolSetAutostart" id="virStoragePoolSetAutostart"><code>virStoragePoolSetAutostart</code></a></h3><pre class="programlisting">int virStoragePoolSetAutostart      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     int autostart)<br />
 
1226
</pre><p>Request that the pool refresh its list of volumes. This may involve communicating with a remote server, and/or initializing new devices at the OS layer</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the volume list was refreshed, -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolSetAutostart" id="virStoragePoolSetAutostart"><code>virStoragePoolSetAutostart</code></a></h3><pre class="programlisting">int   virStoragePoolSetAutostart      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                     int autostart)<br />
1128
1227
</pre><p>Sets the autostart flag</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>autostart</tt></i>:</span></td><td>new flag setting</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virStoragePoolUndefine" id="virStoragePoolUndefine"><code>virStoragePoolUndefine</code></a></h3><pre class="programlisting">int   virStoragePoolUndefine          (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool)<br />
1129
1228
</pre><p>Undefine an inactive storage pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 on failure</td></tr></tbody></table></div><h3><a name="virStorageVolCreateXML" id="virStorageVolCreateXML"><code>virStorageVolCreateXML</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>       virStorageVolCreateXML  (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                             const char * xmldesc, <br />                                            unsigned int flags)<br />
1130
 
</pre><p>Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>xmldesc</tt></i>:</span></td><td>description of volume to create</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for creation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the storage volume, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolCreateXMLFrom" id="virStorageVolCreateXMLFrom"><code>virStorageVolCreateXMLFrom</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>     virStorageVolCreateXMLFrom      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                                     const char * xmldesc, <br />                                                    <a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> clonevol, <br />                                                   unsigned int flags)<br />
1131
 
</pre><p>Create a storage volume in the parent pool, using the 'clonevol' volume as input. Information for the new volume (name, perms) are passed via a typical volume XML description.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to parent pool for the new volume</td></tr><tr><td><span class="term"><i><tt>xmldesc</tt></i>:</span></td><td>description of volume to create</td></tr><tr><td><span class="term"><i><tt>clonevol</tt></i>:</span></td><td>storage volume to use as input</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for creation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the storage volume, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolDelete" id="virStorageVolDelete"><code>virStorageVolDelete</code></a></h3><pre class="programlisting">int  virStorageVolDelete             (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int flags)<br />
1132
 
</pre><p>Delete the storage volume from the pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStorageVolDownload" id="virStorageVolDownload"><code>virStorageVolDownload</code></a></h3><pre class="programlisting">int     virStorageVolDownload           (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     unsigned long long offset, <br />                                       unsigned long long length, <br />                                       unsigned int flags)<br />
1133
 
</pre><p>Download the content of the volume as a stream. If @length is zero, then the remaining contents of the volume after @offset will be downloaded. This call sets up an asynchronous stream; subsequent use of stream APIs is necessary to transfer the actual data, determine how much data is successfully transferred, and detect any errors. The results will be unpredictable if another active stream is writing to the storage volume.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to volume to download from</td></tr><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>stream to use as output</td></tr><tr><td><span class="term"><i><tt>offset</tt></i>:</span></td><td>position in @vol to start reading from</td></tr><tr><td><span class="term"><i><tt>length</tt></i>:</span></td><td>limit on amount of data to download</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0, or -1 upon error.</td></tr></tbody></table></div><h3><a name="virStorageVolFree" id="virStorageVolFree"><code>virStorageVolFree</code></a></h3><pre class="programlisting">int       virStorageVolFree               (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
 
1229
</pre><p>Create a storage volume within a pool based on an XML description. Not all pools support creation of volumes</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>xmldesc</tt></i>:</span></td><td>description of volume to create</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the storage volume, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolCreateXMLFrom" id="virStorageVolCreateXMLFrom"><code>virStorageVolCreateXMLFrom</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>      virStorageVolCreateXMLFrom      (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                                     const char * xmldesc, <br />                                                    <a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> clonevol, <br />                                                   unsigned int flags)<br />
 
1230
</pre><p>Create a storage volume in the parent pool, using the 'clonevol' volume as input. Information for the new volume (name, perms) are passed via a typical volume XML description.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to parent pool for the new volume</td></tr><tr><td><span class="term"><i><tt>xmldesc</tt></i>:</span></td><td>description of volume to create</td></tr><tr><td><span class="term"><i><tt>clonevol</tt></i>:</span></td><td>storage volume to use as input</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the storage volume, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolDelete" id="virStorageVolDelete"><code>virStorageVolDelete</code></a></h3><pre class="programlisting">int   virStorageVolDelete             (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int flags)<br />
 
1231
</pre><p>Delete the storage volume from the pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStorageVolDownload" id="virStorageVolDownload"><code>virStorageVolDownload</code></a></h3><pre class="programlisting">int      virStorageVolDownload           (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     unsigned long long offset, <br />                                       unsigned long long length, <br />                                       unsigned int flags)<br />
 
1232
</pre><p>Download the content of the volume as a stream. If @length is zero, then the remaining contents of the volume after @offset will be downloaded. This call sets up an asynchronous stream; subsequent use of stream APIs is necessary to transfer the actual data, determine how much data is successfully transferred, and detect any errors. The results will be unpredictable if another active stream is writing to the storage volume.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to volume to download from</td></tr><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>stream to use as output</td></tr><tr><td><span class="term"><i><tt>offset</tt></i>:</span></td><td>position in @vol to start reading from</td></tr><tr><td><span class="term"><i><tt>length</tt></i>:</span></td><td>limit on amount of data to download</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0, or -1 upon error.</td></tr></tbody></table></div><h3><a name="virStorageVolFree" id="virStorageVolFree"><code>virStorageVolFree</code></a></h3><pre class="programlisting">int  virStorageVolFree               (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
1134
1233
</pre><p>Release the storage volume handle. The underlying storage volume continues to exist.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStorageVolGetConnect" id="virStorageVolGetConnect"><code>virStorageVolGetConnect</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>     virStorageVolGetConnect (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
1135
1234
</pre><p>Provides the connection pointer associated with a storage volume. The reference counter on the connection is not increased by this call. WARNING: When writing libvirt bindings in other languages, do not use this function. Instead, store the connection and the volume object together.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to a pool</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> or NULL in case of failure.</td></tr></tbody></table></div><h3><a name="virStorageVolGetInfo" id="virStorageVolGetInfo"><code>virStorageVolGetInfo</code></a></h3><pre class="programlisting">int        virStorageVolGetInfo            (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        <a href="libvirt-libvirt.html#virStorageVolInfoPtr">virStorageVolInfoPtr</a> info)<br />
1136
1235
</pre><p>Fetches volatile information about the storage volume such as its current allocation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>info</tt></i>:</span></td><td>pointer at which to store info</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on failure</td></tr></tbody></table></div><h3><a name="virStorageVolGetKey" id="virStorageVolGetKey"><code>virStorageVolGetKey</code></a></h3><pre class="programlisting">const char * virStorageVolGetKey     (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
1137
1236
</pre><p>Fetch the storage volume key. This is globally unique, so the same volume will have the same key no matter what host it is accessed from</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the volume key, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolGetName" id="virStorageVolGetName"><code>virStorageVolGetName</code></a></h3><pre class="programlisting">const char *        virStorageVolGetName    (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
1138
1237
</pre><p>Fetch the storage volume name. This is unique within the scope of a pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the volume name, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolGetPath" id="virStorageVolGetPath"><code>virStorageVolGetPath</code></a></h3><pre class="programlisting">char *     virStorageVolGetPath            (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
1139
1238
</pre><p>Fetch the storage volume path. Depending on the pool configuration this is either persistent across hosts, or dynamically assigned at pool startup. Consult pool documentation for information on getting the persistent naming</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the storage volume path, or NULL on error. The caller must free() the returned path after use.</td></tr></tbody></table></div><h3><a name="virStorageVolGetXMLDesc" id="virStorageVolGetXMLDesc"><code>virStorageVolGetXMLDesc</code></a></h3><pre class="programlisting">char *        virStorageVolGetXMLDesc         (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int flags)<br />
1140
 
</pre><p>Fetch an XML document describing all aspects of the storage volume</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for XML generation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolLookupByKey" id="virStorageVolLookupByKey"><code>virStorageVolLookupByKey</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>    virStorageVolLookupByKey        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     const char * key)<br />
 
1239
</pre><p>Fetch an XML document describing all aspects of the storage volume</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the XML document, or NULL on error</td></tr></tbody></table></div><h3><a name="virStorageVolLookupByKey" id="virStorageVolLookupByKey"><code>virStorageVolLookupByKey</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>   virStorageVolLookupByKey        (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     const char * key)<br />
1141
1240
</pre><p>Fetch a pointer to a storage volume based on its globally unique key</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>key</tt></i>:</span></td><td>globally unique key</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div><h3><a name="virStorageVolLookupByName" id="virStorageVolLookupByName"><code>virStorageVolLookupByName</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a>   virStorageVolLookupByName       (<a href="libvirt-libvirt.html#virStoragePoolPtr">virStoragePoolPtr</a> pool, <br />                                                     const char * name)<br />
1142
1241
</pre><p>Fetch a pointer to a storage volume based on its name within a pool</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>pool</tt></i>:</span></td><td>pointer to storage pool</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>name of storage volume</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div><h3><a name="virStorageVolLookupByPath" id="virStorageVolLookupByPath"><code>virStorageVolLookupByPath</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> virStorageVolLookupByPath       (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                                     const char * path)<br />
1143
1242
</pre><p>Fetch a pointer to a storage volume based on its locally (host) unique path</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to hypervisor connection</td></tr><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>locally unique path</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a storage volume, or NULL if not found / error</td></tr></tbody></table></div><h3><a name="virStorageVolRef" id="virStorageVolRef"><code>virStorageVolRef</code></a></h3><pre class="programlisting">int       virStorageVolRef                (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol)<br />
1144
 
</pre><p>Increment the reference count on the vol. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStorageVolFree">virStorageVolFree</a> 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 vol would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>the vol to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virStorageVolUpload" id="virStorageVolUpload"><code>virStorageVolUpload</code></a></h3><pre class="programlisting">int   virStorageVolUpload             (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     unsigned long long offset, <br />                                       unsigned long long length, <br />                                       unsigned int flags)<br />
1145
 
</pre><p>Upload new content to the volume from a stream. This call will fail if @offset + @length exceeds the size of the volume. Otherwise, if @length is non-zero, an error will be raised if an attempt is made to upload greater than @length bytes of data. This call sets up an asynchronous stream; subsequent use of stream APIs is necessary to transfer the actual data, determine how much data is successfully transferred, and detect any errors. The results will be unpredictable if another active stream is writing to the storage volume.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to volume to upload</td></tr><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>stream to use as input</td></tr><tr><td><span class="term"><i><tt>offset</tt></i>:</span></td><td>position to start writing to</td></tr><tr><td><span class="term"><i><tt>length</tt></i>:</span></td><td>limit on amount of data to upload</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>flags for creation (unused, pass 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0, or -1 upon error.</td></tr></tbody></table></div><h3><a name="virStorageVolWipe" id="virStorageVolWipe"><code>virStorageVolWipe</code></a></h3><pre class="programlisting">int     virStorageVolWipe               (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int flags)<br />
1146
 
</pre><p>Ensure data previously on a volume is not accessible to future reads</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStreamAbort" id="virStreamAbort"><code>virStreamAbort</code></a></h3><pre class="programlisting">int     virStreamAbort                  (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream)<br />
 
1243
</pre><p>Increment the reference count on the vol. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStorageVolFree">virStorageVolFree</a> 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 vol would increment the reference count.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>the vol to hold a reference on</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure.</td></tr></tbody></table></div><h3><a name="virStorageVolResize" id="virStorageVolResize"><code>virStorageVolResize</code></a></h3><pre class="programlisting">int   virStorageVolResize             (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned long long capacity, <br />                                     unsigned int flags)<br />
 
1244
</pre><p>Changes the capacity of the storage volume @vol to @capacity. The operation will fail if the new capacity requires allocation that would exceed the remaining free space in the parent pool. The contents of the new capacity will appear as all zero bytes. Normally, the operation will attempt to affect capacity with a minimum impact on allocation (that is, the default operation favors a sparse resize). If @flags contains <a href="libvirt-libvirt.html#VIR_STORAGE_VOL_RESIZE_ALLOCATE">VIR_STORAGE_VOL_RESIZE_ALLOCATE</a>, then the operation will ensure that allocation is sufficient for the new capacity; this may make the operation take noticeably longer. Normally, the operation treats @capacity as the new size in bytes; but if @flags contains <a href="libvirt-libvirt.html#VIR_STORAGE_VOL_RESIZE_DELTA">VIR_STORAGE_VOL_RESIZE_DELTA</a>, then @capacity represents the size difference to add to the current size. It is up to the storage pool implementation whether unaligned requests are rounded up to the next valid boundary, or rejected. Normally, this operation should only be used to enlarge capacity; but if @flags contains <a href="libvirt-libvirt.html#VIR_STORAGE_VOL_RESIZE_SHRINK">VIR_STORAGE_VOL_RESIZE_SHRINK</a>, it is possible to attempt a reduction in capacity even though it might cause data loss. If <a href="libvirt-libvirt.html#VIR_STORAGE_VOL_RESIZE_DELTA">VIR_STORAGE_VOL_RESIZE_DELTA</a> is also present, then @capacity is subtracted from the current size; without it, @capacity represents the absolute new size regardless of whether it is larger or smaller than the current size.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>capacity</tt></i>:</span></td><td>new capacity, in bytes</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virStorageVolResizeFlags">virStorageVolResizeFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error.</td></tr></tbody></table></div><h3><a name="virStorageVolUpload" id="virStorageVolUpload"><code>virStorageVolUpload</code></a></h3><pre class="programlisting">int    virStorageVolUpload             (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     unsigned long long offset, <br />                                       unsigned long long length, <br />                                       unsigned int flags)<br />
 
1245
</pre><p>Upload new content to the volume from a stream. This call will fail if @offset + @length exceeds the size of the volume. Otherwise, if @length is non-zero, an error will be raised if an attempt is made to upload greater than @length bytes of data. This call sets up an asynchronous stream; subsequent use of stream APIs is necessary to transfer the actual data, determine how much data is successfully transferred, and detect any errors. The results will be unpredictable if another active stream is writing to the storage volume.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to volume to upload</td></tr><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>stream to use as input</td></tr><tr><td><span class="term"><i><tt>offset</tt></i>:</span></td><td>position to start writing to</td></tr><tr><td><span class="term"><i><tt>length</tt></i>:</span></td><td>limit on amount of data to upload</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0, or -1 upon error.</td></tr></tbody></table></div><h3><a name="virStorageVolWipe" id="virStorageVolWipe"><code>virStorageVolWipe</code></a></h3><pre class="programlisting">int      virStorageVolWipe               (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int flags)<br />
 
1246
</pre><p>Ensure data previously on a volume is not accessible to future reads</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>extra flags; not used yet, so callers should always pass 0</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStorageVolWipePattern" id="virStorageVolWipePattern"><code>virStorageVolWipePattern</code></a></h3><pre class="programlisting">int        virStorageVolWipePattern        (<a href="libvirt-libvirt.html#virStorageVolPtr">virStorageVolPtr</a> vol, <br />                                        unsigned int algorithm, <br />                                  unsigned int flags)<br />
 
1247
</pre><p>Similar to <a href="libvirt-libvirt.html#virStorageVolWipe">virStorageVolWipe</a>, but one can choose between different wiping algorithms.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>vol</tt></i>:</span></td><td>pointer to storage volume</td></tr><tr><td><span class="term"><i><tt>algorithm</tt></i>:</span></td><td>one of <a href="libvirt-libvirt.html#virStorageVolWipeAlgorithm">virStorageVolWipeAlgorithm</a></td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>future flags, use 0 for now</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, or -1 on error.</td></tr></tbody></table></div><h3><a name="virStreamAbort" id="virStreamAbort"><code>virStreamAbort</code></a></h3><pre class="programlisting">int        virStreamAbort                  (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream)<br />
1147
1248
</pre><p>Request that the in progress data transfer be cancelled abnormally before the end of the stream has been reached. For output streams this can be used to inform the driver that the stream is being terminated early. For input streams this can be used to inform the driver that it should stop sending data.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 upon error</td></tr></tbody></table></div><h3><a name="virStreamEventAddCallback" id="virStreamEventAddCallback"><code>virStreamEventAddCallback</code></a></h3><pre class="programlisting">int  virStreamEventAddCallback       (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     int events, <br />                                      <a href="libvirt-libvirt.html#virStreamEventCallback">virStreamEventCallback</a> cb, <br />                                     void * opaque, <br />                                   <a href="libvirt-libvirt.html#virFreeCallback">virFreeCallback</a> ff)<br />
1148
1249
</pre><p>Register a callback to be notified when a stream becomes writable, or readable. This is most commonly used in conjunction with non-blocking data streams to integrate into an event loop</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream object</td></tr><tr><td><span class="term"><i><tt>events</tt></i>:</span></td><td>set of events to monitor</td></tr><tr><td><span class="term"><i><tt>cb</tt></i>:</span></td><td>callback to invoke when an event occurs</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application defined data</td></tr><tr><td><span class="term"><i><tt>ff</tt></i>:</span></td><td>callback to free @opaque data</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 upon error</td></tr></tbody></table></div><h3><a name="virStreamEventCallback" id="virStreamEventCallback"><code>virStreamEventCallback</code></a></h3><pre class="programlisting">typedef void     (*virStreamEventCallback        )       (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     int events, <br />                                      void * opaque)
1149
1250
</pre><p>Callback for receiving stream events. The callback will be invoked once for each event which is pending.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>stream on which the event occurred</td></tr><tr><td><span class="term"><i><tt>events</tt></i>:</span></td><td>bitset of events from <a href="libvirt-libvirt.html#virEventHandleType">virEventHandleType</a> constants</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>user data registered with handle</td></tr></tbody></table></div><br /><h3><a name="virStreamEventRemoveCallback" id="virStreamEventRemoveCallback"><code>virStreamEventRemoveCallback</code></a></h3><pre class="programlisting">int    virStreamEventRemoveCallback    (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream)<br />
1151
1252
</pre><p>Changes the set of events to monitor for a stream. This allows for event notification to be changed without having to unregister &amp; register the callback completely. This method is guaranteed to succeed if a callback is already registered</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream object</td></tr><tr><td><span class="term"><i><tt>events</tt></i>:</span></td><td>set of events to monitor</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 if no callback is registered</td></tr></tbody></table></div><h3><a name="virStreamFinish" id="virStreamFinish"><code>virStreamFinish</code></a></h3><pre class="programlisting">int        virStreamFinish                 (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream)<br />
1152
1253
</pre><p>Indicate that there is no further data is to be transmitted on the stream. For output streams this should be called once all data has been written. For input streams this should be called once <a href="libvirt-libvirt.html#virStreamRecv">virStreamRecv</a> returns end-of-file. This method is a synchronization point for all asynchronous errors, so if this returns a success code the application can be sure that all data has been successfully processed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 on success, -1 upon error</td></tr></tbody></table></div><h3><a name="virStreamFree" id="virStreamFree"><code>virStreamFree</code></a></h3><pre class="programlisting">int        virStreamFree                   (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream)<br />
1153
1254
</pre><p>Decrement the reference count on a stream, releasing the stream object if the reference count has hit zero. There must not be an active data transfer in progress when releasing the stream. If a stream needs to be disposed of prior to end of stream being reached, then the <a href="libvirt-libvirt.html#virStreamAbort">virStreamAbort</a> function should be called first.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream object</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 upon success, or -1 on error</td></tr></tbody></table></div><h3><a name="virStreamNew" id="virStreamNew"><code>virStreamNew</code></a></h3><pre class="programlisting"><a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a>   virStreamNew            (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br />                                     unsigned int flags)<br />
1154
 
</pre><p>Creates a new stream object which can be used to perform streamed I/O with other public API function. When no longer needed, a stream object must be released with <a href="libvirt-libvirt.html#virStreamFree">virStreamFree</a>. If a data stream has been used, then the application must call <a href="libvirt-libvirt.html#virStreamFinish">virStreamFinish</a> or <a href="libvirt-libvirt.html#virStreamAbort">virStreamAbort</a> before free'ing to, in order to notify the driver of termination. If a non-blocking data stream is required passed <a href="libvirt-libvirt.html#VIR_STREAM_NONBLOCK">VIR_STREAM_NONBLOCK</a> for flags, otherwise pass 0.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>control features of the stream</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new stream, or NULL upon error</td></tr></tbody></table></div><h3><a name="virStreamRecv" id="virStreamRecv"><code>virStreamRecv</code></a></h3><pre class="programlisting">int       virStreamRecv                   (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     char * data, <br />                                     size_t nbytes)<br />
 
1255
</pre><p>Creates a new stream object which can be used to perform streamed I/O with other public API function. When no longer needed, a stream object must be released with <a href="libvirt-libvirt.html#virStreamFree">virStreamFree</a>. If a data stream has been used, then the application must call <a href="libvirt-libvirt.html#virStreamFinish">virStreamFinish</a> or <a href="libvirt-libvirt.html#virStreamAbort">virStreamAbort</a> before free'ing to, in order to notify the driver of termination. If a non-blocking data stream is required passed <a href="libvirt-libvirt.html#VIR_STREAM_NONBLOCK">VIR_STREAM_NONBLOCK</a> for flags, otherwise pass 0.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conn</tt></i>:</span></td><td>pointer to the connection</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>bitwise-OR of <a href="libvirt-libvirt.html#virStreamFlags">virStreamFlags</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new stream, or NULL upon error</td></tr></tbody></table></div><h3><a name="virStreamRecv" id="virStreamRecv"><code>virStreamRecv</code></a></h3><pre class="programlisting">int       virStreamRecv                   (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     char * data, <br />                                     size_t nbytes)<br />
1155
1256
</pre><p>Reads a series of bytes from the stream. This method may block the calling application for an arbitrary amount of time. Errors are not guaranteed to be reported synchronously with the call, but may instead be delayed until a subsequent call. An example using this with a hypothetical file download API looks like <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> st = virStreamNew(conn, 0); int fd = open("demo.iso", O_WRONLY, 0600) virConnectDownloadFile(conn, "demo.iso", st); while (1) { char buf[1024]; int got = virStreamRecv(st, buf, 1024); if (got &lt; 0) break; if (got == 0) { virStreamFinish(st); break; } int offset = 0; while (offset &lt; got) { int sent = write(fd, buf+offset, got-offset) if (sent &lt; 0) { virStreamAbort(st); goto done; } offset += sent; } } if (virStreamFinish(st) &lt; 0) ... report an error .... done: virStreamFree(st); close(fd);</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream object</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>buffer to read into from stream</td></tr><tr><td><span class="term"><i><tt>nbytes</tt></i>:</span></td><td>size of @data buffer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes read, which may be less than requested. Returns 0 when the end of the stream is reached, at which time the caller should invoke <a href="libvirt-libvirt.html#virStreamFinish">virStreamFinish</a>() to get confirmation of stream completion. Returns -1 upon error, at which time the stream will be marked as aborted, and the caller should now release the stream with <a href="libvirt-libvirt.html#virStreamFree">virStreamFree</a>. Returns -2 if there is no data pending to be read &amp; the stream is marked as non-blocking.</td></tr></tbody></table></div><h3><a name="virStreamRecvAll" id="virStreamRecvAll"><code>virStreamRecvAll</code></a></h3><pre class="programlisting">int   virStreamRecvAll                (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     <a href="libvirt-libvirt.html#virStreamSinkFunc">virStreamSinkFunc</a> handler, <br />                                  void * opaque)<br />
1156
1257
</pre><p>Receive the entire data stream, sending the data to the requested data sink. This is simply a convenient alternative to <a href="libvirt-libvirt.html#virStreamRecv">virStreamRecv</a>, for apps that do blocking-I/o. An example using this with a hypothetical file download API looks like int mysink(virStreamPtr st, const char *buf, int nbytes, void *opaque) { int *fd = opaque; return write(*fd, buf, nbytes); } <a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> st = virStreamNew(conn, 0); int fd = open("demo.iso", O_WRONLY) virConnectUploadFile(conn, st); if (virStreamRecvAll(st, mysink, &amp;fd) &lt; 0) { ...report an error ... goto done; } if (virStreamFinish(st) &lt; 0) ...report an error... virStreamFree(st); close(fd);</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream object</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>sink callback for writing data to application</td></tr><tr><td><span class="term"><i><tt>opaque</tt></i>:</span></td><td>application defined data</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if all the data was successfully received. The caller should invoke virStreamFinish(st) to flush the stream upon success and then <a href="libvirt-libvirt.html#virStreamFree">virStreamFree</a> Returns -1 upon any error, with <a href="libvirt-libvirt.html#virStreamAbort">virStreamAbort</a>() already having been called, so the caller need only call <a href="libvirt-libvirt.html#virStreamFree">virStreamFree</a>()</td></tr></tbody></table></div><h3><a name="virStreamRef" id="virStreamRef"><code>virStreamRef</code></a></h3><pre class="programlisting">int   virStreamRef                    (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream)<br />
1157
1258
</pre><p>Increment the reference count on the stream. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt.html#virStreamFree">virStreamFree</a> to release the reference count, once the caller no longer needs the reference to this object.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>stream</tt></i>:</span></td><td>pointer to the stream</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of failure</td></tr></tbody></table></div><h3><a name="virStreamSend" id="virStreamSend"><code>virStreamSend</code></a></h3><pre class="programlisting">int   virStreamSend                   (<a href="libvirt-libvirt.html#virStreamPtr">virStreamPtr</a> stream, <br />                                     const char * data, <br />                                       size_t nbytes)<br />