1*7c604eeaShaad /* $NetBSD: vgck.c,v 1.1.1.2 2009/12/02 00:25:56 haad Exp $ */
256a34939Shaad
356a34939Shaad /*
456a34939Shaad * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
556a34939Shaad * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
656a34939Shaad *
756a34939Shaad * This file is part of LVM2.
856a34939Shaad *
956a34939Shaad * This copyrighted material is made available to anyone wishing to use,
1056a34939Shaad * modify, copy, or redistribute it subject to the terms and conditions
1156a34939Shaad * of the GNU Lesser General Public License v.2.1.
1256a34939Shaad *
1356a34939Shaad * You should have received a copy of the GNU Lesser General Public License
1456a34939Shaad * along with this program; if not, write to the Free Software Foundation,
1556a34939Shaad * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1656a34939Shaad */
1756a34939Shaad
1856a34939Shaad #include "tools.h"
19*7c604eeaShaad #include "metadata.h"
2056a34939Shaad
vgck_single(struct cmd_context * cmd __attribute ((unused)),const char * vg_name,struct volume_group * vg,void * handle __attribute ((unused)))2156a34939Shaad static int vgck_single(struct cmd_context *cmd __attribute((unused)),
2256a34939Shaad const char *vg_name,
23*7c604eeaShaad struct volume_group *vg,
2456a34939Shaad void *handle __attribute((unused)))
2556a34939Shaad {
26*7c604eeaShaad if (!vg_check_status(vg, EXPORTED_VG)) {
27*7c604eeaShaad stack;
2856a34939Shaad return ECMD_FAILED;
2956a34939Shaad }
3056a34939Shaad
31*7c604eeaShaad if (!vg_validate(vg)) {
32*7c604eeaShaad stack;
3356a34939Shaad return ECMD_FAILED;
3456a34939Shaad }
3556a34939Shaad
3656a34939Shaad return ECMD_PROCESSED;
3756a34939Shaad }
3856a34939Shaad
vgck(struct cmd_context * cmd,int argc,char ** argv)3956a34939Shaad int vgck(struct cmd_context *cmd, int argc, char **argv)
4056a34939Shaad {
41*7c604eeaShaad return process_each_vg(cmd, argc, argv, 0, NULL,
4256a34939Shaad &vgck_single);
4356a34939Shaad }
44