libvirt/docs/html/libvirt-conf.html

45 lines
10 KiB
HTML
Raw Normal View History

<?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 conf 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 conf from libvirt</h1><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libvirt-virterror.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libvirt-virterror.html">virterror</a></th><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><h2>Table of Contents</h2><pre class="programlisting">Structure <a href="#virConf">virConf</a><br />struct _virConf
The content of this structure is not made public by the API.
</pre><pre class="programlisting">Typedef <a href="libvirt-conf.html#virConf">virConf</a> * <a name="virConfPtr" id="virConfPtr">virConfPtr</a>
</pre><pre class="programlisting">Enum <a href="#virConfType">virConfType</a>
</pre><pre class="programlisting">Structure <a href="#virConfValue">virConfValue</a><br />struct _virConfValue
</pre><pre class="programlisting">Typedef <a href="libvirt-conf.html#virConfValue">virConfValue</a> * <a name="virConfValuePtr" id="virConfValuePtr">virConfValuePtr</a>
</pre><pre class="programlisting">int <a href="#virConfFree">virConfFree</a> (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)</pre>
<pre class="programlisting"><a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> <a href="#virConfGetValue">virConfGetValue</a> (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf, <br /> const char * setting)</pre>
<pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> <a href="#virConfReadFile">virConfReadFile</a> (const char * filename)</pre>
<pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> <a href="#virConfReadMem">virConfReadMem</a> (const char * memory, <br /> int len)</pre>
<pre class="programlisting">int <a href="#virConfWriteFile">virConfWriteFile</a> (const char * filename, <br /> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)</pre>
<pre class="programlisting">int <a href="#virConfWriteMem">virConfWriteMem</a> (char * memory, <br /> int * len, <br /> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)</pre>
<h2>Description</h2>
<h3><a name="virConf" id="virConf">Structure virConf</a></h3><pre class="programlisting">Structure virConf<br />struct _virConf {
The content of this structure is not made public by the API.
}</pre>
a pointer to a parsed configuration file
<h3>Enum <a name="virConfType" id="virConfType">virConfType</a></h3><pre class="programlisting">Enum virConfType {
<a name="VIR_CONF_NONE" id="VIR_CONF_NONE">VIR_CONF_NONE</a> = 0 : undefined
<a name="VIR_CONF_LONG" id="VIR_CONF_LONG">VIR_CONF_LONG</a> = 1 : a long int
<a name="VIR_CONF_STRING" id="VIR_CONF_STRING">VIR_CONF_STRING</a> = 2 : a string
<a name="VIR_CONF_LIST" id="VIR_CONF_LIST">VIR_CONF_LIST</a> = 3 : a list
}
</pre><h3><a name="virConfValue" id="virConfValue">Structure virConfValue</a></h3><pre class="programlisting">Structure virConfValue<br />struct _virConfValue {
<a href="libvirt-conf.html#virConfType">virConfType</a> type : the <a href="libvirt-conf.html#virConfType">virConfType</a>
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> next : next element if in a list
long l : long integer
char * str : pointer to 0 terminated string
<a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> list : list of a list
}</pre><h3><a name="virConfFree" id="virConfFree"></a>Function: virConfFree</h3><pre class="programlisting">int virConfFree (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br />
</pre><p>Frees all data associated to the handle</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>a configuration file handle</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error.</td></tr></tbody></table></div><h3><a name="virConfGetValue" id="virConfGetValue"></a>Function: virConfGetValue</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfValuePtr">virConfValuePtr</a> virConfGetValue (<a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf, <br /> const char * setting)<br />
</pre><p>Lookup the value associated to this entry in the configuration file</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>a configuration file handle</td></tr><tr><td><span class="term"><i><tt>setting</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the value or NULL if the lookup failed, the data associated will be freed when virConfFree() is called</td></tr></tbody></table></div><h3><a name="virConfReadFile" id="virConfReadFile"></a>Function: virConfReadFile</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> virConfReadFile (const char * filename)<br />
</pre><p>Reads a configuration file.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the path to the configuration file.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an handle to lookup settings or NULL if it failed to read or parse the file, use virConfFree() to free the data.</td></tr></tbody></table></div><h3><a name="virConfReadMem" id="virConfReadMem"></a>Function: virConfReadMem</h3><pre class="programlisting"><a href="libvirt-conf.html#virConfPtr">virConfPtr</a> virConfReadMem (const char * memory, <br /> int len)<br />
</pre><p>Reads a configuration file loaded in memory. The string can be zero terminated in which case @len can be 0</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>pointer to the content of the configuration file</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>lenght in byte</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an handle to lookup settings or NULL if it failed to parse the content, use virConfFree() to free the data.</td></tr></tbody></table></div><h3><a name="virConfWriteFile" id="virConfWriteFile"></a>Function: virConfWriteFile</h3><pre class="programlisting">int virConfWriteFile (const char * filename, <br /> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br />
</pre><p>Writes a configuration file back to a file.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the path to the configuration file.</td></tr><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>the conf</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error.</td></tr></tbody></table></div><h3><a name="virConfWriteMem" id="virConfWriteMem"></a>Function: virConfWriteMem</h3><pre class="programlisting">int virConfWriteMem (char * memory, <br /> int * len, <br /> <a href="libvirt-conf.html#virConfPtr">virConfPtr</a> conf)<br />
</pre><p>Writes a configuration file back to a memory area. @len is an IN/OUT parameter, it indicates the size available in bytes, and on output the size required for the configuration file (even if the call fails due to insufficient space).</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>memory</tt></i>:</span></td><td>pointer to the memory to store the config file</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>pointer to the lenght in byte of the store, on output the size</td></tr><tr><td><span class="term"><i><tt>conf</tt></i>:</span></td><td>the conf</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written or -1 in case of error.</td></tr></tbody></table></div></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="https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&amp;component=libvirt&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=MODIFIED&amp;short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr">Open bugs</a></li><li><a href="http://virt-manager.et.redhat.com/">virt-manager</a></li><li><a href="http://search.cpan.org/~danberr/Sys-Virt-0.1.0/">Perl bindings</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>