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/vgimport.c | |
parent | 713599407cc26d5e60889e828b923ed06f156ca0 (diff) | |
download | lvm2-7d0e6e800e41fd13a5dc51ef05de8298b30b7432.tar.gz |
o Support locking with local lock files
o Disable control-c during updates (except if blocked waiting for a lock)
Diffstat (limited to 'tools/vgimport.c')
-rw-r--r-- | tools/vgimport.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/vgimport.c b/tools/vgimport.c index 9163eda7e..e30ab2527 100644 --- a/tools/vgimport.c +++ b/tools/vgimport.c @@ -34,7 +34,7 @@ int vgimport(int argc, char **argv) return ECMD_FAILED; } - return process_each_vg(argc, argv, &vgimport_single); + return process_each_vg(argc, argv, LCK_WRITE, &vgimport_single); } static int vgimport_single(const char *vg_name) @@ -44,30 +44,33 @@ static int vgimport_single(const char *vg_name) if (!(vg = fid->ops->vg_read(fid, vg_name))) { log_error("Unable to find exported volume group \"%s\"", vg_name); - return ECMD_FAILED; + goto error; } if (!(vg->status & EXPORTED_VG)) { log_error("Volume group \"%s\" is not exported", vg_name); - return ECMD_FAILED; + goto error; } if (vg->status & PARTIAL_VG) { log_error("Volume group \"%s\" is partially missing", 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 imported", vg->name); return 0; + + error: + return ECMD_FAILED; } |