Lookup volume resource by name

libvirt_storagevolume_get_xml_desc
libvirt_version
Libvirt Functions
PHP Manual

# libvirt_storagevolume_lookup_by_name

(php-libvirt 0.4)

libvirt_storagevolume_lookup_by_name — Lookup volume resource by name

### Description

array libvirt_storagevolume_lookup_by_name ( resource `$connection` , string `$volume name` )

This function returns the volume resource for the given name.

### Parameters

`connection`

  Connection resource of the storagepool.

`volume name`

  Name of a volume

### Return Values

Volume resource identiefier. `FALSE` on failure

### Examples

Example #1 libvirt_storagevolume_lookup_by_name() example

Return volume resource identifier

`<?php
$conn=libvirt_connect($uri,true);
$pool=libvirt_storagepool_lookup_by_name($conn, 'default');
$volume=libvirt_storagevolume_lookup_by_name($pool, 'volume1');
var_dump($volume);
?>`

The above example will output something similar to:

    resource(3) of type (Libvirt storagevolume)

### See Also

- libvirt_storagevolume_get_info() - Get storagevolume information
- libvirt_storagevolume_get_xml_desc() - Get storagevolume information in XML format
- libvirt_storagevolume_create_xml() - Create a new storage volume based on XML input
- libvirt_list_volumes() - List all volumes in a storagepool

libvirt_storagevolume_get_xml_desc
libvirt_version
Libvirt Functions
PHP Manual