def listSnapshots(snapshots, tree=False):
    """Get VM snapshot information.

    tree=True will return snapshot tree details required for snapshot removal
    """
    snapshot_data = []

    for snapshot in snapshots:
        if tree is True:
            snapshot_data.append(snapshot)
        else:
            snapshot_data.append(snapshot.id)
        snapshot_data = snapshot_data + listSnapshots(snapshot.childSnapshotList, tree)

    return snapshot_data