Libvirt Functions
PHP Manual

libvirt_storagevolume_get_xml_desc

(php-libvirt 0.4)

libvirt_storagevolume_get_xml_descGet storagevolume information in XML format

Description

array libvirt_storagevolume_get_xml_desc ( resource $volume resource )

This function returns string containing volume information in XML format

Parameters

volume resource

Connection resource of volume

Return Values

String with volume information in XML format. FALSE on failure

Examples

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>

See Also


Libvirt Functions
PHP Manual