File: libvirt-libvirt-common.html

package info (click to toggle)
libvirt 3.0.0-4%2Bdeb9u4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 221,536 kB
  • sloc: ansic: 536,027; xml: 118,597; sh: 9,608; makefile: 5,399; perl: 3,888; python: 3,838; ml: 468; sed: 16
file content (109 lines) | stat: -rw-r--r-- 45,188 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!--
        This file is autogenerated from html/libvirt-libvirt-common.html.in
        Do not edit this file. Changes will be lost.
      --><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="../main.css" /><link rel="SHORTCUT ICON" href="../32favicon.png" /><title>libvirt: Module libvirt-common from libvirt</title><meta name="description" content="libvirt, virtualization, virtualization API" /></head><body><div id="body"><div id="content"><h1>Module libvirt-common from libvirt</h1><p>Provides common macros and enums needed by both libvirt and libvirt-admin libraries</p><h2>Table of Contents</h2><h3><a href="#macros">Macros</a></h3><pre class="api"><span class="directive">#define</span> <a href="#LIBVIR_CHECK_VERSION">LIBVIR_CHECK_VERSION</a>
<span class="directive">#define</span> <a href="#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a>
<span class="directive">#define</span> <a href="#VIR_TYPED_PARAM_FIELD_LENGTH">VIR_TYPED_PARAM_FIELD_LENGTH</a>
</pre><h3><a href="#types">Types</a></h3><pre class="api"><span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virConnectCloseReason">virConnectCloseReason</a>
<span class="keyword">typedef</span> <span class="type">struct _virTypedParameter</span> <a href="#virTypedParameter">virTypedParameter</a>
<span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virTypedParameterFlags">virTypedParameterFlags</a>
<span class="keyword">typedef</span> <span class="type"><a href="libvirt-libvirt-common.html#virTypedParameter">virTypedParameter</a> *</span> <a name="virTypedParameterPtr" id="virTypedParameterPtr">virTypedParameterPtr</a>
<span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virTypedParameterType">virTypedParameterType</a>
</pre><h3><a href="#functions">Functions</a></h3><pre class="api"><span class="keyword">typedef</span> <a href="#virFreeCallback">virFreeCallback</a>
<span class="type">void</span>	<a href="#virFreeCallback">virFreeCallback</a>			(<span class="type">void *</span> opaque)

