{
struct text_fid_pv_context *fid_pv_tc;
struct format_instance *fid = pv->fid;
+ const char *pvid = (const char *) (*pv->old_id.uuid ? &pv->old_id : &pv->id);
struct label *label;
int64_t label_sector;
struct lvmcache_info *info;
* just pass the right format_instance in.
*/
for (mda_index = 0; mda_index < FMT_TEXT_MAX_MDAS_PER_PV; mda_index++) {
- if (!(mda = fid_get_mda_indexed(fid, (const char *) &pv->id,
- ID_LEN, mda_index)))
+ if (!(mda = fid_get_mda_indexed(fid, pvid, ID_LEN, mda_index)))
continue;
mdac = (struct mda_context *) mda->metadata_locn;
struct volume_group *vg)
{
struct format_instance *fid = pv->fid;
- const char *pvid = (const char *) &pv->id;
+ const char *pvid = (const char *) (*pv->old_id.uuid ? &pv->old_id : &pv->id);
unsigned mda_index;
struct metadata_area *pv_mda;
struct mda_context *pv_mdac;
unsigned mda_ignored)
{
struct format_instance *fid = pv->fid;
- const char *pvid = (char *) &pv->id;
+ const char *pvid = (const char *) (*pv->old_id.uuid ? &pv->old_id : &pv->id);
uint64_t pe_start, pe_end;
uint64_t alignment, alignment_offset;
uint64_t disk_size;
uint64_t size)
{
struct format_instance *fid = pv->fid;
- const char *pvid = (const char *) &pv->id;
+ const char *pvid = (const char *) (*pv->old_id.uuid ? &pv->old_id : &pv->id);
struct metadata_area *mda;
struct mda_context *mdac;
uint64_t size_reduction;
if (arg_count(cmd, uuid_ARG)) {
/* --uuid: Change PV ID randomly */
+ memcpy(&pv->old_id, &pv->id, sizeof(pv->id));
if (!id_create(&pv->id)) {
log_error("Failed to generate new random UUID for %s.",
pv_name);