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

metadata: vg: alloc lvm1_system_id in alloc_vg sooner

This commit is contained in:
Peter Rajnoha 2015-03-02 13:00:37 +01:00
parent eeaf3f2e88
commit 1a41e649a6

View File

@ -41,6 +41,12 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd,
return NULL;
}
if (!(vg->lvm1_system_id = dm_pool_zalloc(vgmem, NAME_LEN + 1))) {
log_error("Failed to allocate VG systemd id.");
dm_pool_destroy(vgmem);
return NULL;
}
vg->cmd = cmd;
vg->vgmem = vgmem;
vg->alloc = ALLOC_NORMAL;
@ -57,12 +63,6 @@ struct volume_group *alloc_vg(const char *pool_name, struct cmd_context *cmd,
dm_list_init(&vg->tags);
dm_list_init(&vg->removed_pvs);
if (!(vg->lvm1_system_id = dm_pool_zalloc(vg->vgmem, NAME_LEN + 1))) {
log_error("Failed to allocate VG systemd id.");
dm_pool_destroy(vgmem);
return NULL;
}
log_debug_mem("Allocated VG %s at %p.", vg->name, vg);
return vg;