/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
* Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License v.2.1.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "tools.h"
static int _pvdisplay_single(struct cmd_context *cmd,
struct volume_group *vg,
struct physical_volume *pv, void *handle)
{
struct pv_list *pvl;
int ret = ECMD_PROCESSED;
uint64_t size;
struct volume_group *old_vg = vg;
if (!is_orphan(pv) && !vg) {
vg_name = pv_vg_name(pv);
vg = vg_read(cmd, vg_name, (char *)&pv->vgid, 0);
if (vg_read_error(vg)) {
log_error("Skipping volume group %s", vg_name);
vg_release(vg);
/* FIXME If CLUSTERED should return ECMD_PROCESSED here */
return ECMD_FAILED;
}
/*
* Replace possibly incomplete PV structure with new one
* allocated in vg_read_internal() path.
*/
if (!(pvl = find_pv_in_vg(vg, pv_name))) {
log_error("Unable to find \"%s\" in volume group \"%s\"",
pv_name, vg->name);
ret = ECMD_FAILED;
goto out;
}