<?xml version="1.0"?>
<html>
  <body>
<h1>PHP API Reference guide</h1>

    <h3>Functions</h3>

    <!-- Links -->
<pre>Total number of functions: 8. Functions supported are:<br /><br />
	<code class="docref">libvirt_get_last_error</code>()<br />
	<code class="docref">libvirt_image_create</code>($conn, $name, $size, $format)<br />
	<code class="docref">libvirt_image_remove</code>($conn, $image)<br />
	<code class="docref">libvirt_version</code>($type)<br />
	<code class="docref">libvirt_check_version</code>($major, $minor, $micro, $type)<br />
	<code class="docref">libvirt_has_feature</code>($name)<br />
	<code class="docref">libvirt_get_iso_images</code>($path)<br />
	<code class="docref">libvirt_print_binding_resources</code>()<br />
	<code class="docref">libvirt_logfile_set</code>($filename, $maxsize)<br />
</pre>
<h3><a name="libvirt_get_last_error"><code>libvirt_get_last_error</code></a></h3>
<pre class="programlisting">libvirt_get_last_error()</pre>
<p>[Since version 0.4.1(-1)]</p>
<p>This function is used to get the last error coming either from libvirt or the PHP extension itself.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:         last error string
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_image_create"><code>libvirt_image_create</code></a></h3>
<pre class="programlisting">libvirt_image_create($conn, $name, $size, $format)</pre>
<p>[Since version 0.4.2]</p>
<p>Function is used to create the image of desired name, size and format. The image will be created in the image path (libvirt.image_path INI variable). Works only o.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>@conn [resource]</tt></i>:</span>
		    </td>
		    <td>
			 libvirt connection resource
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@name [string]</tt></i>:</span>
		    </td>
		    <td>
			 name of the image file that will be created in the libvirt.image_path directory
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@size [int]</tt></i>:</span>
		    </td>
		    <td>
			 size of the image in MiBs
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@format [string]</tt></i>:</span>
		    </td>
		    <td>
			 format of the image, may be raw, qcow or qcow2
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:         hostname of the host node or FALSE for error
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_image_remove"><code>libvirt_image_remove</code></a></h3>
<pre class="programlisting">libvirt_image_remove($conn, $image)</pre>
<p>[Since version 0.4.2]</p>
<p>Function is used to create the image of desired name, size and format. The image will be created in the image path (libvirt.image_path INI variable). Works only on local systems!.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>@conn [resource]</tt></i>:</span>
		    </td>
		    <td>
			 libvirt connection resource
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@image [string]</tt></i>:</span>
		    </td>
		    <td>
			 name of the image file that should be deleted
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:         hostname of the host node or FALSE for error
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_version"><code>libvirt_version</code></a></h3>
<pre class="programlisting">libvirt_version($type)</pre>
<p>[Since version 0.4.1(-1)]</p>
<p>Function is used to get libvirt, driver and libvirt-php version numbers. Can be used for information purposes, for version checking please use libvirt_check_version() defined below.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>@type [string]</tt></i>:</span>
		    </td>
		    <td>
			 optional type string to identify driver to look at
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:         libvirt, type (driver) and connector (libvirt-php) version numbers array
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_check_version"><code>libvirt_check_version</code></a></h3>
<pre class="programlisting">libvirt_check_version($major, $minor, $micro, $type)</pre>
<p>[Since version 0.4.1(-1)]</p>
<p>Function is used to check major, minor and micro (also sometimes called release) versions of libvirt-php or libvirt itself. This could useful when you want your application to support only versions of libvirt or libvirt-php higher than some version specified..</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>@major [long]</tt></i>:</span>
		    </td>
		    <td>
			 major version number to check for
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@minor [long]</tt></i>:</span>
		    </td>
		    <td>
			 minor version number to check for
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@micro [long]</tt></i>:</span>
		    </td>
		    <td>
			 micro (also release) version number to check for
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@type [long]</tt></i>:</span>
		    </td>
		    <td>
			 type of checking, VIR_VERSION_BINDING to check against libvirt-php binding or VIR_VERSION_LIBVIRT to check against libvirt version
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:         TRUE if version is equal or higher than required, FALSE if not, FALSE with error [for libvirt_get_last_error()] on unsupported version type check
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_has_feature"><code>libvirt_has_feature</code></a></h3>
<pre class="programlisting">libvirt_has_feature($name)</pre>
<p>[Since version 0.4.1(-3)]</p>
<p>Function to check for feature existence for working libvirt instance.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>@name [string]</tt></i>:</span>
		    </td>
		    <td>
			 feature name
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:             TRUE if feature is supported, FALSE otherwise
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_get_iso_images"><code>libvirt_get_iso_images</code></a></h3>
<pre class="programlisting">libvirt_get_iso_images($path)</pre>
<p>[Since version 0.4.1(-3)]</p>
<p>Function to get the ISO images on path and return them in the array.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>@path [string]</tt></i>:</span>
		    </td>
		    <td>
			 string of path where to look for the ISO images
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:             ISO image array on success, FALSE otherwise
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_print_binding_resources"><code>libvirt_print_binding_resources</code></a></h3>
<pre class="programlisting">libvirt_print_binding_resources()</pre>
<p>[Since version 0.4.2]</p>
<p>Function to print the binding resources, although the resource information are printed, they are returned in the return_value.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:             bindings resource information
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
<h3><a name="libvirt_logfile_set"><code>libvirt_logfile_set</code></a></h3>
<pre class="programlisting">libvirt_logfile_set($filename, $maxsize)</pre>
<p>[Since version 0.4.2]</p>
<p>Function to set the log file for the libvirt module instance.</p><div class="variablelist">
	<table border="0">
		<col align="left" />
		<tbody>
		  <tr>
		    <td>
			<span class="term"><i><tt>@filename [string]</tt></i>:</span>
		    </td>
		    <td>
			 log filename or NULL to disable logging
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>@maxsize [long]</tt></i>:</span>
		    </td>
		    <td>
			 optional maximum log file size argument in KiB, default value can be found in PHPInfo() output
		    </td>
		  </tr>
		  <tr>
		    <td>
			<span class="term"><i><tt>Returns</tt></i>:</span>
		    </td>
		    <td>
			:             TRUE if log file has been successfully set, FALSE otherwise
		    </td>
		  </tr>
		</tbody>
	</table>
</div>
