1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

vgconvert is fixed now to work with the changes in metadata area handling - enable the tests.

Add a small fix that preserves pe_start for lvm1 PVs when being converted.

(this fix needs to be replaced with something more clever, but let's have this working now)
This commit is contained in:
Peter Rajnoha 2011-02-25 14:12:14 +00:00
parent ed08b81e18
commit c4dbd497b2
3 changed files with 12 additions and 8 deletions

View File

@ -400,7 +400,7 @@ static int _format1_pv_initialise(const struct format_type * fmt,
static int _format1_pv_setup(const struct format_type *fmt,
struct physical_volume *pv,
struct volume_group *vg __attribute__((unused)))
struct volume_group *vg)
{
return _format1_pv_initialise(fmt, -1, 0, 0, vg->extent_size, 0, 0, pv);
}

View File

@ -296,6 +296,7 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
struct pv_list *pvl;
struct format_instance *fid;
struct format_instance_ctx fic;
uint32_t tmp;
/*
* FIXME: Check that the PVs referenced in the backup are
@ -320,11 +321,14 @@ int backup_restore_vg(struct cmd_context *cmd, struct volume_group *vg)
/* Add any metadata areas on the PVs */
dm_list_iterate_items(pvl, &vg->pvs) {
tmp = vg->extent_size;
vg->extent_size = 0;
if (!vg->fid->fmt->ops->pv_setup(vg->fid->fmt, pvl->pv, vg)) {
log_error("Format-specific setup for %s failed",
pv_dev_name(pvl->pv));
return 0;
}
vg->extent_size = tmp;
}
if (!vg_write(vg) || !vg_commit(vg))

View File

@ -133,18 +133,18 @@ check pv_field $dev1 pv_mda_count 2
#COMM 'pv with LVM1 compatible data alignment can be convereted'
#compatible == LVM1_PE_ALIGN == 64k
#pvcreate --dataalignment 256k $dev1
#vgcreate -s 1m $vg $dev1
#vgconvert -M1 $vg
#vgconvert -M2 $vg
#check pv_field $dev1 pe_start 256.00k
#vgremove $vg
pvcreate --dataalignment 256k $dev1
vgcreate -s 1m $vg $dev1
vgconvert -M1 $vg
vgconvert -M2 $vg
check pv_field $dev1 pe_start 256.00k
vgremove $vg
#COMM 'pv with LVM1 incompatible data alignment cannot be convereted'
pvcreate --dataalignment 10k $dev1
vgcreate -s 1m $vg $dev1
not vgconvert -M1 $vg
#vgremove $vg
vgremove $vg
#COMM 'vgcfgrestore allows pe_start=0'
#basically it produces nonsense, but it tests vgcfgrestore,