~ubuntu-branches/ubuntu/maverick/libvirt/maverick

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Soren Hansen
  • Date: 2009-02-11 01:01:42 UTC
  • mto: (3.4.1 sid) (1.2.1 upstream) (0.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090211010142-wk9mgtbw8bmp3zcb
Tags: upstream-0.6.0
ImportĀ upstreamĀ versionĀ 0.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<html>
 
3
  <head>
 
4
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
 
5
    <title>virterror: error handling interfaces for the libvirt library</title>
 
6
    <meta name="generator" content="Libvirt devhelp stylesheet"/>
 
7
    <link rel="start" href="index.html" title="libvirt Reference Manual"/>
 
8
    <link rel="up" href="general.html" title="API"/>
 
9
    <link rel="stylesheet" href="style.css" type="text/css"/>
 
10
    <link rel="chapter" href="general.html" title="API"/>
 
11
  </head>
 
12
  <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 
13
    <table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
 
14
      <tr valign="middle">
 
15
        <td>
 
16
          <a accesskey="p" href="libvirt-libvirt.html">
 
17
            <img src="left.png" width="24" height="24" border="0" alt="Prev"/>
 
18
          </a>
 
19
        </td>
 
20
        <td>
 
21
          <a accesskey="u" href="general.html">
 
22
            <img src="up.png" width="24" height="24" border="0" alt="Up"/>
 
23
          </a>
 
24
        </td>
 
25
        <td>
 
26
          <a accesskey="h" href="index.html">
 
27
            <img src="home.png" width="24" height="24" border="0" alt="Home"/>
 
28
          </a>
 
29
        </td>
 
30
        <th width="100%" align="center">libvirt Reference Manual</th>
 
31
      </tr>
 
32
    </table>
 
33
    <h2>
 
34
      <span class="refentrytitle">virterror</span>
 
35
    </h2>
 
36
    <p>virterror - error handling interfaces for the libvirt library</p>
 
37
    <p>Provides the interfaces of the libvirt library to handle errors raised while using the library. </p>
 
38
    <p>Author(s): Daniel Veillard &lt;veillard@redhat.com&gt; </p>
 
39
    <div class="refsynopsisdiv">
 
40
      <h2>Synopsis</h2>
 
41
      <pre class="synopsis">typedef <a href="libvirt-virterror.html#virError">virError</a> * <a href="#virErrorPtr">virErrorPtr</a>;
 
42
typedef enum <a href="#virErrorLevel">virErrorLevel</a>;
 
43
typedef enum <a href="#virErrorDomain">virErrorDomain</a>;
 
44
typedef enum <a href="#virErrorNumber">virErrorNumber</a>;
 
45
typedef struct _virError <a href="#virError">virError</a>;
 
46
int     <a href="#virCopyLastError">virCopyLastError</a>                (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to);
 
47
void    <a href="#virConnSetErrorFunc">virConnSetErrorFunc</a>          (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/>                                      void * userData, <br/>                                  <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler);
 
48
void    <a href="#virResetLastError">virResetLastError</a>              (void);
 
49
typedef void <a href="#virErrorFunc">virErrorFunc</a>                   (void * userData, <br/>                                  <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> error);
 
50
void    <a href="#virResetError">virResetError</a>                      (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
 
51
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a>    <a href="#virConnGetLastError">virConnGetLastError</a>  (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
 
52
void    <a href="#virDefaultErrorFunc">virDefaultErrorFunc</a>          (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err);
 
53
<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a>    <a href="#virGetLastError">virGetLastError</a>          (void);
 
54
void    <a href="#virSetErrorFunc">virSetErrorFunc</a>                  (void * userData, <br/>                                  <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler);
 
55
int     <a href="#virConnCopyLastError">virConnCopyLastError</a>                (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/>                                      <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to);
 
56
void    <a href="#virConnResetLastError">virConnResetLastError</a>              (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn);
 
57
</pre>
 
58
    </div>
 
59
    <div class="refsect1" lang="en">
 
60
      <h2>Description</h2>
 
61
    </div>
 
62
    <div class="refsect1" lang="en">
 
63
      <h2>Details</h2>
 
64
      <div class="refsect2" lang="en">
 
65
        <div class="refsect2" lang="en"><h3><a name="virError">Structure </a>virError</h3><pre class="programlisting">struct _virError {
 
66
    int code    : The error code, a <a href="libvirt-virterror.html#virErrorNumber">virErrorNumber</a>
 
67
    int domain  : What part of the library raised this error
 
68
    char *      message : human-readable informative error message
 
69
    <a href="libvirt-virterror.html#virErrorLevel">virErrorLevel</a>    level   : how consequent is the error
 
70
    <a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a>      conn    : connection if available, deprecated see note above
 
71
    <a href="libvirt-libvirt.html#virDomainPtr">virDomainPtr</a>        dom     : domain if available, deprecated see note above
 
72
    char *      str1    : extra string information
 
73
    char *      str2    : extra string information
 
74
    char *      str3    : extra string information
 
75
    int int1    : extra number information
 
76
    int int2    : extra number information
 
77
    <a href="libvirt-libvirt.html#virNetworkPtr">virNetworkPtr</a>      net     : network if available, deprecated see note above
 
78
} virError;
 
79
</pre><p/>
 
80
</div>
 
81
        <hr/>
 
82
        <div class="refsect2" lang="en"><h3><a name="virErrorDomain">Enum </a>virErrorDomain</h3><pre class="programlisting">enum <a href="#virErrorDomain">virErrorDomain</a> {
 
83
    <a name="VIR_FROM_NONE">VIR_FROM_NONE</a> = 0
 
84
    <a name="VIR_FROM_XEN">VIR_FROM_XEN</a> = 1 /* Error at Xen hypervisor layer */
 
85
    <a name="VIR_FROM_XEND">VIR_FROM_XEND</a> = 2 /* Error at connection with xend daemon */
 
86
    <a name="VIR_FROM_XENSTORE">VIR_FROM_XENSTORE</a> = 3 /* Error at connection with xen store */
 
87
    <a name="VIR_FROM_SEXPR">VIR_FROM_SEXPR</a> = 4 /* Error in the S-Expression code */
 
88
    <a name="VIR_FROM_XML">VIR_FROM_XML</a> = 5 /* Error in the XML code */
 
89
    <a name="VIR_FROM_DOM">VIR_FROM_DOM</a> = 6 /* Error when operating on a domain */
 
90
    <a name="VIR_FROM_RPC">VIR_FROM_RPC</a> = 7 /* Error in the XML-RPC code */
 
91
    <a name="VIR_FROM_PROXY">VIR_FROM_PROXY</a> = 8 /* Error in the proxy code */
 
92
    <a name="VIR_FROM_CONF">VIR_FROM_CONF</a> = 9 /* Error in the configuration file handling */
 
93
    <a name="VIR_FROM_QEMU">VIR_FROM_QEMU</a> = 10 /* Error at the QEMU daemon */
 
94
    <a name="VIR_FROM_NET">VIR_FROM_NET</a> = 11 /* Error when operating on a network */
 
95
    <a name="VIR_FROM_TEST">VIR_FROM_TEST</a> = 12 /* Error from test driver */
 
96
    <a name="VIR_FROM_REMOTE">VIR_FROM_REMOTE</a> = 13 /* Error from remote driver */
 
97
    <a name="VIR_FROM_OPENVZ">VIR_FROM_OPENVZ</a> = 14 /* Error from OpenVZ driver */
 
98
    <a name="VIR_FROM_XENXM">VIR_FROM_XENXM</a> = 15 /* Error at Xen XM layer */
 
99
    <a name="VIR_FROM_STATS_LINUX">VIR_FROM_STATS_LINUX</a> = 16 /* Error in the Linux Stats code */
 
100
    <a name="VIR_FROM_LXC">VIR_FROM_LXC</a> = 17 /* Error from Linux Container driver */
 
101
    <a name="VIR_FROM_STORAGE">VIR_FROM_STORAGE</a> = 18 /* Error from storage driver */
 
102
    <a name="VIR_FROM_NETWORK">VIR_FROM_NETWORK</a> = 19 /* Error from network config */
 
103
    <a name="VIR_FROM_DOMAIN">VIR_FROM_DOMAIN</a> = 20 /* Error from domain config */
 
104
    <a name="VIR_FROM_UML">VIR_FROM_UML</a> = 21 /* Error at the UML driver */
 
105
    <a name="VIR_FROM_NODEDEV">VIR_FROM_NODEDEV</a> = 22 /* Error from node device monitor */
 
106
    <a name="VIR_FROM_XEN_INOTIFY">VIR_FROM_XEN_INOTIFY</a> = 23 /*  Error from xen inotify layer */
 
107
};
 
108
</pre><p/>
 
109
</div>
 
110
        <hr/>
 
111
        <div class="refsect2" lang="en"><h3><a name="virErrorLevel">Enum </a>virErrorLevel</h3><pre class="programlisting">enum <a href="#virErrorLevel">virErrorLevel</a> {
 
112
    <a name="VIR_ERR_NONE">VIR_ERR_NONE</a> = 0
 
113
    <a name="VIR_ERR_WARNING">VIR_ERR_WARNING</a> = 1 /* A simple warning */
 
114
    <a name="VIR_ERR_ERROR">VIR_ERR_ERROR</a> = 2 /*  An error */
 
115
};
 
116
</pre><p/>
 
117
</div>
 
118
        <hr/>
 
119
        <div class="refsect2" lang="en"><h3><a name="virErrorNumber">Enum </a>virErrorNumber</h3><pre class="programlisting">enum <a href="#virErrorNumber">virErrorNumber</a> {
 
120
    <a name="VIR_ERR_OK">VIR_ERR_OK</a> = 0
 
121
    <a name="VIR_ERR_INTERNAL_ERROR">VIR_ERR_INTERNAL_ERROR</a> = 1 /* internal error */
 
122
    <a name="VIR_ERR_NO_MEMORY">VIR_ERR_NO_MEMORY</a> = 2 /* memory allocation failure */
 
123
    <a name="VIR_ERR_NO_SUPPORT">VIR_ERR_NO_SUPPORT</a> = 3 /* no support for this function */
 
124
    <a name="VIR_ERR_UNKNOWN_HOST">VIR_ERR_UNKNOWN_HOST</a> = 4 /* could not resolve hostname */
 
125
    <a name="VIR_ERR_NO_CONNECT">VIR_ERR_NO_CONNECT</a> = 5 /* can't connect to hypervisor */
 
126
    <a name="VIR_ERR_INVALID_CONN">VIR_ERR_INVALID_CONN</a> = 6 /* invalid connection object */
 
127
    <a name="VIR_ERR_INVALID_DOMAIN">VIR_ERR_INVALID_DOMAIN</a> = 7 /* invalid domain object */
 
128
    <a name="VIR_ERR_INVALID_ARG">VIR_ERR_INVALID_ARG</a> = 8 /* invalid function argument */
 
129
    <a name="VIR_ERR_OPERATION_FAILED">VIR_ERR_OPERATION_FAILED</a> = 9 /* a command to hypervisor failed */
 
130
    <a name="VIR_ERR_GET_FAILED">VIR_ERR_GET_FAILED</a> = 10 /* a HTTP GET command to failed */
 
131
    <a name="VIR_ERR_POST_FAILED">VIR_ERR_POST_FAILED</a> = 11 /* a HTTP POST command to failed */
 
132
    <a name="VIR_ERR_HTTP_ERROR">VIR_ERR_HTTP_ERROR</a> = 12 /* unexpected HTTP error code */
 
133
    <a name="VIR_ERR_SEXPR_SERIAL">VIR_ERR_SEXPR_SERIAL</a> = 13 /* failure to serialize an S-Expr */
 
134
    <a name="VIR_ERR_NO_XEN">VIR_ERR_NO_XEN</a> = 14 /* could not open Xen hypervisor control */
 
135
    <a name="VIR_ERR_XEN_CALL">VIR_ERR_XEN_CALL</a> = 15 /* failure doing an hypervisor call */
 
136
    <a name="VIR_ERR_OS_TYPE">VIR_ERR_OS_TYPE</a> = 16 /* unknown OS type */
 
137
    <a name="VIR_ERR_NO_KERNEL">VIR_ERR_NO_KERNEL</a> = 17 /* missing kernel information */
 
138
    <a name="VIR_ERR_NO_ROOT">VIR_ERR_NO_ROOT</a> = 18 /* missing root device information */
 
139
    <a name="VIR_ERR_NO_SOURCE">VIR_ERR_NO_SOURCE</a> = 19 /* missing source device information */
 
140
    <a name="VIR_ERR_NO_TARGET">VIR_ERR_NO_TARGET</a> = 20 /* missing target device information */
 
141
    <a name="VIR_ERR_NO_NAME">VIR_ERR_NO_NAME</a> = 21 /* missing domain name information */
 
142
    <a name="VIR_ERR_NO_OS">VIR_ERR_NO_OS</a> = 22 /* missing domain OS information */
 
143
    <a name="VIR_ERR_NO_DEVICE">VIR_ERR_NO_DEVICE</a> = 23 /* missing domain devices information */
 
144
    <a name="VIR_ERR_NO_XENSTORE">VIR_ERR_NO_XENSTORE</a> = 24 /* could not open Xen Store control */
 
145
    <a name="VIR_ERR_DRIVER_FULL">VIR_ERR_DRIVER_FULL</a> = 25 /* too many drivers registered */
 
146
    <a name="VIR_ERR_CALL_FAILED">VIR_ERR_CALL_FAILED</a> = 26 /* not supported by the drivers (DEPRECATED) */
 
147
    <a name="VIR_ERR_XML_ERROR">VIR_ERR_XML_ERROR</a> = 27 /* an XML description is not well formed or broken */
 
148
    <a name="VIR_ERR_DOM_EXIST">VIR_ERR_DOM_EXIST</a> = 28 /* the domain already exist */
 
149
    <a name="VIR_ERR_OPERATION_DENIED">VIR_ERR_OPERATION_DENIED</a> = 29 /* operation forbidden on read-only connections */
 
150
    <a name="VIR_ERR_OPEN_FAILED">VIR_ERR_OPEN_FAILED</a> = 30 /* failed to open a conf file */
 
151
    <a name="VIR_ERR_READ_FAILED">VIR_ERR_READ_FAILED</a> = 31 /* failed to read a conf file */
 
152
    <a name="VIR_ERR_PARSE_FAILED">VIR_ERR_PARSE_FAILED</a> = 32 /* failed to parse a conf file */
 
153
    <a name="VIR_ERR_CONF_SYNTAX">VIR_ERR_CONF_SYNTAX</a> = 33 /* failed to parse the syntax of a conf file */
 
154
    <a name="VIR_ERR_WRITE_FAILED">VIR_ERR_WRITE_FAILED</a> = 34 /* failed to write a conf file */
 
155
    <a name="VIR_ERR_XML_DETAIL">VIR_ERR_XML_DETAIL</a> = 35 /* detail of an XML error */
 
156
    <a name="VIR_ERR_INVALID_NETWORK">VIR_ERR_INVALID_NETWORK</a> = 36 /* invalid network object */
 
157
    <a name="VIR_ERR_NETWORK_EXIST">VIR_ERR_NETWORK_EXIST</a> = 37 /* the network already exist */
 
158
    <a name="VIR_ERR_SYSTEM_ERROR">VIR_ERR_SYSTEM_ERROR</a> = 38 /* general system call failure */
 
159
    <a name="VIR_ERR_RPC">VIR_ERR_RPC</a> = 39 /* some sort of RPC error */
 
160
    <a name="VIR_ERR_GNUTLS_ERROR">VIR_ERR_GNUTLS_ERROR</a> = 40 /* error from a GNUTLS call */
 
161
    <a name="VIR_WAR_NO_NETWORK">VIR_WAR_NO_NETWORK</a> = 41 /* failed to start network */
 
162
    <a name="VIR_ERR_NO_DOMAIN">VIR_ERR_NO_DOMAIN</a> = 42 /* domain not found or unexpectedly disappeared */
 
163
    <a name="VIR_ERR_NO_NETWORK">VIR_ERR_NO_NETWORK</a> = 43 /* network not found */
 
164
    <a name="VIR_ERR_INVALID_MAC">VIR_ERR_INVALID_MAC</a> = 44 /* invalid MAC address */
 
165
    <a name="VIR_ERR_AUTH_FAILED">VIR_ERR_AUTH_FAILED</a> = 45 /* authentication failed */
 
166
    <a name="VIR_ERR_INVALID_STORAGE_POOL">VIR_ERR_INVALID_STORAGE_POOL</a> = 46 /* invalid storage pool object */
 
167
    <a name="VIR_ERR_INVALID_STORAGE_VOL">VIR_ERR_INVALID_STORAGE_VOL</a> = 47 /* invalid storage vol object */
 
168
    <a name="VIR_WAR_NO_STORAGE">VIR_WAR_NO_STORAGE</a> = 48 /* failed to start storage */
 
169
    <a name="VIR_ERR_NO_STORAGE_POOL">VIR_ERR_NO_STORAGE_POOL</a> = 49 /* storage pool not found */
 
170
    <a name="VIR_ERR_NO_STORAGE_VOL">VIR_ERR_NO_STORAGE_VOL</a> = 50 /* storage pool not found */
 
171
    <a name="VIR_WAR_NO_NODE">VIR_WAR_NO_NODE</a> = 51 /* failed to start node driver */
 
172
    <a name="VIR_ERR_INVALID_NODE_DEVICE">VIR_ERR_INVALID_NODE_DEVICE</a> = 52 /* invalid node device object */
 
173
    <a name="VIR_ERR_NO_NODE_DEVICE">VIR_ERR_NO_NODE_DEVICE</a> = 53 /*  node device not found */
 
174
};
 
175
</pre><p/>
 
176
</div>
 
177
        <hr/>
 
178
        <div class="refsect2" lang="en"><h3><a name="virErrorPtr">Typedef </a>virErrorPtr</h3><pre class="programlisting"><a href="libvirt-virterror.html#virError">virError</a> * virErrorPtr;
 
179
</pre><p/>
 
180
</div>
 
181
        <hr/>
 
182
        <div class="refsect2" lang="en"><h3><a name="virErrorFunc"/>Function type virErrorFunc</h3><pre class="programlisting">void     virErrorFunc                    (void * userData, <br/>                                  <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> error)<br/>
 
183
</pre><p>Signature of a function to use when there is an error raised by the library.</p>
 
184
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>user provided data for the error callback</td></tr><tr><td><span class="term"><i><tt>error</tt></i>:</span></td><td>the error being raised.</td></tr></tbody></table></div></div>
 
185
        <hr/>
 
186
        <div class="refsect2" lang="en"><h3><a name="virConnCopyLastError"/>virConnCopyLastError ()</h3><pre class="programlisting">int virConnCopyLastError            (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/>                                      <a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to)<br/>
 
187
</pre><p>Copy the content of the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability. One will need to free the result with virResetError()</p>
 
188
<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>to</tt></i>:</span></td><td>target to receive the copy</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no error was found and the error code otherwise and -1 in case of parameter error.</td></tr></tbody></table></div></div>
 
189
        <hr/>
 
190
        <div class="refsect2" lang="en"><h3><a name="virConnGetLastError"/>virConnGetLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a>  virConnGetLastError     (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
 
191
</pre><p>Provide a pointer to the last error caught on that connection This method is not protected against access from multiple threads. In a multi-threaded application, always use the global virGetLastError() API which is backed by thread local storage. If the connection object was discovered to be invalid by an API call, then the error will be reported against the global error object. Since 0.6.0, all errors reported in the per-connection object are also duplicated in the global error object. As such an application can always use virGetLastError(). This method remains for backwards compatability.</p>
 
192
<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>a pointer to the last error or NULL if none occurred.</td></tr></tbody></table></div></div>
 
193
        <hr/>
 
194
        <div class="refsect2" lang="en"><h3><a name="virConnResetLastError"/>virConnResetLastError ()</h3><pre class="programlisting">void      virConnResetLastError           (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn)<br/>
 
195
</pre><p>The error object is kept in thread local storage, so separate threads can safely access this concurrently. Reset the last error caught on that connection</p>
 
196
<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></tbody></table></div></div>
 
197
        <hr/>
 
198
        <div class="refsect2" lang="en"><h3><a name="virConnSetErrorFunc"/>virConnSetErrorFunc ()</h3><pre class="programlisting">void  virConnSetErrorFunc             (<a href="libvirt-libvirt.html#virConnectPtr">virConnectPtr</a> conn, <br/>                                      void * userData, <br/>                                  <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler)<br/>
 
199
</pre><p>Set a connection error handling function, if @handler is NULL it will reset to default which is to pass error back to the global library handler.</p>
 
200
<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>userData</tt></i>:</span></td><td>pointer to the user data provided in the handler callback</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>the function to get called in case of error or NULL</td></tr></tbody></table></div></div>
 
201
        <hr/>
 
202
        <div class="refsect2" lang="en"><h3><a name="virCopyLastError"/>virCopyLastError ()</h3><pre class="programlisting">int virCopyLastError                (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> to)<br/>
 
203
</pre><p>Copy the content of the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently. One will need to free the result with virResetError()</p>
 
204
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>to</tt></i>:</span></td><td>target to receive the copy</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no error was found and the error code otherwise and -1 in case of parameter error.</td></tr></tbody></table></div></div>
 
205
        <hr/>
 
206
        <div class="refsect2" lang="en"><h3><a name="virDefaultErrorFunc"/>virDefaultErrorFunc ()</h3><pre class="programlisting">void  virDefaultErrorFunc             (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
 
207
</pre><p>Default routine reporting an error to stderr.</p>
 
208
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>pointer to the error.</td></tr></tbody></table></div></div>
 
209
        <hr/>
 
210
        <div class="refsect2" lang="en"><h3><a name="virGetLastError"/>virGetLastError ()</h3><pre class="programlisting"><a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a>  virGetLastError         (void)<br/>
 
211
</pre><p>Provide a pointer to the last error caught at the library level The error object is kept in thread local storage, so separate threads can safely access this concurrently.</p>
 
212
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the last error or NULL if none occurred.</td></tr></tbody></table></div></div>
 
213
        <hr/>
 
214
        <div class="refsect2" lang="en"><h3><a name="virResetError"/>virResetError ()</h3><pre class="programlisting">void      virResetError                   (<a href="libvirt-virterror.html#virErrorPtr">virErrorPtr</a> err)<br/>
 
215
</pre><p>Reset the error being pointed to</p>
 
216
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>pointer to the <a href="libvirt-virterror.html#virError">virError</a> to clean up</td></tr></tbody></table></div></div>
 
217
        <hr/>
 
218
        <div class="refsect2" lang="en"><h3><a name="virResetLastError"/>virResetLastError ()</h3><pre class="programlisting">void      virResetLastError               (void)<br/>
 
219
</pre><p>Reset the last error caught at the library level. The error object is kept in thread local storage, so separate threads can safely access this concurrently, only resetting their own error object.</p>
 
220
</div>
 
221
        <hr/>
 
222
        <div class="refsect2" lang="en"><h3><a name="virSetErrorFunc"/>virSetErrorFunc ()</h3><pre class="programlisting">void  virSetErrorFunc                 (void * userData, <br/>                                  <a href="libvirt-virterror.html#virErrorFunc">virErrorFunc</a> handler)<br/>
 
223
</pre><p>Set a library global error handling function, if @handler is NULL, it will reset to default printing on stderr. The error raised there are those for which no handler at the connection level could caught.</p>
 
224
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>pointer to the user data provided in the handler callback</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>the function to get called in case of error or NULL</td></tr></tbody></table></div></div>
 
225
        <hr/>
 
226
      </div>
 
227
    </div>
 
228
  </body>
 
229
</html>