'Return ``BlockDeviceVolume`` instances for all the files in the
``unattached`` directory and all per-host directories.
See ``IBlockDeviceAPI.list_volumes`` for parameter and return type
documentation.'

def list_volumes(self):

    volumes = []
    for child in self._root_path.child('unattached').children():
        (blockdevice_id, size) = self._parse_backing_file_name(child.basename().decode('ascii'))
        volume = _blockdevicevolume_from_blockdevice_id(blockdevice_id=blockdevice_id, size=size)
        volumes.append(volume)
    for host_directory in self._root_path.child('attached').children():
        compute_instance_id = host_directory.basename().decode('ascii')
        for child in host_directory.children():
            (blockdevice_id, size) = self._parse_backing_file_name(child.basename().decode('ascii'))
            volume = _blockdevicevolume_from_blockdevice_id(blockdevice_id=blockdevice_id, size=size, attached_to=compute_instance_id)
            volumes.append(volume)
    return volumes
