diff options
author | Alasdair Kergon <agk@redhat.com> | 2002-02-11 20:50:53 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2002-02-11 20:50:53 +0000 |
commit | 60274aba6ec2c6a6a0e1e2656d97a574b79f5775 (patch) | |
tree | 83945d99849698a91fbbbc7abcfdceee2538cf49 /tools/vgexport.c | |
parent | 8d6a8717bb59c5ff36150e8e43a9138af9ac3f63 (diff) | |
download | lvm2-60274aba6ec2c6a6a0e1e2656d97a574b79f5775.tar.gz |
Preparation for an LVM2 liblvm - pass cmd_context into each tool and
link some globals that the tools need into that structure.
Diffstat (limited to 'tools/vgexport.c')
-rw-r--r-- | tools/vgexport.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/vgexport.c b/tools/vgexport.c index 05fdb7817..19d683cb9 100644 --- a/tools/vgexport.c +++ b/tools/vgexport.c @@ -20,28 +20,28 @@ #include "tools.h" -static int vgexport_single(const char *vg_name); +static int vgexport_single(struct cmd_context *cmd, const char *vg_name); -int vgexport(int argc, char **argv) +int vgexport(struct cmd_context *cmd, int argc, char **argv) { - if (!argc && !arg_count(all_ARG)) { + if (!argc && !arg_count(cmd,all_ARG)) { log_error("Please supply volume groups or use -a for all."); return ECMD_FAILED; } - if (argc && arg_count(all_ARG)) { + if (argc && arg_count(cmd,all_ARG)) { log_error("No arguments permitted when using -a for all."); return ECMD_FAILED; } - return process_each_vg(argc, argv, LCK_READ, &vgexport_single); + return process_each_vg(cmd, argc, argv, LCK_READ, &vgexport_single); } -static int vgexport_single(const char *vg_name) +static int vgexport_single(struct cmd_context *cmd, const char *vg_name) { struct volume_group *vg; - if (!(vg = fid->ops->vg_read(fid, vg_name))) { + if (!(vg = cmd->fid->ops->vg_read(cmd->fid, vg_name))) { log_error("Unable to find volume group \"%s\"", vg_name); goto error; } @@ -67,7 +67,7 @@ static int vgexport_single(const char *vg_name) vg->status |= EXPORTED_VG; - if (!fid->ops->vg_write(fid,vg)) + if (!cmd->fid->ops->vg_write(cmd->fid,vg)) goto error; backup(vg); |