diff options
author | Alasdair Kergon <agk@redhat.com> | 2002-04-24 18:20:51 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2002-04-24 18:20:51 +0000 |
commit | 25b733809adcd2f6a8f288c100085068094dcc8a (patch) | |
tree | de7aea488a1c717d589134b324c664ba4aa505a7 /tools/pvchange.c | |
parent | f06bdc437d7eab9569f80ba40cbfca55ffa27104 (diff) | |
download | lvm2-25b733809adcd2f6a8f288c100085068094dcc8a.tar.gz lvm2-25b733809adcd2f6a8f288c100085068094dcc8a.tar.xz lvm2-25b733809adcd2f6a8f288c100085068094dcc8a.zip |
Merge with text format branch.
Lots of changes/very little testing so far => there'll be bugs!
Use 'vgcreate -M text' to create a volume group with its metadata stored
in text files. Text format metadata changes should be reasonably atomic,
with a (basic) automatic recovery mechanism if the system crashes while a
change is in progress.
Add a metadata section to lvm.conf to specify multiple directories if
you want (recommended) to keep multiple copies of the metadata (eg on
different filesystems).
e.g. metadata {
dirs = ["/etc/lvm/metadata1","/usr/local/lvm/metadata2"]
}
Plenty of refinements still in the pipeline.
Diffstat (limited to 'tools/pvchange.c')
-rw-r--r-- | tools/pvchange.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/pvchange.c b/tools/pvchange.c index 97f22d0d..b509f007 100644 --- a/tools/pvchange.c +++ b/tools/pvchange.c @@ -52,7 +52,7 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv) log_verbose("Using physical volume(s) on command line"); for (; opt < argc; opt++) { pv_name = argv[opt]; - if (!(pv = cmd->fid->ops->pv_read(cmd->fid, pv_name))) { + if (!(pv = pv_read(cmd, pv_name))) { log_error ("Failed to read physical volume \"%s\"", pv_name); @@ -63,7 +63,7 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv) } } else { log_verbose("Scanning for physical volume names"); - if (!(pvs = cmd->fid->ops->get_pvs(cmd->fid))) { + if (!(pvs = get_pvs(cmd))) { return ECMD_FAILED; } @@ -103,7 +103,7 @@ int pvchange_single(struct cmd_context *cmd, struct physical_volume *pv) return ECMD_FAILED; } - if (!(vg = cmd->fid->ops->vg_read(cmd->fid, pv->vg_name))) { + if (!(vg = vg_read(cmd, pv->vg_name))) { unlock_vg(cmd, pv->vg_name); log_error("Unable to find volume group of \"%s\"", pv_name); @@ -163,7 +163,7 @@ int pvchange_single(struct cmd_context *cmd, struct physical_volume *pv) log_verbose("Updating physical volume \"%s\"", pv_name); if (*pv->vg_name) { - if (!(cmd->fid->ops->vg_write(cmd->fid, vg))) { + if (!vg_write(vg)) { unlock_vg(cmd, pv->vg_name); log_error("Failed to store physical volume \"%s\" in " "volume group \"%s\"", pv_name, vg->name); @@ -172,7 +172,7 @@ int pvchange_single(struct cmd_context *cmd, struct physical_volume *pv) backup(vg); unlock_vg(cmd, pv->vg_name); } else { - if (!(cmd->fid->ops->pv_write(cmd->fid, pv))) { + if (!(pv_write(cmd, pv))) { log_error("Failed to store physical volume \"%s\"", pv_name); return 0; |