(php-libvirt 0.4)
libvirt_storagevolume_get_xml_desc — Get storagevolume information in XML format
This function returns string containing volume information in XML format
Connection resource of volume
String with volume information in XML format. FALSE on failure
Example #1 libvirt_storagevolume_get_xml_desc() example
String with volume information in XML format
<?php
$conn=libvirt_connect($uri,true);
$pool=libvirt_storagepools_lookup_by_name($conn,'default');
$volume=libvirt_storagevolume_lookup_by_name($pool,'volume1');
$volumeXML=libtvirt_storagevolume_get_xml_desc($volume);
var_dump($volumeXML);
?>
The above example will output something similar to:
string(451) "<volume> <name>volume1</name> <key>mQ3tpH-dAjE-IdHi-iafe-QElg-X2r7-Pv59e6</key> <source> <device path='/dev/sdb'> <extent start='27971813376' end='30119297024'/> </device> </source> <capacity>2147483648</capacity> <allocation>2147483648</allocation> <target> <path>/dev/data/volume1</path> <permissions> <mode>0660</mode> <owner>0</owner> <group>6</group> </permissions> </target> </volume>