Sys::V...rageVol(3pm)
β¨ NAME β¨
okay bestie, welcome to Sys::Virt::StorageVol π this page lives in the User Contributed Perl Documentation manual, and the title you'd see up top is Sys::V...rageVol(3pm).
Sys::Virt::StorageVol β represent & manage a libvirt storage volume. periodt.
π¦ DESCRIPTION π¦
okay so Sys::Virt::StorageVol is the module that represents a storage volume managed by libvirt. A storage volume is always associated with a containing storage pool, aka Sys::Virt::StoragePool β no floating volumes here, bestie π«Ά
β¨ METHODS β¨
my $name = $vol->get_name()β returns a string with the locally unique name of the storage vol.my $name = $vol->get_key()β returns a string with the globally unique key for the storage vol.my $name = $vol->get_path()β returns a string with the locally unique file path of the storage vol.my $xml = $vol->get_xml_description()β returns an XML document containing a complete description of the storage vol's configuration.$vol->delete($flags)β immediately deletes the storage volume and frees its storage resources π theflagsparameter says any special action to take when deleting the volume.$vol->resize($newcapacity, $flags=0)β adjusts the size of the storage volume. The$newcapacityvalue semantics depend on the$flagsparameter: if$flagsspecifiesRESIZE_DELTA, then$newcapacityis relative to the current size. If$flagsspecifiesRESIZE_SHRINK, then the$newcapacityvalue is the amount of space to remove.$vol->wipe($flags = 0)β clears the data in the storage volume so you avoid future information leaks π₯ theflagsparameter is currently unused and defaults to zero.$vol->wipe_pattern($algorithm, $flags = 0)β clears the data in the storage volume so you avoid future information leaks. The$algorithmparameter specifies the data pattern used to erase data, and should be one of the WIPE ALGORITHM CONSTANTS listed later. Theflagsparameter is currently unused and defaults to zero.my $info = $vol->get_info($flags = 0)β retrieves live information about the storage volume. The returned$infohash reference contains three keys:typeindicates whether the volume is a file or block device;capacityprovides the maximum logical size of the volume;allocationprovides the current physical usage of the volume. The allocation may be less than the capacity for sparse, or grow-on-demand volumes. The allocation may also be larger than the capacity, if there is a metadata overhead for the volume format.$flagsmay take one of these values:Sys::Virt::StorageVol::USE_ALLOCATIONβ return the current allocation inallocation.Sys::Virt::StorageVol::GET_PHYSICALβ return the physical size inallocation.
$vol->download($st, $offset, $length, $flags=0);β downloads data from$volusing the stream$st. If$offsetand$lengthare non-zero, then restrict data to the specified volume byte range. The$flagsaccept the following values:Sys::Virt::StorageVol::VOL_DOWNLOAD_SPARSE_STREAMβ if this flag is set in@flags, effective transmission of holes is enabled. This assumes using the stream$stwith a combination ofsparse_recv_allorrecv($flags = VIR_STREAM_RECV_STOP_AT_HOLE)for honouring holes sent by the server.
$vol->upload($st, $offset, $length, $flags=0);β uploads data to$volusing the stream$st. If$offsetand$lengthare non-zero, then restrict data to the specified volume byte range. The$flagsaccept the following values:Sys::Virt::StorageVol::VOL_UPLOAD_SPARSE_STREAMβ if this is set in$flags, effective transmission of holes is enabled. This assumes using the stream$stwith a combination ofsparse_send_allorsend_holeto preserve source file sparseness.
π CONSTANTS π
okay constant stans, these sets are useful when dealing with storage volumes π
π§ VOLUME TYPES π§
the following constants are useful for interpreting the type field in the hash returned by the get_info method:
Sys::Virt::StorageVol::TYPE_FILEβ the volume is a plain file.Sys::Virt::StorageVol::TYPE_BLOCKβ the volume is a block device.Sys::Virt::StorageVol::TYPE_DIRβ the volume is a directory.Sys::Virt::StorageVol::TYPE_NETWORKβ the volume is a network source.Sys::Virt::StorageVol::TYPE_NETDIRβ the volume is a network directory.Sys::Virt::StorageVol::TYPE_PLOOPβ the volume is a ploop directory.
π CREATE MODES π
the following constants are useful for the flags parameter of the create method:
Sys::Virt::StorageVol::CREATE_PREALLOC_METADATAβ preallocate header metadata when creating the volume.Sys::Virt::StorageVol::CREATE_REFLINKβ perform lightweight reference copy.Sys::Virt::StorageVol::CREATE_VALIDATEβ validate the XML document against schema.
π DELETE MODES π
the following constants are useful for the flags parameter of the delete method:
Sys::Virt::StorageVol::DELETE_NORMALβ do a plain delete without any attempt to scrub data.Sys::Virt::StorageVol::DELETE_ZEROEDβ zero out current allocated blocks when deleting the volume.Sys::Virt::StorageVol::DELETE_WITH_SNAPSHOTSβ delete snapshots associated with the volume.
π₯ WIPE ALGORITHM CONSTANTS π₯
the following constants specify the algorithm for erasing data:
Sys::Virt::StorageVol::WIPE_ALG_BSIβ 9-pass method recommended by the German Center of Security in Information Technologies.Sys::Virt::StorageVol::WIPE_ALG_DODβ 4-pass Dod 5220.22-M section, 8-306 procedure.Sys::Virt::StorageVol::WIPE_ALG_GUTMANNβ the canonical 35-pass sequence.Sys::Virt::StorageVol::WIPE_ALG_NNSAβ 4-pass NNSA Policy Letter NAP-14.1-C (XVI-8).Sys::Virt::StorageVol::WIPE_ALG_PFITZNER7β 7-pass random.Sys::Virt::StorageVol::WIPE_ALG_PFITZNER33β 33-pass random.Sys::Virt::StorageVol::WIPE_ALG_RANDOMβ 1-pass random.Sys::Virt::StorageVol::WIPE_ALG_SCHNEIERβ 7-pass method described by Bruce Schneier in Applied Cryptography (1996).Sys::Virt::StorageVol::WIPE_ALG_ZEROβ 1-pass, all zeroes.Sys::Virt::StorageVol::WIPE_ALG_TRIMβ 1-pass, trim all data on the volume by using TRIM or DISCARD.
π VOLUME RESIZE CONSTANTS π
the following constants control how storage volumes can be resized:
Sys::Virt::StorageVol::RESIZE_ALLOCATEβ fully allocate the extra space required during resize.Sys::Virt::StorageVol::RESIZE_DELTAβ treat the new capacity as a delta to the current capacity.Sys::Virt::StorageVol::RESIZE_SHRINKβ treat the new capacity as an amount to remove from the capacity.
π AUTHORS π
Daniel P. Berrange <berrange@redhat.com>π
π COPYRIGHT π
Copyright (C) 2006-2009 Red HatCopyright (C) 2006-2009 Daniel P. Berrange
β LICENSE β
the legal tea, bestie β: This program is free software; you can redistribute it and/or modify it under the terms of either the GNU General Public License as published by the Free Software Foundation (either version 2 of the License, or at your option any later version), or, the Artistic License, as specified in the Perl README file.
π SEE ALSO π
go peek at Sys::Virt, Sys::Virt::Error, and "http://libvirt.org" π¦
okay thatβs the whole page π source/version is perl v5.40.2, dated 2026-06-08 β go manage those volumes, bestie π«Άβ¨
π¦ where this page comes from
- epel 10: perl-Sys-Virt 12.4.0-1.el10_3 Β· GPL-2.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms