Package org.libvirt

Class Device


  • public class Device
    extends java.lang.Object
    A device which is attached to a node
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int 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.
      protected void finalize()  
      int free()
      Frees this device object.
      java.lang.String getName()
      Returns the name of the device
      int getNumberOfCapabilities()
      Returns the number of capabilities which the instance has.
      java.lang.String getParent()
      Returns the parent of the device
      java.lang.String getXMLDescription()
      Returns the XML description of the device
      java.lang.String[] listCapabilities()
      List the capabilities of the device
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • destroy

        public int destroy()
                    throws LibvirtException
        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

        public int detach()
                   throws LibvirtException
        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
      • free

        public int free()
                 throws LibvirtException
        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

        public java.lang.String getName()
                                 throws LibvirtException
        Returns the name of the device
        Returns:
        0 on success or -1 on error
        Throws:
        LibvirtException
      • getNumberOfCapabilities

        public int getNumberOfCapabilities()
                                    throws LibvirtException
        Returns the number of capabilities which the instance has.
        Returns:
        0 on success or -1 on error
        Throws:
        LibvirtException
      • getXMLDescription

        public java.lang.String getXMLDescription()
                                           throws LibvirtException
        Returns the XML description of the device
        Returns:
        String or null
        Throws:
        LibvirtException
      • listCapabilities

        public java.lang.String[] listCapabilities()
                                            throws LibvirtException
        List the capabilities of the device
        Returns:
        String or null
        Throws:
        LibvirtException
      • reset

        public int reset()
                  throws LibvirtException
        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