Package org.libvirt
Class StorageVol
java.lang.Object
org.libvirt.StorageVol
An acutal storage bucket.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
static enum
static final class
-
Field Summary
Modifier and TypeFieldDescriptionprotected Connect
The VirConnect Object that represents the Hypervisor of this Domain -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int flags) Delete the storage volume from the poolvoid
Download the content of the volume as a streamprotected void
finalize()
int
free()
Release the storage volume handle.Provides the connection object associated with a storage volume.getInfo()
Fetches volatile information about the storage volume such as its current allocationgetKey()
Fetch the storage volume key.getName()
Fetch the storage volume name.getPath()
Fetch the storage volume path.getXMLDesc
(int flags) Fetch an XML document describing all aspects of this storage volumeint
resize
(long capacity, int flags) Resize a volumeFetch a storage pool which contains this volumevoid
Upload new content to the volume from a streamint
wipe()
Ensure data previously on a volume is not accessible to future reads
-
Field Details
-
virConnect
The VirConnect Object that represents the Hypervisor of this Domain
-
-
Method Details
-
delete
Delete the storage volume from the pool- Parameters:
flags
- future flags, use 0 for now- Throws:
LibvirtException
-
finalize
- Overrides:
finalize
in classObject
- Throws:
LibvirtException
-
free
Release the storage volume handle. The underlying storage volume contains to exist- Returns:
- number of references left (>= 0)
- Throws:
LibvirtException
-
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
Fetches volatile information about the storage volume such as its current allocation- Returns:
- StorageVolInfo object
- Throws:
LibvirtException
-
getKey
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
Fetch the storage volume name. This is unique within the scope of a pool- Returns:
- the name
- Throws:
LibvirtException
-
getPath
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
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
-
storagePoolLookupByVolume
Fetch a storage pool which contains this volume- Returns:
- StoragePool object, or
null
if not found. - Throws:
LibvirtException
-
wipe
Ensure data previously on a volume is not accessible to future reads- Returns:
- ignore (always 0)
- Throws:
LibvirtException
- See Also:
-
resize
Resize a volume- Parameters:
capacity
- new capacity for volumeflags
- flags for resizing, see libvirt API for exact flags- Returns:
- ignore (always 0)
- Throws:
LibvirtException
- See Also:
-
upload
Upload new content to the volume from a stream- Parameters:
stream
- stream to use as inputoffset
- position to start writing tolength
- limit on amount of data to uploadflags
- seeStorageVol.UploadFlags
- Throws:
LibvirtException
- See Also:
-
download
Download the content of the volume as a stream- Parameters:
stream
- stream to use as outputoffset
- position to start reading fromlength
- limit on amount of data to downloadflags
- seeStorageVol.DownloadFlags
- Throws:
LibvirtException
- See Also:
-