提交 8557bc67 编写于 作者: D Daniel Veillard

* src/Makefile.am src/internal.h src/libvirt.c src/libvirt_sym.version

  src/virterror.c include/Makefile.am include/virterror.h: adding
  the public APIs for errors, callbacks and synchronous. The boring
  stuff is still left to do, plugging it. Also need to be exposed
  at the python level.
* doc//*: rebuilt
Daniel
上级 868f93ba
Fri Feb 24 23:33:55 CET 2006 Daniel Veillard <veillard@redhat.com>
* src/Makefile.am src/internal.h src/libvirt.c src/libvirt_sym.version
src/virterror.c include/Makefile.am include/virterror.h: adding
the public APIs for errors, callbacks and synchronous. The boring
stuff is still left to do, plugging it. Also need to be exposed
at the python level.
* doc//*: rebuilt
Fri Feb 24 22:17:12 CET 2006 Daniel Veillard <veillard@redhat.com>
* docs/index.py docs/search.php: fixing the search engine.
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -8,4 +8,6 @@
<a href="html/libvirt-libvirt.html#virDomainLookupByID">virDomainLookupByID</a><br />
<a href="html/libvirt-libvirt.html#virDomainLookupByName">virDomainLookupByName</a><br />
<a href="html/libvirt-libvirt.html#virDomainLookupByUUID">virDomainLookupByUUID</a><br />
</p><h2>Type virErrorPtr:</h2><p><a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a><br />
<a href="html/libvirt-virterror.html#virGetLastError">virGetLastError</a><br />
</p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">API Menu</a></li><li><a href="examples/index.html">C code examples</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
......@@ -58,4 +58,30 @@
<a href="html/libvirt-libvirt.html#virDomainState">virDomainState</a><br />
<a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
<a href="html/libvirt-libvirt.html#virGetVersion">virGetVersion</a><br />
</p><h2><a name="virterror" id="virterror">Module virterror</a>:</h2><p><a href="html/libvirt-virterror.html#VIR_ERR_ERROR">VIR_ERR_ERROR</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_INTERNAL_ERROR">VIR_ERR_INTERNAL_ERROR</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_NONE">VIR_ERR_NONE</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_NO_MEMORY">VIR_ERR_NO_MEMORY</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_OK">VIR_ERR_OK</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_WARNING">VIR_ERR_WARNING</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_DOM">VIR_FROM_DOM</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_NONE">VIR_FROM_NONE</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_XEN">VIR_FROM_XEN</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_XEND">VIR_FROM_XEND</a><br />
<a href="html/libvirt-virterror.html#_virError">_virError</a><br />
<a href="html/libvirt-virterror.html#virConnCopyLastError">virConnCopyLastError</a><br />
<a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a><br />
<a href="html/libvirt-virterror.html#virConnResetLastError">virConnResetLastError</a><br />
<a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a><br />
<a href="html/libvirt-virterror.html#virCopyLastError">virCopyLastError</a><br />
<a href="html/libvirt-virterror.html#virError">virError</a><br />
<a href="html/libvirt-virterror.html#virErrorDomain">virErrorDomain</a><br />
<a href="html/libvirt-virterror.html#virErrorFunc">virErrorFunc</a><br />
<a href="html/libvirt-virterror.html#virErrorLevel">virErrorLevel</a><br />
<a href="html/libvirt-virterror.html#virErrorNumber">virErrorNumber</a><br />
<a href="html/libvirt-virterror.html#virErrorPtr">virErrorPtr</a><br />
<a href="html/libvirt-virterror.html#virGetLastError">virGetLastError</a><br />
<a href="html/libvirt-virterror.html#virResetError">virResetError</a><br />
<a href="html/libvirt-virterror.html#virResetLastError">virResetLastError</a><br />
<a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
</p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">API Menu</a></li><li><a href="examples/index.html">C code examples</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
......@@ -7,7 +7,11 @@
</p><h2>Type unsigned long:</h2><p><a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
</p><h2>Type unsigned long *:</h2><p><a href="html/libvirt-libvirt.html#virConnectGetVersion">virConnectGetVersion</a><br />
<a href="html/libvirt-libvirt.html#virGetVersion">virGetVersion</a><br />
</p><h2>Type virConnectPtr:</h2><p><a href="html/libvirt-libvirt.html#virConnectClose">virConnectClose</a><br />
</p><h2>Type virConnectPtr:</h2><p><a href="html/libvirt-virterror.html#virConnCopyLastError">virConnCopyLastError</a><br />
<a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a><br />
<a href="html/libvirt-virterror.html#virConnResetLastError">virConnResetLastError</a><br />
<a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a><br />
<a href="html/libvirt-libvirt.html#virConnectClose">virConnectClose</a><br />
<a href="html/libvirt-libvirt.html#virConnectGetType">virConnectGetType</a><br />
<a href="html/libvirt-libvirt.html#virConnectGetVersion">virConnectGetVersion</a><br />
<a href="html/libvirt-libvirt.html#virConnectListDomains">virConnectListDomains</a><br />
......@@ -32,4 +36,13 @@
<a href="html/libvirt-libvirt.html#virDomainSetMaxMemory">virDomainSetMaxMemory</a><br />
<a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
<a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
</p><h2>Type virErrorFunc:</h2><p><a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a><br />
<a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
</p><h2>Type virErrorPtr:</h2><p><a href="html/libvirt-virterror.html#virConnCopyLastError">virConnCopyLastError</a><br />
<a href="html/libvirt-virterror.html#virCopyLastError">virCopyLastError</a><br />
<a href="html/libvirt-virterror.html#virErrorFunc">virErrorFunc</a><br />
<a href="html/libvirt-virterror.html#virResetError">virResetError</a><br />
</p><h2>Type void *:</h2><p><a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a><br />
<a href="html/libvirt-virterror.html#virErrorFunc">virErrorFunc</a><br />
<a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
</p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">API Menu</a></li><li><a href="examples/index.html">C code examples</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
......@@ -17,9 +17,24 @@
<a href="html/libvirt-libvirt.html#VIR_DOMAIN_RUNNING">VIR_DOMAIN_RUNNING</a><br />
<a href="html/libvirt-libvirt.html#VIR_DOMAIN_SHUTDOWN">VIR_DOMAIN_SHUTDOWN</a><br />
<a href="html/libvirt-libvirt.html#VIR_DOMAIN_SHUTOFF">VIR_DOMAIN_SHUTOFF</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_ERROR">VIR_ERR_ERROR</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_INTERNAL_ERROR">VIR_ERR_INTERNAL_ERROR</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_NONE">VIR_ERR_NONE</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_NO_MEMORY">VIR_ERR_NO_MEMORY</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_OK">VIR_ERR_OK</a><br />
<a href="html/libvirt-virterror.html#VIR_ERR_WARNING">VIR_ERR_WARNING</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_DOM">VIR_FROM_DOM</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_NONE">VIR_FROM_NONE</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_XEN">VIR_FROM_XEN</a><br />
<a href="html/libvirt-virterror.html#VIR_FROM_XEND">VIR_FROM_XEND</a><br />
</p><h2>Letter _:</h2><p><a href="html/libvirt-libvirt.html#_virDomainInfo">_virDomainInfo</a><br />
<a href="html/libvirt-libvirt.html#_virDomainKernel">_virDomainKernel</a><br />
</p><h2>Letter v:</h2><p><a href="html/libvirt-libvirt.html#virConnect">virConnect</a><br />
<a href="html/libvirt-virterror.html#_virError">_virError</a><br />
</p><h2>Letter v:</h2><p><a href="html/libvirt-virterror.html#virConnCopyLastError">virConnCopyLastError</a><br />
<a href="html/libvirt-virterror.html#virConnGetLastError">virConnGetLastError</a><br />
<a href="html/libvirt-virterror.html#virConnResetLastError">virConnResetLastError</a><br />
<a href="html/libvirt-virterror.html#virConnSetErrorFunc">virConnSetErrorFunc</a><br />
<a href="html/libvirt-libvirt.html#virConnect">virConnect</a><br />
<a href="html/libvirt-libvirt.html#virConnectClose">virConnectClose</a><br />
<a href="html/libvirt-libvirt.html#virConnectGetType">virConnectGetType</a><br />
<a href="html/libvirt-libvirt.html#virConnectGetVersion">virConnectGetVersion</a><br />
......@@ -28,6 +43,7 @@
<a href="html/libvirt-libvirt.html#virConnectOpen">virConnectOpen</a><br />
<a href="html/libvirt-libvirt.html#virConnectOpenReadOnly">virConnectOpenReadOnly</a><br />
<a href="html/libvirt-libvirt.html#virConnectPtr">virConnectPtr</a><br />
<a href="html/libvirt-virterror.html#virCopyLastError">virCopyLastError</a><br />
<a href="html/libvirt-libvirt.html#virDeviceMode">virDeviceMode</a><br />
<a href="html/libvirt-libvirt.html#virDomain">virDomain</a><br />
<a href="html/libvirt-libvirt.html#virDomainCreateFlags">virDomainCreateFlags</a><br />
......@@ -57,5 +73,15 @@
<a href="html/libvirt-libvirt.html#virDomainShutdown">virDomainShutdown</a><br />
<a href="html/libvirt-libvirt.html#virDomainState">virDomainState</a><br />
<a href="html/libvirt-libvirt.html#virDomainSuspend">virDomainSuspend</a><br />
<a href="html/libvirt-virterror.html#virError">virError</a><br />
<a href="html/libvirt-virterror.html#virErrorDomain">virErrorDomain</a><br />
<a href="html/libvirt-virterror.html#virErrorFunc">virErrorFunc</a><br />
<a href="html/libvirt-virterror.html#virErrorLevel">virErrorLevel</a><br />
<a href="html/libvirt-virterror.html#virErrorNumber">virErrorNumber</a><br />
<a href="html/libvirt-virterror.html#virErrorPtr">virErrorPtr</a><br />
<a href="html/libvirt-virterror.html#virGetLastError">virGetLastError</a><br />
<a href="html/libvirt-libvirt.html#virGetVersion">virGetVersion</a><br />
<a href="html/libvirt-virterror.html#virResetError">virResetError</a><br />
<a href="html/libvirt-virterror.html#virResetLastError">virResetLastError</a><br />
<a href="html/libvirt-virterror.html#virSetErrorFunc">virSetErrorFunc</a><br />
</p></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">API Menu</a></li><li><a href="examples/index.html">C code examples</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvirt</h1><h2>Table of Contents</h2><ul><li><a href="libvirt-libvirt.html">libvirt</a>: core interfaces for the libvirt library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvirt</h1><h2>Table of Contents</h2><ul><li><a href="libvirt-libvirt.html">libvirt</a>: core interfaces for the libvirt library</li><li><a href="libvirt-virterror.html">virterror</a>: error handling interfaces for the libvirt library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvirt</h1><h2>Table of Contents</h2><ul><li><a href="libvirt-libvirt.html">libvirt</a>: core interfaces for the libvirt library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvirt</h1><h2>Table of Contents</h2><ul><li><a href="libvirt-libvirt.html">libvirt</a>: core interfaces for the libvirt library</li><li><a href="libvirt-virterror.html">virterror</a>: error handling interfaces for the libvirt library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvirt</h1><h2>Table of Contents</h2><ul><li><a href="libvirt-libvirt.html">libvirt</a>: core interfaces for the libvirt library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Reference Manual for libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Reference Manual for libvirt</h1><h2>Table of Contents</h2><ul><li><a href="libvirt-libvirt.html">libvirt</a>: core interfaces for the libvirt library</li><li><a href="libvirt-virterror.html">virterror</a>: error handling interfaces for the libvirt library</li></ul></div></div><div class="linkList2"><div class="llinks2"><h3 class="links2"><span>main menu</span></h3><ul><li><a href="../index.html">Home</a></li><li><a href="../html/index.html">API Menu</a></li><li><a href="../examples/index.html">C code examples</a></li><li><a href="../ChangeLog.html">Recent Changes</a></li></ul></div><div class="llinks2"><h3 class="links2"><span>related links</span></h3><ul><li><a href="https://www.redhat.com/archives/libvir-list/">Mail archive</a></li><li><a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html">Xen project</a></li><li><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="12" value="Search..." /><input name="submit" type="submit" value="Go" /></form></li><li><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-90x34.gif" alt="Made with Libxml2 Logo" /></a></li></ul><p class="credits">Graphics and design by <a href="mail:dfong@redhat.com">Diana Fong</a></p></div></div><div id="bottom"><p class="p1"></p></div></div></body></html>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Module libvirt from libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Module libvirt from libvirt</h1><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The virtualization API</a></th></tr></table><p>Provides the interfaces of the libvirt library to handle Xen domains from a process running in domain 0 </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a></pre><pre class="programlisting">Structure <a href="#virConnect">virConnect</a><br />struct _virConnect
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /><link rel="stylesheet" type="text/css" href="../libvirt.css" /><link rel="SHORTCUT ICON" href="/32favicon.png" /><title>Module libvirt from libvirt</title></head><body><div id="container"><div id="intro"><div id="adjustments"></div><div id="pageHeader"></div><div id="content2"><h1 class="style1">Module libvirt from libvirt</h1><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The virtualization API</a></th><th align="right"><a href="libvirt-virterror.html">virterror</a></th><td><a accesskey="n" href="libvirt-virterror.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>Provides the interfaces of the libvirt library to handle Xen domains from a process running in domain 0 </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBVIR_VERSION_NUMBER">LIBVIR_VERSION_NUMBER</a></pre><pre class="programlisting">Structure <a href="#virConnect">virConnect</a><br />struct _virConnect
The content of this structure is not made public by the API.
</pre><pre class="programlisting">Typedef <a href="libvirt-libvirt.html#virConnect">virConnect</a> * <a name="virConnectPtr" id="virConnectPtr">virConnectPtr</a>
</pre><pre class="programlisting">Enum <a href="#virDeviceMode">virDeviceMode</a>
......
......@@ -64,6 +64,37 @@
<exports symbol='virDomainGetName' type='function'/>
<exports symbol='virConnectOpenReadOnly' type='function'/>
</file>
<file name='virterror'>
<summary>error handling interfaces for the libvirt library</summary>
<description>Provides the interfaces of the libvirt library to handle errors raised while using the library. </description>
<author>Daniel Veillard &lt;veillard@redhat.com&gt; </author>
<exports symbol='VIR_ERR_INTERNAL_ERROR' type='enum'/>
<exports symbol='VIR_ERR_NONE' type='enum'/>
<exports symbol='VIR_ERR_OK' type='enum'/>
<exports symbol='VIR_FROM_DOM' type='enum'/>
<exports symbol='VIR_ERR_WARNING' type='enum'/>
<exports symbol='VIR_FROM_XEND' type='enum'/>
<exports symbol='VIR_FROM_NONE' type='enum'/>
<exports symbol='VIR_ERR_ERROR' type='enum'/>
<exports symbol='VIR_FROM_XEN' type='enum'/>
<exports symbol='VIR_ERR_NO_MEMORY' type='enum'/>
<exports symbol='virErrorPtr' type='typedef'/>
<exports symbol='virErrorLevel' type='typedef'/>
<exports symbol='virErrorDomain' type='typedef'/>
<exports symbol='virErrorNumber' type='typedef'/>
<exports symbol='virError' type='typedef'/>
<exports symbol='_virError' type='struct'/>
<exports symbol='virCopyLastError' type='function'/>
<exports symbol='virConnSetErrorFunc' type='function'/>
<exports symbol='virResetLastError' type='function'/>
<exports symbol='virErrorFunc' type='function'/>
<exports symbol='virResetError' type='function'/>
<exports symbol='virConnGetLastError' type='function'/>
<exports symbol='virGetLastError' type='function'/>
<exports symbol='virSetErrorFunc' type='function'/>
<exports symbol='virConnCopyLastError' type='function'/>
<exports symbol='virConnResetLastError' type='function'/>
</file>
</files>
<symbols>
<macro name='LIBVIR_VERSION_NUMBER' file='libvirt'>
......@@ -85,6 +116,16 @@
<enum name='VIR_DOMAIN_RUNNING' file='libvirt' value='1' type='virDomainState' info='the domain is running'/>
<enum name='VIR_DOMAIN_SHUTDOWN' file='libvirt' value='4' type='virDomainState' info='the domain is being shut down'/>
<enum name='VIR_DOMAIN_SHUTOFF' file='libvirt' value='5' type='virDomainState' info='the domain is shut off'/>
<enum name='VIR_ERR_ERROR' file='virterror' value='2' type='virErrorLevel' info=' An error'/>
<enum name='VIR_ERR_INTERNAL_ERROR' file='virterror' value='1' type='virErrorNumber' info='1'/>
<enum name='VIR_ERR_NONE' file='virterror' value='0' type='virErrorLevel'/>
<enum name='VIR_ERR_NO_MEMORY' file='virterror' value='2' type='virErrorNumber' info=' 2'/>
<enum name='VIR_ERR_OK' file='virterror' value='0' type='virErrorNumber'/>
<enum name='VIR_ERR_WARNING' file='virterror' value='1' type='virErrorLevel' info='A simple warning'/>
<enum name='VIR_FROM_DOM' file='virterror' value='3' type='virErrorDomain' info=' Error when operating on a domain'/>
<enum name='VIR_FROM_NONE' file='virterror' value='0' type='virErrorDomain'/>
<enum name='VIR_FROM_XEN' file='virterror' value='1' type='virErrorDomain' info='Error at Xen hypervisor layer'/>
<enum name='VIR_FROM_XEND' file='virterror' value='2' type='virErrorDomain' info='Error at connection with xend daemon'/>
<struct name='virConnect' file='libvirt' type='struct _virConnect'/>
<typedef name='virConnectPtr' file='libvirt' type='virConnect *'>
<info>a virConnectPtr is pointer to a virConnect private structure, this is the type used to reference a connection to the Xen Hypervisor in the API.</info>
......@@ -122,6 +163,46 @@
</typedef>
<typedef name='virDomainRestart' file='libvirt' type='enum'/>
<typedef name='virDomainState' file='libvirt' type='enum'/>
<struct name='virError' file='virterror' type='struct _virError'>
<field name='code' type='int' info=' The error code, e.g. an virParserError'/>
<field name='domain' type='int' info=' What part of the library raised this error'/>
<field name='message' type='char *' info=' human-readable informative error message'/>
<field name='level' type='virErrorLevel' info=' how consequent is the error'/>
<field name='conn' type='virConnectPtr' info=' the connection if available'/>
<field name='dom' type='virDomainPtr' info=' the domain if available'/>
<field name='str1' type='char *' info=' extra string information'/>
<field name='str2' type='char *' info=' extra string information'/>
<field name='str3' type='char *' info=' extra string information'/>
<field name='int1' type='int' info=' extra number information'/>
<field name='int2' type='int' info=' extra number information'/>
</struct>
<typedef name='virErrorDomain' file='virterror' type='enum'/>
<typedef name='virErrorLevel' file='virterror' type='enum'/>
<typedef name='virErrorNumber' file='virterror' type='enum'/>
<typedef name='virErrorPtr' file='virterror' type='virError *'/>
<function name='virConnCopyLastError' file='virterror' module='virterror'>
<info>Copy the content of the last error caught on that connection One will need to free the result with virResetError()</info>
<return type='int' info='0 if no error was found and the error code otherwise and -1 in case of parameter error.'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
<arg name='to' type='virErrorPtr' info='target to receive the copy'/>
</function>
<function name='virConnGetLastError' file='virterror' module='virterror'>
<info>Provide a pointer to the last error caught on that connection Simpler but may not be suitable for multithreaded accesses, in which case use virConnCopyLastError()</info>
<return type='virErrorPtr' info='a pointer to the last error or NULL if none occured.'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
</function>
<function name='virConnResetLastError' file='virterror' module='virterror'>
<info>Reset the last error caught on that connection</info>
<return type='void'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
</function>
<function name='virConnSetErrorFunc' file='virterror' module='virterror'>
<info>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.</info>
<return type='void'/>
<arg name='conn' type='virConnectPtr' info='pointer to the hypervisor connection'/>
<arg name='userData' type='void *' info='pointer to the user data provided in the handler callback'/>
<arg name='handler' type='virErrorFunc' info='the function to get called in case of error or NULL'/>
</function>
<function name='virConnectClose' file='libvirt' module='libvirt'>
<info>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.</info>
<return type='int' info='0 in case of success or -1 in case of error.'/>
......@@ -160,6 +241,11 @@
<return type='virConnectPtr' info='a pointer to the hypervisor connection or NULL in case of error'/>
<arg name='name' type='const char *' info='optional argument currently unused, pass NULL'/>
</function>
<function name='virCopyLastError' file='virterror' module='virterror'>
<info>Copy the content of the last error caught at the library level One will need to free the result with virResetError()</info>
<return type='int' info='0 if no error was found and the error code otherwise and -1 in case of parameter error.'/>
<arg name='to' type='virErrorPtr' info='target to receive the copy'/>
</function>
<function name='virDomainCreateLinux' file='libvirt' module='libvirt'>
<info>Launch a new Linux guest domain, based on an XML description similar to the one returned by virDomainGetXMLDesc() This function may requires priviledged access to the hypervisor.</info>
<return type='virDomainPtr' info='a new domain object or NULL in case of failure'/>
......@@ -266,6 +352,16 @@
<return type='int' info='0 in case of success and -1 in case of failure.'/>
<arg name='domain' type='virDomainPtr' info='a domain object'/>
</function>
<functype name='virErrorFunc' file='virterror' module='virterror'>
<info>Signature of a function to use when there is an error raised by the library.</info>
<return type='void'/>
<arg name='userData' type='void *' info='user provided data for the error callback'/>
<arg name='error' type='virErrorPtr' info='the error being raised.'/>
</functype>
<function name='virGetLastError' file='virterror' module='virterror'>
<info>Provide a pointer to the last error caught at the library level Simpler but may not be suitable for multithreaded accesses, in which case use virCopyLastError()</info>
<return type='virErrorPtr' info='a pointer to the last error or NULL if none occured.'/>
</function>
<function name='virGetVersion' file='libvirt' module='libvirt'>
<info>Provides two information back, @libVer is the version of the library while @typeVer will be the version of the hypervisor type @type against which the library was compiled. If @type is NULL, &quot;Xen&quot; is assumed, if @type is unknown or not availble, an error code will be returned and @typeVer will be 0.</info>
<return type='int' info='-1 in case of failure, 0 otherwise, and values for @libVer and @typeVer have the format major * 1,000,000 + minor * 1,000 + release.'/>
......@@ -273,5 +369,20 @@
<arg name='type' type='const char *' info='hypervisor type'/>
<arg name='typeVer' type='unsigned long *' info='return value for the version of the hypervisor (OUT)'/>
</function>
<function name='virResetError' file='virterror' module='virterror'>
<info>Reset the error being pointed to</info>
<return type='void'/>
<arg name='err' type='virErrorPtr' info='pointer to the virError to clean up'/>
</function>
<function name='virResetLastError' file='virterror' module='virterror'>
<info>Reset the last error caught at the library level.</info>
<return type='void'/>
</function>
<function name='virSetErrorFunc' file='virterror' module='virterror'>
<info>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.</info>
<return type='void'/>
<arg name='userData' type='void *' info='pointer to the user data provided in the handler callback'/>
<arg name='handler' type='virErrorFunc' info='the function to get called in case of error or NULL'/>
</function>
</symbols>
</api>
此差异已折叠。
......@@ -2,7 +2,8 @@
virincdir = $(includedir)/libvirt
virinc_HEADERS = libvirt.h
virinc_HEADERS = libvirt.h \
virterror.h
install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(virincdir)
......
......@@ -2,7 +2,8 @@
virincdir = $(includedir)/libvirt
virinc_HEADERS = libvirt.h
virinc_HEADERS = libvirt.h \
virterror.h
install-exec-hook:
$(mkinstalldirs) $(DESTDIR)$(virincdir)
......
/*
* virterror.h:
* Summary: error handling interfaces for the libvirt library
* Description: Provides the interfaces of the libvirt library to handle
* errors raised while using the library.
*
* Copy: Copyright (C) 2006 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
* Author: Daniel Veillard <veillard@redhat.com>
*/
#ifndef __VIR_VIRERR_H__
#define __VIR_VIRERR_H__
#include <libvirt.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* virErrorLevel:
*
* Indicates the level of an error
*/
typedef enum {
VIR_ERR_NONE = 0,
VIR_ERR_WARNING = 1, /* A simple warning */
VIR_ERR_ERROR = 2 /* An error */
} virErrorLevel;
/**
* virErrorDomain:
*
* Indicates where an error may have come from
*/
typedef enum {
VIR_FROM_NONE = 0,
VIR_FROM_XEN, /* Error at Xen hypervisor layer */
VIR_FROM_XEND, /* Error at connection with xend daemon */
VIR_FROM_DOM /* Error when operating on a domain */
} virErrorDomain;
/**
* virError:
*
* A libvirt Error instance.
*/
typedef struct _virError virError;
typedef virError *virErrorPtr;
struct _virError {
int code; /* The error code, e.g. an virParserError */
int domain; /* What part of the library raised this error */
char *message;/* human-readable informative error message */
virErrorLevel level;/* how consequent is the error */
virConnectPtr conn; /* the connection if available */
virDomainPtr dom; /* the domain if available */
char *str1; /* extra string information */
char *str2; /* extra string information */
char *str3; /* extra string information */
int int1; /* extra number information */
int int2; /* extra number information */
};
/**
* virErrorNumber:
*
* The full list of errors the library can generate
*/
typedef enum {
VIR_ERR_OK = 0,
VIR_ERR_INTERNAL_ERROR, /* 1 */
VIR_ERR_NO_MEMORY /* 2 */
} virErrorNumber;
/**
* virErrorFunc:
* @userData: user provided data for the error callback
* @error: the error being raised.
*
* Signature of a function to use when there is an error raised by the library.
*/
typedef void (*virErrorFunc) (void *userData, virErrorPtr error);
/*
* Errors can be handled as asynchronous callbacks or after the routine
* failed. They can also be handled globally at the library level, or
* at the connection level (which then has priority
*/
virErrorPtr virGetLastError (void);
void virResetLastError (void);
void virResetError (virErrorPtr err);
virErrorPtr virConnGetLastError (virConnectPtr conn);
void virConnResetLastError (virConnectPtr conn);
int virCopyLastError (virErrorPtr to);
void virSetErrorFunc (void *userData,
virErrorFunc handler);
void virConnSetErrorFunc (virConnectPtr conn,
void *userData,
virErrorFunc handler);
int virConnCopyLastError (virConnectPtr conn,
virErrorPtr to);
#ifdef __cplusplus
}
#endif
#endif /* __VIR_VIRERR_H__ */
/*
* virterror.h:
* Summary: error handling interfaces for the libvirt library
* Description: Provides the interfaces of the libvirt library to handle
* errors raised while using the library.
*
* Copy: Copyright (C) 2006 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
* Author: Daniel Veillard <veillard@redhat.com>
*/
#ifndef __VIR_VIRERR_H__
#define __VIR_VIRERR_H__
#include <libvirt.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* virErrorLevel:
*
* Indicates the level of an error
*/
typedef enum {
VIR_ERR_NONE = 0,
VIR_ERR_WARNING = 1, /* A simple warning */
VIR_ERR_ERROR = 2 /* An error */
} virErrorLevel;
/**
* virErrorDomain:
*
* Indicates where an error may have come from
*/
typedef enum {
VIR_FROM_NONE = 0,
VIR_FROM_XEN, /* Error at Xen hypervisor layer */
VIR_FROM_XEND, /* Error at connection with xend daemon */
VIR_FROM_DOM /* Error when operating on a domain */
} virErrorDomain;
/**
* virError:
*
* A libvirt Error instance.
*/
typedef struct _virError virError;
typedef virError *virErrorPtr;
struct _virError {
int code; /* The error code, e.g. an virParserError */
int domain; /* What part of the library raised this error */
char *message;/* human-readable informative error message */
virErrorLevel level;/* how consequent is the error */
virConnectPtr conn; /* the connection if available */
virDomainPtr dom; /* the domain if available */
char *str1; /* extra string information */
char *str2; /* extra string information */
char *str3; /* extra string information */
int int1; /* extra number information */
int int2; /* extra number information */
};
/**
* virErrorNumber:
*
* The full list of errors the library can generate
*/
typedef enum {
VIR_ERR_OK = 0,
VIR_ERR_INTERNAL_ERROR, /* 1 */
VIR_ERR_NO_MEMORY /* 2 */
} virErrorNumber;
/**
* virErrorFunc:
* @userData: user provided data for the error callback
* @error: the error being raised.
*
* Signature of a function to use when there is an error raised by the library.
*/
typedef void (*virErrorFunc) (void *userData, virErrorPtr error);
/*
* Errors can be handled as asynchronous callbacks or after the routine
* failed. They can also be handled globally at the library level, or
* at the connection level (which then has priority
*/
virErrorPtr virGetLastError (void);
void virResetLastError (void);
void virResetError (virErrorPtr err);
virErrorPtr virConnGetLastError (virConnectPtr conn);
void virConnResetLastError (virConnectPtr conn);
int virCopyLastError (virErrorPtr to);
void virSetErrorFunc (void *userData,
virErrorFunc handler);
void virConnSetErrorFunc (virConnectPtr conn,
void *userData,
virErrorFunc handler);
int virConnCopyLastError (virConnectPtr conn,
virErrorPtr to);
#ifdef __cplusplus
}
#endif
#endif /* __VIR_VIRERR_H__ */
......@@ -14,10 +14,11 @@ libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
libvirt_la_SOURCES = \
libvirt.c internal.h \
hash.c hash.h \
xml.c xml.h \
xml.c xml.h \
xen_internal.c xen_internal.h \
xend_internal.c xend_internal.h \
sexpr.c sexpr.h
sexpr.c sexpr.h \
virterror.c
bin_PROGRAMS=virsh
......
......@@ -13,6 +13,7 @@
#include "hash.h"
#include "libvirt.h"
#include "virterror.h"
#ifdef __cplusplus
extern "C" {
......@@ -85,8 +86,14 @@ struct _virConnect {
struct sockaddr_un addr_un; /* the unix address */
struct sockaddr_in addr_in; /* the inet address */
/* error stuff */
virError err; /* the last error */
virErrorFunc handler; /* associated handlet */
void *userData; /* the user data */
/* misc */
virHashTablePtr domains; /* hash table for known domains */
int flags; /* a set of connection flags */
int flags; /* a set of connection flags */
};
/**
......
......@@ -688,7 +688,7 @@ virDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) {
char **names;
char **tmp;
unsigned char ident[16];
int id;
int id = -1;
if (!VIR_IS_CONNECT(conn))
return(NULL);
......
......@@ -27,5 +27,15 @@
virDomainShutdown;
virDomainSuspend;
virGetVersion;
virCopyLastError;
virConnSetErrorFunc;
virResetLastError;
virErrorFunc;
virResetError;
virConnGetLastError;
virGetLastError;
virSetErrorFunc;
virConnCopyLastError;
virConnResetLastError;
local: *;
};
/*
* virterror.c: implements error handling and reporting code for libvirt
*
* Copy: Copyright (C) 2006 Red Hat, Inc.
*
* See COPYING.LIB for the License of this software
*
* Author: Daniel Veillard <veillard@redhat.com>
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libvirt.h"
#include "virterror.h"
#include "internal.h"
static virError lastErr = /* the last error */
{ 0, 0, NULL, VIR_ERR_NONE, NULL, NULL, NULL, NULL, NULL, 0, 0};
static virErrorFunc virErrorHandler = NULL;/* global error handlet */
static void *virUserData = NULL; /* associated data */
/*
* virGetLastError:
*
* Provide a pointer to the last error caught at the library level
* Simpler but may not be suitable for multithreaded accesses, in which
* case use virCopyLastError()
*
* Returns a pointer to the last error or NULL if none occured.
*/
virErrorPtr
virGetLastError(void) {
if (lastErr.code == VIR_ERR_OK)
return(NULL);
return(&lastErr);
}
/*
* virCopyLastError:
* @to: target to receive the copy
*
* Copy the content of the last error caught at the library level
* One will need to free the result with virResetError()
*
* Returns 0 if no error was found and the error code otherwise and -1 in case
* of parameter error.
*/
int
virCopyLastError(virErrorPtr to) {
if (to == NULL)
return(-1);
if (lastErr.code == VIR_ERR_OK)
return(0);
memcpy(to, &lastErr, sizeof(virError));
return(lastErr.code);
}
/**
* virResetError:
* @err: pointer to the virError to clean up
*
* Reset the error being pointed to
*/
void
virResetError(virErrorPtr err) {
if (err == NULL)
return;
if (err->message != NULL)
free(err->message);
if (err->str1 != NULL)
free(err->str1);
if (err->str2 != NULL)
free(err->str2);
if (err->str3 != NULL)
free(err->str3);
memset(err, 0, sizeof(virError));
}
/**
* virResetLastError:
*
* Reset the last error caught at the library level.
*/
void
virResetLastError(void) {
virResetError(&lastErr);
}
/**
* virConnGetLastError:
* @conn: pointer to the hypervisor connection
*
* Provide a pointer to the last error caught on that connection
* Simpler but may not be suitable for multithreaded accesses, in which
* case use virConnCopyLastError()
*
* Returns a pointer to the last error or NULL if none occured.
*/
virErrorPtr
virConnGetLastError(virConnectPtr conn) {
if (conn == NULL)
return(NULL);
return(&conn->err);
}
/**
* virConnCopyLastError:
* @conn: pointer to the hypervisor connection
* @to: target to receive the copy
*
* Copy the content of the last error caught on that connection
* One will need to free the result with virResetError()
*
* Returns 0 if no error was found and the error code otherwise and -1 in case
* of parameter error.
*/
int
virConnCopyLastError(virConnectPtr conn, virErrorPtr to) {
if (conn == NULL)
return(-1);
if (to == NULL)
return(-1);
if (conn->err.code == VIR_ERR_OK)
return(0);
memcpy(to, &conn->err, sizeof(virError));
return(conn->err.code);
}
/**
* virConnResetLastError:
* @conn: pointer to the hypervisor connection
*
* Reset the last error caught on that connection
*/
void
virConnResetLastError(virConnectPtr conn) {
if (conn == NULL)
return;
virResetError(&conn->err);
}
/**
* virSetErrorFunc:
* @userData: pointer to the user data provided in the handler callback
* @handler: the function to get called in case of error or NULL
*
* 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.
*/
void
virSetErrorFunc(void *userData, virErrorFunc handler) {
virErrorHandler = handler;
virUserData = userData;
}
/**
* virConnSetErrorFunc:
* @conn: pointer to the hypervisor connection
* @userData: pointer to the user data provided in the handler callback
* @handler: the function to get called in case of error or NULL
*
* 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.
*/
void
virConnSetErrorFunc(virConnectPtr conn, void *userData, virErrorFunc handler) {
if (conn == NULL)
return;
conn->handler = handler;
conn->userData = userData;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册