mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Thin until proper vgcfgrestore for thin is implementad, disable restore.
Since it may probably do more harm to leave it enabled - add extra test for presence of thin volumes in VG, and in this case disable restore.
This commit is contained in:
parent
d4016dd4d0
commit
18b3d24692
@ -348,6 +348,7 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
|
||||
{
|
||||
struct volume_group *vg;
|
||||
int missing_pvs, r = 0;
|
||||
const struct lv_list *lvl;
|
||||
|
||||
/*
|
||||
* Read in the volume group from the text file.
|
||||
@ -355,6 +356,16 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
|
||||
if (!(vg = backup_read_vg(cmd, vg_name, file)))
|
||||
return_0;
|
||||
|
||||
/* FIXME: Restore support is missing for now */
|
||||
dm_list_iterate_items(lvl, &vg->lvs)
|
||||
if (lv_is_thin_type(lvl->lv)) {
|
||||
log_error("Cannot restore Volume Group %s with "
|
||||
"thin logical volumes. "
|
||||
"(not yet supported).", vg->name);
|
||||
r = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
missing_pvs = vg_missing_pv_count(vg);
|
||||
if (missing_pvs == 0)
|
||||
r = backup_restore_vg(cmd, vg);
|
||||
@ -362,6 +373,7 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
|
||||
log_error("Cannot restore Volume Group %s with %i PVs "
|
||||
"marked as missing.", vg->name, missing_pvs);
|
||||
|
||||
out:
|
||||
release_vg(vg);
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user