org.libvirt
Class StorageVol

java.lang.Object
  extended by org.libvirt.StorageVol

public class StorageVol
extends java.lang.Object

An acutal storage bucket.


Nested Class Summary
static class StorageVol.Type
           
 
Field Summary
protected  Libvirt libvirt
          the libvirt instance
protected  Connect virConnect
          The VirConnect Object that represents the Hypervisor of this Domain
 
Method Summary
 void delete(int flags)
          Delete the storage volume from the pool
 void finalize()
           
 int free()
          Release the storage volume handle.
 Connect getConnect()
          Provides the connection object associated with a storage volume.
 StorageVolInfo getInfo()
          Fetches volatile information about the storage volume such as its current allocation
 java.lang.String getKey()
          Fetch the storage volume key.
 java.lang.String getName()
          Fetch the storage volume name.
 java.lang.String getPath()
          Fetch the storage volume path.
 java.lang.String getXMLDesc(int flags)
          Fetch an XML document describing all aspects of this storage volume
protected  void processError()
          Error handling logic which should be called after every libvirt call
 StoragePool storagePoolLookupByVolume()
          Fetch a storage pool which contains this volume
 int wipe()
          Ensure data previously on a volume is not accessible to future reads
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

virConnect

protected Connect virConnect
The VirConnect Object that represents the Hypervisor of this Domain


libvirt

protected Libvirt libvirt
the libvirt instance

Method Detail

delete

public void delete(int flags)
            throws LibvirtException
Delete the storage volume from the pool

Parameters:
flags - future flags, use 0 for now
Throws:
LibvirtException

finalize

public void finalize()
              throws LibvirtException
Overrides:
finalize in class java.lang.Object
Throws:
LibvirtException

free

public int free()
         throws LibvirtException
Release the storage volume handle. The underlying storage volume contains to exist

Returns:
number of references left (>= 0) for success, -1 for failure.
Throws:
LibvirtException

getConnect

public Connect getConnect()
Provides the connection object associated with a storage volume. The reference counter on the connection is not increased by this call.

Returns:
the Connect object

getInfo

public StorageVolInfo getInfo()
                       throws LibvirtException
Fetches volatile information about the storage volume such as its current allocation

Returns:
StorageVolInfo object
Throws:
LibvirtException

getKey

public java.lang.String getKey()
                        throws LibvirtException
Fetch the storage volume key. This is globally unique, so the same volume will have the same key no matter what host it is accessed from

Returns:
the key
Throws:
LibvirtException

getName

public java.lang.String getName()
                         throws LibvirtException
Fetch the storage volume name. This is unique within the scope of a pool

Returns:
the name
Throws:
LibvirtException

getPath

public java.lang.String getPath()
                         throws LibvirtException
Fetch the storage volume path. Depending on the pool configuration this is either persistent across hosts, or dynamically assigned at pool startup. Consult pool documentation for information on getting the persistent naming

Returns:
the storage volume path
Throws:
LibvirtException

getXMLDesc

public java.lang.String getXMLDesc(int flags)
                            throws LibvirtException
Fetch an XML document describing all aspects of this storage volume

Parameters:
flags - flags for XML generation (unused, pass 0)
Returns:
the XML document
Throws:
LibvirtException

processError

protected void processError()
                     throws LibvirtException
Error handling logic which should be called after every libvirt call

Throws:
LibvirtException

storagePoolLookupByVolume

public StoragePool storagePoolLookupByVolume()
                                      throws LibvirtException
Fetch a storage pool which contains this volume

Returns:
StoragePool object,
Throws:
LibvirtException

wipe

public int wipe()
         throws LibvirtException
Ensure data previously on a volume is not accessible to future reads

Returns:
0 on success, or -1 on error
Throws:
LibvirtException
See Also:
Libvirt Documentation