Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 0a67499d76b7ed32632abafb78e24a2f > files > 139

libvirt-docs-5.5.0-1.3.mga7.armv7hl.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <!--
        This file is autogenerated from html/libvirt-libvirt-interface.html.in
        Do not edit this file. Changes will be lost.
      -->
  <!--
        This page was generated at Sun Jun 30 20:35:18 UTC 2019.
      -->
  <head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="stylesheet" type="text/css" href="../main.css"/>
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/>
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
    <link rel="manifest" href="/manifest.json"/>
    <meta name="theme-color" content="#ffffff"/>
    <title>libvirt: Module libvirt-interface from libvirt</title>
    <meta name="description" content="libvirt, virtualization, virtualization API"/>
    <script type="text/javascript" src="../js/main.js">
      <!--// forces non-empty element-->
    </script>
  </head>
  <body onload="pageload()">
    <div id="body">
      <div id="content">
        <h1>Module libvirt-interface from libvirt</h1>
        <p>Provides APIs for the management of interfaces Copyright (C) 2006-2014 Red Hat, Inc. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see <a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
        <h2>Table of Contents</h2>
        <h3>
          <a href="#types">Types</a>
        </h3>
        <pre class="api"><span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virConnectListAllInterfacesFlags">virConnectListAllInterfacesFlags</a>
<span class="keyword">typedef</span> <span class="type">struct _virInterface</span> <a href="#virInterface">virInterface</a>
<span class="keyword">typedef</span> <span class="type"><a href="libvirt-libvirt-interface.html#virInterface">virInterface</a> *</span> <a name="virInterfacePtr">virInterfacePtr</a>
<span class="keyword">typedef</span> <span class="keyword">enum</span> <a href="#virInterfaceXMLFlags">virInterfaceXMLFlags</a>
</pre>
        <h3>
          <a href="#functions">Functions</a>
        </h3>
        <pre class="api"><span class="type">int</span>	<a href="#virConnectListAllInterfaces">virConnectListAllInterfaces</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>					 <span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a> **</span> ifaces, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type">int</span>	<a href="#virConnectListDefinedInterfaces">virConnectListDefinedInterfaces</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>					 <span class="type">char ** const</span> names, <br/>					 <span class="type">int</span> maxnames)
<span class="type">int</span>	<a href="#virConnectListInterfaces">virConnectListInterfaces</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>					 <span class="type">char ** const</span> names, <br/>					 <span class="type">int</span> maxnames)
<span class="type">int</span>	<a href="#virConnectNumOfDefinedInterfaces">virConnectNumOfDefinedInterfaces</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn)
<span class="type">int</span>	<a href="#virConnectNumOfInterfaces">virConnectNumOfInterfaces</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn)
<span class="type">int</span>	<a href="#virInterfaceChangeBegin">virInterfaceChangeBegin</a>		(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type">int</span>	<a href="#virInterfaceChangeCommit">virInterfaceChangeCommit</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type">int</span>	<a href="#virInterfaceChangeRollback">virInterfaceChangeRollback</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type">int</span>	<a href="#virInterfaceCreate">virInterfaceCreate</a>		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span>	<a href="#virInterfaceDefineXML">virInterfaceDefineXML</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>					 <span class="type">const char *</span> xml, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type">int</span>	<a href="#virInterfaceDestroy">virInterfaceDestroy</a>		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type">int</span>	<a href="#virInterfaceFree">virInterfaceFree</a>		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)
<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span>	<a href="#virInterfaceGetConnect">virInterfaceGetConnect</a>	(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)
<span class="type">const char *</span>	<a href="#virInterfaceGetMACString">virInterfaceGetMACString</a>	(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)
<span class="type">const char *</span>	<a href="#virInterfaceGetName">virInterfaceGetName</a>	(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)
<span class="type">char *</span>	<a href="#virInterfaceGetXMLDesc">virInterfaceGetXMLDesc</a>		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface, <br/>					 <span class="type">unsigned int</span> flags)
<span class="type">int</span>	<a href="#virInterfaceIsActive">virInterfaceIsActive</a>		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)
<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span>	<a href="#virInterfaceLookupByMACString">virInterfaceLookupByMACString</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>						 <span class="type">const char *</span> macstr)
<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span>	<a href="#virInterfaceLookupByName">virInterfaceLookupByName</a>	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn, <br/>						 <span class="type">const char *</span> name)
<span class="type">int</span>	<a href="#virInterfaceRef">virInterfaceRef</a>			(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)
<span class="type">int</span>	<a href="#virInterfaceUndefine">virInterfaceUndefine</a>		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)
</pre>
        <h2>Description</h2>
        <h3>
          <a name="types">Types</a>
        </h3>
        <h3>
          <a name="virConnectListAllInterfacesFlags">
            <code>virConnectListAllInterfacesFlags</code>
          </a>
        </h3>
        <div class="api">
          <pre><span class="keyword">enum</span> virConnectListAllInterfacesFlags {
</pre>
          <table>
            <tr>
              <td>
                <a name="VIR_CONNECT_LIST_INTERFACES_INACTIVE">VIR_CONNECT_LIST_INTERFACES_INACTIVE</a>
              </td>
              <td> = </td>
              <td colspan="2" class="enumvalue">1 (0x1; 1 &lt;&lt; 0)</td>
            </tr>
            <tr>
              <td>
                <a name="VIR_CONNECT_LIST_INTERFACES_ACTIVE">VIR_CONNECT_LIST_INTERFACES_ACTIVE</a>
              </td>
              <td> = </td>
              <td colspan="2" class="enumvalue">2 (0x2; 1 &lt;&lt; 1)</td>
            </tr>
          </table>
          <pre>}
