Package org.libvirt
Class Interface
java.lang.Object
org.libvirt.Interface
A device which is attached to a node
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Get XML Flag: dump inactive interface information -
Method Summary
Modifier and TypeMethodDescriptionint
create()
Activate an interface (i.e.int
destroy()
Deactivate an interface (i.e.protected void
finalize()
int
free()
Frees this interface object.Returns the mac string of the interfacegetName()
Returns the name of the interfacegetXMLDescription
(int flags) Returns the XML description for theinterfaceint
isActive()
Determine if the interface is currently runningint
undefine()
Undefine an interface, ie remove it from the config.
-
Field Details
-
VIR_INTERFACE_XML_INACTIVE
public static final int VIR_INTERFACE_XML_INACTIVEGet XML Flag: dump inactive interface information- See Also:
-
-
Method Details
-
create
Activate an interface (i.e. call "ifup").If there was an open network config transaction at the time this interface was defined (that is, if virInterfaceChangeBegin() had been called), the interface will be brought back down (and then undefined) if virInterfaceChangeRollback() is called.
- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-
destroy
Deactivate an interface (i.e. call "ifdown").This does not remove the interface from the config, and does not free the associated virInterfacePtr object.
If there is an open network config transaction at the time this interface is destroyed (that is, if virInterfaceChangeBegin() had been called), and if the interface is later undefined and then virInterfaceChangeRollback() is called, the restoral of the interface definition will also bring the interface back up.
- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-
finalize
- Overrides:
finalize
in classObject
- Throws:
LibvirtException
-
free
Frees this interface object. The running instance is kept alive. The data structure is freed and should not be used thereafter.- Returns:
- number of references left (>= 0)
- Throws:
LibvirtException
-
getMACString
Returns the mac string of the interface- Returns:
- String or null
- Throws:
LibvirtException
-
getName
Returns the name of the interface- Returns:
- String or null
- Throws:
LibvirtException
-
getXMLDescription
Returns the XML description for theinterface- Parameters:
flags
-- Returns:
- String or null
- Throws:
LibvirtException
-
isActive
Determine if the interface is currently running- Returns:
- 1 if running, 0 if inactive
- Throws:
LibvirtException
- See Also:
-
undefine
Undefine an interface, ie remove it from the config. This does not free the associated virInterfacePtr object.- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-