Package org.libvirt
Class Device
java.lang.Object
org.libvirt.Device
A device which is attached to a node
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionint
destroy()
Destroy the device object.int
detach()
Dettach the node device from the node itself so that it may be assigned to a guest domain.void
finalize()
int
free()
Frees this device object.getName()
Returns the name of the deviceint
Returns 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 deviceprotected void
Error handling logic to throw errors.int
reAttach()
ReAttach a device to the node.int
reset()
Reset a previously dettached node device to the node before or after assigning it to a guest.
-
Field Details
-
libvirt
The libvirt connection from the hypervisor
-
-
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.- Throws:
LibvirtException
-
finalize
- Overrides:
finalize
in 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- Throws:
LibvirtException
-
getNumberOfCapabilities
Returns the number of capabilities which the instance has.- Throws:
LibvirtException
-
getParent
Returns the parent of the device- Throws:
LibvirtException
-
getXMLDescription
Returns the XML description of the device- Throws:
LibvirtException
-
listCapabilities
List the capabilities of the device- Throws:
LibvirtException
-
processError
Error handling logic to throw errors. Must be called after every libvirt call.- Throws:
LibvirtException
-
reAttach
ReAttach a device to the node.- Throws:
LibvirtException
-
reset
Reset a previously dettached node device to the node before or after assigning it to a guest.- Throws:
LibvirtException
-