Package org.libvirt
Class Device
java.lang.Object
org.libvirt.Device
A device which is attached to a node
-
Method Summary
Modifier and TypeMethodDescriptionintdestroy()Destroy the device object.intdetach()Dettach the node device from the node itself so that it may be assigned to a guest domain.protected voidfinalize()intfree()Frees this device object.getName()Returns the name of the deviceintReturns the number of capabilities which the instance has.Returns the parent of the deviceReturns the XML description of the deviceString[]List the capabilities of the deviceintreAttach()ReAttach a device to the node.intreset()Reset a previously dettached node device to the node before or after assigning it to a guest.
-
Method Details
-
destroy
Destroy the device object. The virtual device is removed from the host operating system. This function may require privileged access.- Returns:
- 0 for success, -1 for failure.
- Throws:
LibvirtException
-
detach
Dettach the node device from the node itself so that it may be assigned to a guest domain.- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-
finalize
- Overrides:
finalizein classObject- Throws:
LibvirtException
-
free
Frees this device 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
-
getName
Returns the name of the device- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-
getNumberOfCapabilities
Returns the number of capabilities which the instance has.- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-
getParent
Returns the parent of the device- Returns:
- String or null
- Throws:
LibvirtException
-
getXMLDescription
Returns the XML description of the device- Returns:
- String or null
- Throws:
LibvirtException
-
listCapabilities
List the capabilities of the device- Returns:
- String or null
- Throws:
LibvirtException
-
reAttach
ReAttach a device to the node.- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-
reset
Reset a previously dettached node device to the node before or after assigning it to a guest.- Returns:
- 0 on success or -1 on error
- Throws:
LibvirtException
-