mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
d84a80afb5
The backup_restore_vg is used directly for restoring the VG from backup. It's also used to do the VG conversions from one metadata format to another which means vgconvert calls backup_restore_vg too. When restoring VG from backup, we need to rewrite/write PV headers as PVs may have been orphans before and now they're becoming part of some VG - we need to write the PV_EXT_USED flag at least. When using the backup_restore_vg for vgconvert, we need to write completely new PV header in different format. Avoid the special "pv_write" call and handling that was used before this patch in vgconvert (vgconvert_single function to be more precise) and reuse existing internal interface to register PV header for writing (or rewriting) via vg->pvs_to_write list instead like we do it elsewhere in the code. This patch also resolves a problem in which PV headers with target format were written in the vgconvert_single fn as orphans and VG metadata were added later on - this was a tiny hack actually. We can't do this now - we need to write the PV as belonging to a VG because otherwise the PV_EXT_USED flag won't be written properly (if the PV header is written as orphan, the PV_EXT_USED is set to 0, of course, even though metadata are attached later). So this patch removes this tiny inconsistency which was passing just fine before because we didn't have any relation to the VG in PV header before. Now we have the PV_EXT_USED flag which says the "PV is used in some VG". |
||
---|---|---|
.. | ||
archive.c | ||
archiver.c | ||
archiver.h | ||
export.c | ||
flags.c | ||
format-text.c | ||
format-text.h | ||
import_vsn1.c | ||
import-export.h | ||
import.c | ||
layout.h | ||
text_export.h | ||
text_import.h | ||
text_label.c |