</pre>
        </div>
        <h3>
          <a name="virInterface">
            <code>virInterface</code>
          </a>
        </h3>
        <div class="api">
          <pre><span class="keyword">struct </span>virInterface {
</pre>
          <div class="undisclosed">The content of this structure is not made public by the API</div>
          <pre>
}
</pre>
        </div>
        <h3>
          <a name="virInterfaceXMLFlags">
            <code>virInterfaceXMLFlags</code>
          </a>
        </h3>
        <div class="api">
          <pre><span class="keyword">enum</span> virInterfaceXMLFlags {
</pre>
          <table>
            <tr>
              <td>
                <a name="VIR_INTERFACE_XML_INACTIVE">VIR_INTERFACE_XML_INACTIVE</a>
              </td>
              <td> = </td>
              <td class="enumvalue">1 (0x1; 1 &lt;&lt; 0)</td>
              <td>
                <div class="comment">dump inactive interface information</div>
              </td>
            </tr>
          </table>
          <pre>}
</pre>
        </div>
        <h3>
          <a name="functions">Functions</a>
        </h3>
        <h3>
          <a name="virConnectListAllInterfaces">
            <code>virConnectListAllInterfaces</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virConnectListAllInterfaces	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
					 <span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a> **</span> ifaces,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p>Collect the list of interfaces, and allocate an array to store those objects. This API solves the race inherent between <a href="libvirt-libvirt-interface.html#virConnectListInterfaces">virConnectListInterfaces</a> and <a href="libvirt-libvirt-interface.html#virConnectListDefinedInterfaces">virConnectListDefinedInterfaces</a>.</p>
          <p>Normally, all interfaces are returned; however, @flags can be used to filter the results for a smaller list of targeted interfaces. The valid flags are divided into groups, where each group contains bits that describe mutually exclusive attributes of a interface, and where all bits within a group describe all possible interfaces.</p>
          <p>The only group of @flags is <a href="libvirt-libvirt-interface.html#VIR_CONNECT_LIST_INTERFACES_ACTIVE">VIR_CONNECT_LIST_INTERFACES_ACTIVE</a> (up) and <a href="libvirt-libvirt-interface.html#VIR_CONNECT_LIST_INTERFACES_INACTIVE">VIR_CONNECT_LIST_INTERFACES_INACTIVE</a> (down) to filter the interfaces by state.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>Pointer to the hypervisor connection.</dd>
          <dt>ifaces</dt>
          <dd>Pointer to a variable to store the array containing the interface objects or NULL if the list is not required (just returns number of interfaces).</dd>
          <dt>flags</dt>
          <dd>bitwise-OR of <a href="libvirt-libvirt-interface.html#virConnectListAllInterfacesFlags">virConnectListAllInterfacesFlags</a>.</dd>
          <dt>Returns</dt>
          <dd>the number of interfaces found or -1 and sets @ifaces to NULL in case of error. On success, the array stored into @ifaces is guaranteed to have an extra allocated element set to NULL but not included in the return count, to make iteration easier. The caller is responsible for calling virStorageInterfaceFree() on each array element, then calling free() on @ifaces.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virConnectListDefinedInterfaces">
            <code>virConnectListDefinedInterfaces</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virConnectListDefinedInterfaces	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
					 <span class="type">char ** const</span> names,
					 <span class="type">int</span> maxnames)</pre>
        <div class="description">
          <p>Collect the list of defined (inactive) physical host interfaces, and store their names in @names.</p>
          <p>For more control over the results, see <a href="libvirt-libvirt-interface.html#virConnectListAllInterfaces">virConnectListAllInterfaces</a>().</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to the hypervisor connection</dd>
          <dt>names</dt>
          <dd>array to collect the list of names of interfaces</dd>
          <dt>maxnames</dt>
          <dd>size of @names</dd>
          <dt>Returns</dt>
          <dd>the number of names provided in the array or -1 in case of error. Note that this command is inherently racy; a interface can be defined between a call to <a href="libvirt-libvirt-interface.html#virConnectNumOfDefinedInterfaces">virConnectNumOfDefinedInterfaces</a>() and this call; you are only guaranteed that all currently defined interfaces were listed if the return is less than @maxnames. The client must call free() on each returned name.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virConnectListInterfaces">
            <code>virConnectListInterfaces</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virConnectListInterfaces	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
					 <span class="type">char ** const</span> names,
					 <span class="type">int</span> maxnames)</pre>
        <div class="description">
          <p>Collect the list of active physical host interfaces, and store their names in @names</p>
          <p>For more control over the results, see <a href="libvirt-libvirt-interface.html#virConnectListAllInterfaces">virConnectListAllInterfaces</a>().</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to the hypervisor connection</dd>
          <dt>names</dt>
          <dd>array to collect the list of names of interfaces</dd>
          <dt>maxnames</dt>
          <dd>size of @names</dd>
          <dt>Returns</dt>
          <dd>the number of interfaces found or -1 in case of error. Note that this command is inherently racy; a interface can be started between a call to <a href="libvirt-libvirt-interface.html#virConnectNumOfInterfaces">virConnectNumOfInterfaces</a>() and this call; you are only guaranteed that all currently active interfaces were listed if the return is less than @maxnames. The client must call free() on each returned name.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virConnectNumOfDefinedInterfaces">
            <code>virConnectNumOfDefinedInterfaces</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virConnectNumOfDefinedInterfaces	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn)</pre>
        <div class="description">
          <p>Provides the number of defined (inactive) interfaces on the physical host.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to the hypervisor connection</dd>
          <dt>Returns</dt>
          <dd>the number of defined interface found or -1 in case of error</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virConnectNumOfInterfaces">
            <code>virConnectNumOfInterfaces</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virConnectNumOfInterfaces	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn)</pre>
        <div class="description">
          <p>Provides the number of active interfaces on the physical host.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to the hypervisor connection</dd>
          <dt>Returns</dt>
          <dd>the number of active interfaces found or -1 in case of error</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceChangeBegin">
            <code>virInterfaceChangeBegin</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceChangeBegin		(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p>This function creates a restore point to which one can return later by calling <a href="libvirt-libvirt-interface.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>(). This function should be called before any transaction with interface configuration. Once it is known that a new configuration works, it can be committed via <a href="libvirt-libvirt-interface.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>(), which frees the restore point.</p>
          <p>If <a href="libvirt-libvirt-interface.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() is called when a transaction is already opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to hypervisor connection</dd>
          <dt>flags</dt>
          <dd>extra flags; not used yet, so callers should always pass 0</dd>
          <dt>Returns</dt>
          <dd>0 in case of success and -1 in case of failure.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceChangeCommit">
            <code>virInterfaceChangeCommit</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceChangeCommit	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p>This commits the changes made to interfaces and frees the restore point created by <a href="libvirt-libvirt-interface.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>().</p>
          <p>If <a href="libvirt-libvirt-interface.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>() is called when a transaction is not opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to hypervisor connection</dd>
          <dt>flags</dt>
          <dd>extra flags; not used yet, so callers should always pass 0</dd>
          <dt>Returns</dt>
          <dd>0 in case of success and -1 in case of failure.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceChangeRollback">
            <code>virInterfaceChangeRollback</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceChangeRollback	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p>This cancels changes made to interfaces settings by restoring previous state created by <a href="libvirt-libvirt-interface.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>().</p>
          <p>If <a href="libvirt-libvirt-interface.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called when a transaction is not opened, this function will fail, and a VIR_ERR_INVALID_OPERATION will be logged.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to hypervisor connection</dd>
          <dt>flags</dt>
          <dd>extra flags; not used yet, so callers should always pass 0</dd>
          <dt>Returns</dt>
          <dd>0 in case of success and -1 in case of failure.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceCreate">
            <code>virInterfaceCreate</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceCreate		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p>Activate an interface (i.e. call "ifup").</p>
          <p>If there was an open network config transaction at the time this interface was defined (that is, if <a href="libvirt-libvirt-interface.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() had been called), the interface will be brought back down (and then undefined) if <a href="libvirt-libvirt-interface.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>pointer to a defined interface</dd>
          <dt>flags</dt>
          <dd>extra flags; not used yet, so callers should always pass 0</dd>
          <dt>Returns</dt>
          <dd>0 in case of success, -1 in case of error</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceDefineXML">
            <code>virInterfaceDefineXML</code>
          </a>
        </h3>
        <pre class="api"><span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span>	virInterfaceDefineXML	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
					 <span class="type">const char *</span> xml,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p>Define an inactive persistent physical host interface or modify an existing persistent one from the XML description.</p>
          <p>Normally this change in the interface configuration is immediately permanent/persistent, but if <a href="libvirt-libvirt-interface.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() has been previously called (i.e. if an interface config transaction is open), the new interface definition will only become permanent if <a href="libvirt-libvirt-interface.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>() is called prior to the next reboot of the system running libvirtd. Prior to that time, it can be explicitly removed using <a href="libvirt-libvirt-interface.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>(), or will be automatically removed during the next reboot of the system running libvirtd.</p>
          <p><a href="libvirt-libvirt-interface.html#virInterfaceFree">virInterfaceFree</a> should be used to free the resources after the interface object is no longer needed.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to the hypervisor connection</dd>
          <dt>xml</dt>
          <dd>the XML description for the interface, preferably in UTF-8</dd>
          <dt>flags</dt>
          <dd>extra flags; not used yet, so callers should always pass 0</dd>
          <dt>Returns</dt>
          <dd>NULL in case of error, a pointer to the interface otherwise</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceDestroy">
            <code>virInterfaceDestroy</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceDestroy		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p>deactivate an interface (ie call "ifdown") This does not remove the interface from the config, and does not free the associated <a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a> object.</p>
          <p>If there is an open network config transaction at the time this interface is destroyed (that is, if <a href="libvirt-libvirt-interface.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() had been called), and if the interface is later undefined and then <a href="libvirt-libvirt-interface.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>() is called, the restoral of the interface definition will also bring the interface back up.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>an interface object</dd>
          <dt>flags</dt>
          <dd>extra flags; not used yet, so callers should always pass 0</dd>
          <dt>Returns</dt>
          <dd>0 in case of success and -1 in case of failure.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceFree">
            <code>virInterfaceFree</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceFree		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)</pre>
        <div class="description">
          <p>Free the interface object. The interface itself is unaltered. The data structure is freed and should not be used thereafter.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>an interface object</dd>
          <dt>Returns</dt>
          <dd>0 in case of success and -1 in case of failure.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceGetConnect">
            <code>virInterfaceGetConnect</code>
          </a>
        </h3>
        <pre class="api"><span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span>	virInterfaceGetConnect	(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)</pre>
        <div class="description">
          <p>Provides the connection pointer associated with an interface. The reference counter on the connection is not increased by this call.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>pointer to an interface</dd>
          <dt>Returns</dt>
          <dd>the <a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a> or NULL in case of failure.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceGetMACString">
            <code>virInterfaceGetMACString</code>
          </a>
        </h3>
        <pre class="api"><span class="type">const char *</span>	virInterfaceGetMACString	(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)</pre>
        <div class="description">
          <p>Get the MAC for an interface as string. For more information about MAC see RFC4122.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>an interface object</dd>
          <dt>Returns</dt>
          <dd>a pointer to the MAC address (in null-terminated ASCII format) or NULL, the string need not be deallocated its lifetime will be the same as the interface object.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceGetName">
            <code>virInterfaceGetName</code>
          </a>
        </h3>
        <pre class="api"><span class="type">const char *</span>	virInterfaceGetName	(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)</pre>
        <div class="description">
          <p>Get the public name for that interface</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>an interface object</dd>
          <dt>Returns</dt>
          <dd>a pointer to the name or NULL, the string need not be deallocated its lifetime will be the same as the interface object.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceGetXMLDesc">
            <code>virInterfaceGetXMLDesc</code>
          </a>
        </h3>
        <pre class="api"><span class="type">char *</span>	virInterfaceGetXMLDesc		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface,
					 <span class="type">unsigned int</span> flags)</pre>
        <div class="description">
          <p><a href="libvirt-libvirt-interface.html#VIR_INTERFACE_XML_INACTIVE">VIR_INTERFACE_XML_INACTIVE</a> - return the static configuration, suitable for use redefining the interface via <a href="libvirt-libvirt-interface.html#virInterfaceDefineXML">virInterfaceDefineXML</a>()</p>
          <p>Provide an XML description of the interface. If <a href="libvirt-libvirt-interface.html#VIR_INTERFACE_XML_INACTIVE">VIR_INTERFACE_XML_INACTIVE</a> is set, the description may be reused later to redefine the interface with <a href="libvirt-libvirt-interface.html#virInterfaceDefineXML">virInterfaceDefineXML</a>(). If it is not set, the ip address and netmask will be the current live setting of the interface, not the settings from the config files.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>an interface object</dd>
          <dt>flags</dt>
          <dd>bitwise-OR of extraction flags. Current valid bits:</dd>
          <dt>Returns</dt>
          <dd>a 0 terminated UTF-8 encoded XML instance, or NULL in case of error. The caller must free() the returned value.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceIsActive">
            <code>virInterfaceIsActive</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceIsActive		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)</pre>
        <div class="description">
          <p>Determine if the interface is currently running</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>pointer to the interface object</dd>
          <dt>Returns</dt>
          <dd>1 if running, 0 if inactive, -1 on error</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceLookupByMACString">
            <code>virInterfaceLookupByMACString</code>
          </a>
        </h3>
        <pre class="api"><span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span>	virInterfaceLookupByMACString	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
						 <span class="type">const char *</span> macstr)</pre>
        <div class="description">
          <p>Try to lookup an interface on the given hypervisor based on its MAC.</p>
          <p><a href="libvirt-libvirt-interface.html#virInterfaceFree">virInterfaceFree</a> should be used to free the resources after the interface object is no longer needed.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to the hypervisor connection</dd>
          <dt>macstr</dt>
          <dd>the MAC for the interface (null-terminated ASCII format)</dd>
          <dt>Returns</dt>
          <dd>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceLookupByName">
            <code>virInterfaceLookupByName</code>
          </a>
        </h3>
        <pre class="api"><span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span>	virInterfaceLookupByName	(<span class="type"><a href="libvirt-libvirt-host.html#virConnectPtr">virConnectPtr</a></span> conn,
						 <span class="type">const char *</span> name)</pre>
        <div class="description">
          <p>Try to lookup an interface on the given hypervisor based on its name.</p>
          <p><a href="libvirt-libvirt-interface.html#virInterfaceFree">virInterfaceFree</a> should be used to free the resources after the interface object is no longer needed.</p>
        </div>
        <dl class="variablelist">
          <dt>conn</dt>
          <dd>pointer to the hypervisor connection</dd>
          <dt>name</dt>
          <dd>name for the interface</dd>
          <dt>Returns</dt>
          <dd>a new interface object or NULL in case of failure. If the interface cannot be found, then <a href="libvirt-virterror.html#VIR_ERR_NO_INTERFACE">VIR_ERR_NO_INTERFACE</a> error is raised.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceRef">
            <code>virInterfaceRef</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceRef			(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)</pre>
        <div class="description">
          <p>Increment the reference count on the interface. For each additional call to this method, there shall be a corresponding call to <a href="libvirt-libvirt-interface.html#virInterfaceFree">virInterfaceFree</a> to release the reference count, once the caller no longer needs the reference to this object.</p>
          <p>This method is typically useful for applications where multiple threads are using a connection, and it is required that the connection remain open until all threads have finished using it. ie, each new thread using an interface would increment the reference count.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>the interface to hold a reference on</dd>
          <dt>Returns</dt>
          <dd>0 in case of success, -1 in case of failure.</dd>
        </dl>
        <div class="acl"/>
        <h3>
          <a name="virInterfaceUndefine">
            <code>virInterfaceUndefine</code>
          </a>
        </h3>
        <pre class="api"><span class="type">int</span>	virInterfaceUndefine		(<span class="type"><a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a></span> iface)</pre>
        <div class="description">
          <p>Undefine an interface, ie remove it from the config. This does not free the associated <a href="libvirt-libvirt-interface.html#virInterfacePtr">virInterfacePtr</a> object.</p>
          <p>Normally this change in the interface configuration is permanent/persistent, but if <a href="libvirt-libvirt-interface.html#virInterfaceChangeBegin">virInterfaceChangeBegin</a>() has been previously called (i.e. if an interface config transaction is open), the removal of the interface definition will only become permanent if <a href="libvirt-libvirt-interface.html#virInterfaceChangeCommit">virInterfaceChangeCommit</a>() is called prior to the next reboot of the system running libvirtd. Prior to that time, the definition can be explicitly restored using <a href="libvirt-libvirt-interface.html#virInterfaceChangeRollback">virInterfaceChangeRollback</a>(), or will be automatically restored during the next reboot of the system running libvirtd.</p>
        </div>
        <dl class="variablelist">
          <dt>iface</dt>
          <dd>pointer to a defined interface</dd>
          <dt>Returns</dt>
          <dd>0 in case of success, -1 in case of error</dd>
        </dl>
        <div class="acl"/>
      </div>
    </div>
    <div id="nav">
      <div id="home">
        <a href="../index.html">Home</a>
      </div>
      <div id="jumplinks">
        <ul>
          <li>
            <a href="../downloads.html">Download</a>
          </li>
          <li>
            <a href="../contribute.html">Contribute</a>
          </li>
          <li>
            <a href="../docs.html">Docs</a>
          </li>
        </ul>
      </div>
      <div id="search">
        <form id="simplesearch" action="https://www.google.com/search" enctype="application/x-www-form-urlencoded" method="get">
          <div>
            <input id="searchsite" name="sitesearch" type="hidden" value="libvirt.org"/>
            <input id="searchq" name="q" type="text" size="12" value=""/>
            <input name="submit" type="submit" value="Go"/>
          </div>
        </form>
        <div id="advancedsearch">
          <span>
            <input type="radio" name="what" id="whatwebsite" checked="checked" value="website"/>
            <label for="whatwebsite">Website</label>
          </span>
          <span>
            <input type="radio" name="what" id="whatwiki" value="wiki"/>
            <label for="whatwiki">Wiki</label>
          </span>
          <span>
            <input type="radio" name="what" id="whatdevs" value="devs"/>
            <label for="whatdevs">Developers list</label>
          </span>
          <span>
            <input type="radio" name="what" id="whatusers" value="users"/>
            <label for="whatusers">Users list</label>
          </span>
        </div>
      </div>
    </div>
    <div id="footer">
      <div id="contact">
        <h3>Contact</h3>
        <ul>
          <li>
            <a href="../contact.html#email">email</a>
          </li>
          <li>
            <a href="../contact.html#irc">irc</a>
          </li>
        </ul>
      </div>
      <div id="community">
        <h3>Community</h3>
        <ul>
          <li>
            <a href="https://twitter.com/hashtag/libvirt">twitter</a>
          </li>
          <li>
            <a href="http://stackoverflow.com/questions/tagged/libvirt">stackoverflow</a>
          </li>
          <li>
            <a href="http://serverfault.com/questions/tagged/libvirt">serverfault</a>
          </li>
        </ul>
      </div>
      <div id="conduct">
            Participants in the libvirt project agree to abide by <a href="../governance.html#codeofconduct">the project code of conduct</a></div>
      <br class="clear"/>
    </div>
  </body>
</html>