1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

vgconvert: Do not call lvmetad_vg_remove (path shared with vgcfgbackup).

This commit is contained in:
Petr Rockai 2013-09-18 12:53:11 +02:00
parent 054cf25b5f
commit 3df50d822b
3 changed files with 5 additions and 5 deletions

View File

@ -308,7 +308,7 @@ struct volume_group *backup_read_vg(struct cmd_context *cmd,
}
/* ORPHAN and VG locks held before calling this */
int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg, int drop_lvmetad)
{
struct pv_list *pvl;
struct format_instance *fid;
@ -351,7 +351,7 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
if (!vg_write(vg))
return_0;
if (lvmetad_active()) {
if (drop_lvmetad && lvmetad_active()) {
struct volume_group *vg_lvmetad = lvmetad_vg_lookup(cmd, vg->name, NULL);
if (vg_lvmetad) {
lvmetad_vg_remove(vg_lvmetad);
@ -397,7 +397,7 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
missing_pvs = vg_missing_pv_count(vg);
if (missing_pvs == 0)
r = backup_restore_vg(cmd, vg);
r = backup_restore_vg(cmd, vg, 1);
else
log_error("Cannot restore Volume Group %s with %i PVs "
"marked as missing.", vg->name, missing_pvs);

View File

@ -51,7 +51,7 @@ int backup_remove(struct cmd_context *cmd, const char *vg_name);
struct volume_group *backup_read_vg(struct cmd_context *cmd,
const char *vg_name, const char *file);
int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg);
int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg, int drop_lvmetad);
int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
const char *file, int force);
int backup_restore(struct cmd_context *cmd, const char *vg_name, int force);

View File

@ -184,7 +184,7 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
log_verbose("Writing metadata for VG %s using format %s", vg_name,
cmd->fmt->name);
if (!backup_restore_vg(cmd, vg)) {
if (!backup_restore_vg(cmd, vg, 0)) {
log_error("Conversion failed for volume group %s.", vg_name);
log_error("Use pvcreate and vgcfgrestore to repair from "
"archived metadata.");