Package org.libvirt
Class Interface
java.lang.Object
org.libvirt.Interface
A device which is attached to a node
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Libvirt
The libvirt connection from the hypervisorstatic int
Get XML Flag: dump inactive interface information -
Method Summary
Modifier and TypeMethodDescriptionint
create()
Create and start a defined network.int
destroy()
Destroy the network object.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 runningprotected void
Error handling logic to throw errors.int
undefine()
Undefine an interface, ie remove it from the config.
-
Field Details
-
VIR_INTERFACE_XML_INACTIVE
public static int VIR_INTERFACE_XML_INACTIVEGet XML Flag: dump inactive interface information -
libvirt
The libvirt connection from the hypervisor
-
-
Method Details
-
create
Create and start a defined network. If the call succeed the network moves from the defined to the running networks pools.- Throws:
LibvirtException
-
destroy
Destroy the network object. The running instance is shutdown if not down already and all resources used by it are given back to the hypervisor.- 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) for success, -1 for failure.
- Throws:
LibvirtException
-
getMACString
Returns the mac string of the interface- Throws:
LibvirtException
-
getName
Returns the name of the interface- Throws:
LibvirtException
-
getXMLDescription
Returns the XML description for theinterface- Throws:
LibvirtException
-
isActive
Determine if the interface is currently running- Returns:
- 1 if running, 0 if inactive, -1 on error
- Throws:
LibvirtException
- See Also:
-
processError
Error handling logic to throw errors. Must be called after every libvirt call.- Throws:
LibvirtException
-
undefine
Undefine an interface, ie remove it from the config. This does not free the associated virInterfacePtr object.- Throws:
LibvirtException
-