diff options
author | Alasdair Kergon <agk@redhat.com> | 2002-02-11 15:42:34 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2002-02-11 15:42:34 +0000 |
commit | 7d0e6e800e41fd13a5dc51ef05de8298b30b7432 (patch) | |
tree | 51be3b97d6a751fed2fc643ce52dac6ad91f50ec /tools/vgexport.c | |
parent | 713599407cc26d5e60889e828b923ed06f156ca0 (diff) | |
download | lvm2-7d0e6e800e41fd13a5dc51ef05de8298b30b7432.tar.gz lvm2-7d0e6e800e41fd13a5dc51ef05de8298b30b7432.tar.xz lvm2-7d0e6e800e41fd13a5dc51ef05de8298b30b7432.zip |
o Support locking with local lock files
o Disable control-c during updates (except if blocked waiting for a lock)
Diffstat (limited to 'tools/vgexport.c')
-rw-r--r-- | tools/vgexport.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/vgexport.c b/tools/vgexport.c index e74db3c8..05fdb781 100644 --- a/tools/vgexport.c +++ b/tools/vgexport.c @@ -34,7 +34,7 @@ int vgexport(int argc, char **argv) return ECMD_FAILED; } - return process_each_vg(argc, argv, &vgexport_single); + return process_each_vg(argc, argv, LCK_READ, &vgexport_single); } static int vgexport_single(const char *vg_name) @@ -43,36 +43,39 @@ static int vgexport_single(const char *vg_name) if (!(vg = fid->ops->vg_read(fid, vg_name))) { log_error("Unable to find volume group \"%s\"", vg_name); - return ECMD_FAILED; + goto error; } if (vg->status & EXPORTED_VG) { log_error("Volume group \"%s\" is already exported", vg_name); - return ECMD_FAILED; + goto error; } if (!(vg->status & LVM_WRITE)) { log_error("Volume group \"%s\" is read-only", vg_name); - return ECMD_FAILED; + goto error; } if (lvs_in_vg_activated(vg)) { log_error("Volume group \"%s\" has active logical volumes", vg_name); - return ECMD_FAILED; + goto error; } if (!archive(vg)) - return ECMD_FAILED; + goto error; vg->status |= EXPORTED_VG; if (!fid->ops->vg_write(fid,vg)) - return ECMD_FAILED; + goto error; backup(vg); log_print("Volume group \"%s\" successfully exported", vg->name); return 0; + + error: + return ECMD_FAILED; } |