<span class="type">int</span>	<a href="#virTypedParamsAddBoolean">virTypedParamsAddBoolean</a>	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">int</span> value)
<span class="type">int</span>	<a href="#virTypedParamsAddDouble">virTypedParamsAddDouble</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">double</span> value)
<span class="type">int</span>	<a href="#virTypedParamsAddFromString">virTypedParamsAddFromString</a>	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">int</span> type, <br />					 <span class="type">const char *</span> value)
<span class="type">int</span>	<a href="#virTypedParamsAddInt">virTypedParamsAddInt</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">int</span> value)
<span class="type">int</span>	<a href="#virTypedParamsAddLLong">virTypedParamsAddLLong</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">long long</span> value)
<span class="type">int</span>	<a href="#virTypedParamsAddString">virTypedParamsAddString</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">const char *</span> value)
<span class="type">int</span>	<a href="#virTypedParamsAddStringList">virTypedParamsAddStringList</a>	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">const char **</span> values)
<span class="type">int</span>	<a href="#virTypedParamsAddUInt">virTypedParamsAddUInt</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">unsigned int</span> value)
<span class="type">int</span>	<a href="#virTypedParamsAddULLong">virTypedParamsAddULLong</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params, <br />					 <span class="type">int *</span> nparams, <br />					 <span class="type">int *</span> maxparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">unsigned long long</span> value)
<span class="type">void</span>	<a href="#virTypedParamsClear">virTypedParamsClear</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams)
<span class="type">void</span>	<a href="#virTypedParamsFree">virTypedParamsFree</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams)
<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span>	<a href="#virTypedParamsGet">virTypedParamsGet</a>	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />						 <span class="type">int</span> nparams, <br />						 <span class="type">const char *</span> name)
<span class="type">int</span>	<a href="#virTypedParamsGetBoolean">virTypedParamsGetBoolean</a>	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">int *</span> value)
<span class="type">int</span>	<a href="#virTypedParamsGetDouble">virTypedParamsGetDouble</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">double *</span> value)
<span class="type">int</span>	<a href="#virTypedParamsGetInt">virTypedParamsGetInt</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">int *</span> value)
<span class="type">int</span>	<a href="#virTypedParamsGetLLong">virTypedParamsGetLLong</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">long long *</span> value)
<span class="type">int</span>	<a href="#virTypedParamsGetString">virTypedParamsGetString</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">const char **</span> value)
<span class="type">int</span>	<a href="#virTypedParamsGetUInt">virTypedParamsGetUInt</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">unsigned int *</span> value)
<span class="type">int</span>	<a href="#virTypedParamsGetULLong">virTypedParamsGetULLong</a>		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params, <br />					 <span class="type">int</span> nparams, <br />					 <span class="type">const char *</span> name, <br />					 <span class="type">unsigned long long *</span> value)
</pre><h2>Description</h2><h3><a name="macros" id="macros">Macros</a><a class="headerlink" href="#macros" title="Permalink to this headline">¶</a></h3><h3><a name="LIBVIR_CHECK_VERSION" id="LIBVIR_CHECK_VERSION"><code>LIBVIR_CHECK_VERSION</code></a><a class="headerlink" href="#LIBVIR_CHECK_VERSION" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="directive">#define</span> LIBVIR_CHECK_VERSION</pre><div class="description"><p>Macro for developers to easily check what version of the library their code is compiling against. e.g. #if LIBVIR_CHECK_VERSION(1,1,3) // some code that only works in 1.1.3 and newer #endif</p></div><h3><a name="LIBVIR_VERSION_NUMBER" id="LIBVIR_VERSION_NUMBER"><code>LIBVIR_VERSION_NUMBER</code></a><a class="headerlink" href="#LIBVIR_VERSION_NUMBER" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="directive">#define</span> LIBVIR_VERSION_NUMBER</pre><div class="description"><p>Macro providing the version of the library as version * 1,000,000 + minor * 1000 + micro</p></div><h3><a name="VIR_TYPED_PARAM_FIELD_LENGTH" id="VIR_TYPED_PARAM_FIELD_LENGTH"><code>VIR_TYPED_PARAM_FIELD_LENGTH</code></a><a class="headerlink" href="#VIR_TYPED_PARAM_FIELD_LENGTH" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="directive">#define</span> VIR_TYPED_PARAM_FIELD_LENGTH</pre><div class="description"><p>Macro providing the field length of <a href="libvirt-libvirt-common.html#virTypedParameter">virTypedParameter</a> name</p></div><h3><a name="types" id="types">Types</a><a class="headerlink" href="#types" title="Permalink to this headline">¶</a></h3><h3><a name="virConnectCloseReason" id="virConnectCloseReason"><code>virConnectCloseReason</code></a><a class="headerlink" href="#virConnectCloseReason" title="Permalink to this headline">¶</a></h3><div class="api"><pre><span class="keyword">enum</span> virConnectCloseReason {
</pre><table><tr><td><a name="VIR_CONNECT_CLOSE_REASON_ERROR" id="VIR_CONNECT_CLOSE_REASON_ERROR">VIR_CONNECT_CLOSE_REASON_ERROR</a></td><td> = </td><td>0</td><td><div class="comment">Misc I/O error</div></td></tr><tr><td><a name="VIR_CONNECT_CLOSE_REASON_EOF" id="VIR_CONNECT_CLOSE_REASON_EOF">VIR_CONNECT_CLOSE_REASON_EOF</a></td><td> = </td><td>1</td><td><div class="comment">End-of-file from server</div></td></tr><tr><td><a name="VIR_CONNECT_CLOSE_REASON_KEEPALIVE" id="VIR_CONNECT_CLOSE_REASON_KEEPALIVE">VIR_CONNECT_CLOSE_REASON_KEEPALIVE</a></td><td> = </td><td>2</td><td><div class="comment">Keepalive timer triggered</div></td></tr><tr><td><a name="VIR_CONNECT_CLOSE_REASON_CLIENT" id="VIR_CONNECT_CLOSE_REASON_CLIENT">VIR_CONNECT_CLOSE_REASON_CLIENT</a></td><td> = </td><td>3</td><td><div class="comment">Client requested it</div></td></tr><tr><td><a name="VIR_CONNECT_CLOSE_REASON_LAST" id="VIR_CONNECT_CLOSE_REASON_LAST">VIR_CONNECT_CLOSE_REASON_LAST</a></td><td> = </td><td>4</td></tr></table><pre>}
</pre></div><h3><a name="virTypedParameter" id="virTypedParameter"><code>virTypedParameter</code></a><a class="headerlink" href="#virTypedParameter" title="Permalink to this headline">¶</a></h3><div class="api"><pre><span class="keyword">struct </span>virTypedParameter {
</pre><table><tr><td><span class="type">char field[VIR_TYPED_PARAM_FIELD_LENGTH]</span></td><td>field</td><td><div class="comment">parameter name</div></td></tr><tr><td><span class="type">int</span></td><td>type</td><td><div class="comment">parameter type, <a href="libvirt-libvirt-common.html#virTypedParameterType">virTypedParameterType</a></div></td></tr><tr><td><span class="keyword">union</span> {</td></tr><tr><td><table><tr><td><span class="type">int</span></td><td>i</td><td><div class="comment">type is INT</div></td></tr><tr><td><span class="type">unsigned int</span></td><td>ui</td><td><div class="comment">type is UINT</div></td></tr><tr><td><span class="type">long long int</span></td><td>l</td><td><div class="comment">type is LLONG</div></td></tr><tr><td><span class="type">unsigned long long int</span></td><td>ul</td><td><div class="comment">type is ULLONG</div></td></tr><tr><td><span class="type">double</span></td><td>d</td><td><div class="comment">type is DOUBLE</div></td></tr><tr><td><span class="type">char</span></td><td>b</td><td><div class="comment">type is BOOLEAN</div></td></tr><tr><td><span class="type">char *</span></td><td>s</td><td><div class="comment">type is STRING, may not be NULL</div></td></tr></table></td><td></td></tr><tr><td>}</td><td>value</td><td><div class="comment">parameter value</div></td><td></td></tr></table><pre>
}
</pre></div><h3><a name="virTypedParameterFlags" id="virTypedParameterFlags"><code>virTypedParameterFlags</code></a><a class="headerlink" href="#virTypedParameterFlags" title="Permalink to this headline">¶</a></h3><div class="api"><pre><span class="keyword">enum</span> virTypedParameterFlags {
</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>}
</pre></div><h3><a name="virTypedParameterType" id="virTypedParameterType"><code>virTypedParameterType</code></a><a class="headerlink" href="#virTypedParameterType" title="Permalink to this headline">¶</a></h3><div class="api"><pre><span class="keyword">enum</span> virTypedParameterType {
</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><div class="comment">integer case</div></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><div class="comment">unsigned integer case</div></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><div class="comment">long long case</div></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><div class="comment">unsigned long long case</div></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><div class="comment">double case</div></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><div class="comment">boolean(character) case</div></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><div class="comment">string case</div></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>}
</pre></div><h3><a name="functions" id="functions">Functions</a><a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h3><h3><a name="virFreeCallback" id="virFreeCallback"><code>virFreeCallback</code></a><a class="headerlink" href="#virFreeCallback" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="keyword">typedef</span> <span class="type">void</span>	(*virFreeCallback		)	(<span class="type">void *</span> opaque)
</pre><div class="description"><p>Type for a callback cleanup function to be paired with a callback. This function will be called as a final chance to clean up the @opaque registered with the primary callback, at the time when the primary callback is deregistered.</p><p>It is forbidden to call any other libvirt APIs from an implementation of this callback, since it can be invoked from a context which is not re-entrant safe. Failure to abide by this requirement may lead to application deadlocks or crashes.</p></div><dl class="variablelist"><dt>opaque</dt><dd>opaque user data provided at registration</dd></dl><br /><h3><a name="virTypedParamsAddBoolean" id="virTypedParamsAddBoolean"><code>virTypedParamsAddBoolean</code></a><a class="headerlink" href="#virTypedParamsAddBoolean" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddBoolean	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">int</span> value)</pre><div class="description"><p>Adds new parameter called @name with boolean type and sets its value to @value. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>the value to store into the new parameter</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddDouble" id="virTypedParamsAddDouble"><code>virTypedParamsAddDouble</code></a><a class="headerlink" href="#virTypedParamsAddDouble" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddDouble		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">double</span> value)</pre><div class="description"><p>Adds new parameter called @name with double type and sets its value to @value. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>the value to store into the new parameter</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddFromString" id="virTypedParamsAddFromString"><code>virTypedParamsAddFromString</code></a><a class="headerlink" href="#virTypedParamsAddFromString" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddFromString	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">int</span> type,
					 <span class="type">const char *</span> value)</pre><div class="description"><p>Adds new parameter called @name with the requested @type and parses its value from the @value string. If the requested type is string, the function creates its own copy of the @value string, which needs to be freed using <a href="libvirt-libvirt-common.html#virTypedParamsFree">virTypedParamsFree</a> or <a href="libvirt-libvirt-common.html#virTypedParamsClear">virTypedParamsClear</a>. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>type</dt><dd>type of the parameter</dd><dt>value</dt><dd>the value to store into the new parameter encoded as a string</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddInt" id="virTypedParamsAddInt"><code>virTypedParamsAddInt</code></a><a class="headerlink" href="#virTypedParamsAddInt" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddInt		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">int</span> value)</pre><div class="description"><p>Adds new parameter called @name with int type and sets its value to @value. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>the value to store into the new parameter</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddLLong" id="virTypedParamsAddLLong"><code>virTypedParamsAddLLong</code></a><a class="headerlink" href="#virTypedParamsAddLLong" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddLLong		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">long long</span> value)</pre><div class="description"><p>Adds new parameter called @name with long long int type and sets its value to @value. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>the value to store into the new parameter</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddString" id="virTypedParamsAddString"><code>virTypedParamsAddString</code></a><a class="headerlink" href="#virTypedParamsAddString" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddString		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">const char *</span> value)</pre><div class="description"><p>Adds new parameter called @name with char * type and sets its value to @value. The function creates its own copy of @value string, which needs to be freed using <a href="libvirt-libvirt-common.html#virTypedParamsFree">virTypedParamsFree</a> or <a href="libvirt-libvirt-common.html#virTypedParamsClear">virTypedParamsClear</a>. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>the value to store into the new parameter</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddStringList" id="virTypedParamsAddStringList"><code>virTypedParamsAddStringList</code></a><a class="headerlink" href="#virTypedParamsAddStringList" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddStringList	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">const char **</span> values)</pre><div class="description"><p>Packs NULL-terminated list of strings @values into @params under the key @name.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to store values to</dd><dt>values</dt><dd>the values to store into the new parameters</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddUInt" id="virTypedParamsAddUInt"><code>virTypedParamsAddUInt</code></a><a class="headerlink" href="#virTypedParamsAddUInt" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddUInt		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">unsigned int</span> value)</pre><div class="description"><p>Adds new parameter called @name with unsigned int type and sets its value to @value. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>the value to store into the new parameter</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsAddULLong" id="virTypedParamsAddULLong"><code>virTypedParamsAddULLong</code></a><a class="headerlink" href="#virTypedParamsAddULLong" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsAddULLong		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a> *</span> params,
					 <span class="type">int *</span> nparams,
					 <span class="type">int *</span> maxparams,
					 <span class="type">const char *</span> name,
					 <span class="type">unsigned long long</span> value)</pre><div class="description"><p>Adds new parameter called @name with unsigned long long type and sets its value to @value. If @params array points to NULL or to a space that is not large enough to accommodate the new parameter (@maxparams &lt; @nparams + 1), the function allocates more space for it and updates @maxparams. On success, @nparams is incremented by one. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter already exists in @params.</p></div><dl class="variablelist"><dt>params</dt><dd>pointer to the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>maxparams</dt><dd>maximum number of parameters that can be stored in @params array without allocating more memory</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>the value to store into the new parameter</dd><dt>Returns</dt><dd>0 on success, -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsClear" id="virTypedParamsClear"><code>virTypedParamsClear</code></a><a class="headerlink" href="#virTypedParamsClear" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">void</span>	virTypedParamsClear		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams)</pre><div class="description"><p>Frees all memory used by string parameters. The memory occupied by @params is not freed; use <a href="libvirt-libvirt-common.html#virTypedParamsFree">virTypedParamsFree</a> if you want it to be freed too.</p></div><dl class="variablelist"><dt>params</dt><dd>the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd></dl><div class="acl"></div><h3><a name="virTypedParamsFree" id="virTypedParamsFree"><code>virTypedParamsFree</code></a><a class="headerlink" href="#virTypedParamsFree" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">void</span>	virTypedParamsFree		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams)</pre><div class="description"><p>Frees all memory used by string parameters and the memory occupied by @params.</p></div><dl class="variablelist"><dt>params</dt><dd>the array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGet" id="virTypedParamsGet"><code>virTypedParamsGet</code></a><a class="headerlink" href="#virTypedParamsGet" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span>	virTypedParamsGet	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
						 <span class="type">int</span> nparams,
						 <span class="type">const char *</span> name)</pre><div class="description"><p>Finds typed parameter called @name.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>Returns</dt><dd>pointer to the parameter or NULL if it does not exist in @params. This function does not raise an error, even when returning NULL.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGetBoolean" id="virTypedParamsGetBoolean"><code>virTypedParamsGetBoolean</code></a><a class="headerlink" href="#virTypedParamsGetBoolean" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsGetBoolean	(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams,
					 <span class="type">const char *</span> name,
					 <span class="type">int *</span> value)</pre><div class="description"><p>Finds typed parameter called @name and store its boolean value in @value. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter does not have the expected type. By passing NULL as @value, the function may be used to check presence and type of the parameter.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>where to store the parameter's value</dd><dt>Returns</dt><dd>1 on success, 0 when the parameter does not exist in @params, or -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGetDouble" id="virTypedParamsGetDouble"><code>virTypedParamsGetDouble</code></a><a class="headerlink" href="#virTypedParamsGetDouble" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsGetDouble		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams,
					 <span class="type">const char *</span> name,
					 <span class="type">double *</span> value)</pre><div class="description"><p>Finds typed parameter called @name and store its double value in @value. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter does not have the expected type. By passing NULL as @value, the function may be used to check presence and type of the parameter.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>where to store the parameter's value</dd><dt>Returns</dt><dd>1 on success, 0 when the parameter does not exist in @params, or -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGetInt" id="virTypedParamsGetInt"><code>virTypedParamsGetInt</code></a><a class="headerlink" href="#virTypedParamsGetInt" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsGetInt		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams,
					 <span class="type">const char *</span> name,
					 <span class="type">int *</span> value)</pre><div class="description"><p>Finds typed parameter called @name and store its int value in @value. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter does not have the expected type. By passing NULL as @value, the function may be used to check presence and type of the parameter.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>where to store the parameter's value</dd><dt>Returns</dt><dd>1 on success, 0 when the parameter does not exist in @params, or -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGetLLong" id="virTypedParamsGetLLong"><code>virTypedParamsGetLLong</code></a><a class="headerlink" href="#virTypedParamsGetLLong" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsGetLLong		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams,
					 <span class="type">const char *</span> name,
					 <span class="type">long long *</span> value)</pre><div class="description"><p>Finds typed parameter called @name and store its long long int value in @value. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter does not have the expected type. By passing NULL as @value, the function may be used to check presence and type of the parameter.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>where to store the parameter's value</dd><dt>Returns</dt><dd>1 on success, 0 when the parameter does not exist in @params, or -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGetString" id="virTypedParamsGetString"><code>virTypedParamsGetString</code></a><a class="headerlink" href="#virTypedParamsGetString" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsGetString		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams,
					 <span class="type">const char *</span> name,
					 <span class="type">const char **</span> value)</pre><div class="description"><p>Finds typed parameter called @name and store its char * value in @value. The function does not create a copy of the string and the caller must not free the string @value points to. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter does not have the expected type. By passing NULL as @value, the function may be used to check presence and type of the parameter.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>where to store the parameter's value</dd><dt>Returns</dt><dd>1 on success, 0 when the parameter does not exist in @params, or -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGetUInt" id="virTypedParamsGetUInt"><code>virTypedParamsGetUInt</code></a><a class="headerlink" href="#virTypedParamsGetUInt" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsGetUInt		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams,
					 <span class="type">const char *</span> name,
					 <span class="type">unsigned int *</span> value)</pre><div class="description"><p>Finds typed parameter called @name and store its unsigned int value in @value. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter does not have the expected type. By passing NULL as @value, the function may be used to check presence and type of the parameter.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>where to store the parameter's value</dd><dt>Returns</dt><dd>1 on success, 0 when the parameter does not exist in @params, or -1 on error.</dd></dl><div class="acl"></div><h3><a name="virTypedParamsGetULLong" id="virTypedParamsGetULLong"><code>virTypedParamsGetULLong</code></a><a class="headerlink" href="#virTypedParamsGetULLong" title="Permalink to this headline">¶</a></h3><pre class="api"><span class="type">int</span>	virTypedParamsGetULLong		(<span class="type"><a href="libvirt-libvirt-common.html#virTypedParameterPtr">virTypedParameterPtr</a></span> params,
					 <span class="type">int</span> nparams,
					 <span class="type">const char *</span> name,
					 <span class="type">unsigned long long *</span> value)</pre><div class="description"><p>Finds typed parameter called @name and store its unsigned long long int value in @value. The function fails with <a href="libvirt-virterror.html#VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> error if the parameter does not have the expected type. By passing NULL as @value, the function may be used to check presence and type of the parameter.</p></div><dl class="variablelist"><dt>params</dt><dd>array of typed parameters</dd><dt>nparams</dt><dd>number of parameters in the @params array</dd><dt>name</dt><dd>name of the parameter to find</dd><dt>value</dt><dd>where to store the parameter's value</dd><dt>Returns</dt><dd>1 on success, 0 when the parameter does not exist in @params, or -1 on error.</dd></dl><div class="acl"></div></div></div><div id="nav"><div id="home"><a href="../index.html">Home</a></div><div id="jumplinks"><ul><li><a href="../downloads.html">Download</a></li><li><a href="../contribute.html">Contribute</a></li><li><a href="../docs.html">Learn</a></li></ul></div><div id="search"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><div><input name="query" type="text" size="12" value="" /><input name="submit" type="submit" value="Go" /></div></form></div></div><div id="footer"><div id="contact"><h3>Contact</h3><ul><li><a href="../contact.html#email">email</a></li><li><a href="../contact.html#irc">irc</a></li></ul></div><div id="community"><h3>Community</h3><ul><li><a href="https://twitter.com/hashtag/libvirt">twitter</a></li><li><a href="https://plus.google.com/communities/109522598353007505282">google+</a></li><li><a href="http://stackoverflow.com/questions/tagged/libvirt">stackoverflow</a></li><li><a href="http://serverfault.com/questions/tagged/libvirt">serverfault</a></li></ul></div><div id="conduct">
            Participants in the libvirt project agree to abide by <a href="../governance.html#codeofconduct">the project code of conduct</a></div><br class="clear" /></div></body></html>