[lvm-devel] [PATCH 3/3] Initialize removed_pvs list in format-specific volume_group constructors.

Thomas Woerner twoerner at redhat.com
Mon Jul 27 13:12:37 UTC 2009


From: Dave Wysochanski <dwysocha at redhat.com>

I think this is the reason the 'n' and 'p' members were still NULL.
Ideally, we should have a base constructor here that initializes the general,
non-format specific members of struct volume_group.  But until then, there
are multiple places to initialize these members.  Maybe a better patch would
be a base constructor patch for struct volume_group.  That is more work
though.  Maybe you could start one - might get bonus points.  ;-)

Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
Signed-off-by: Thomas Woerner <twoerner at redhat.com>
---
 lib/format1/format1.c         |    1 +
 lib/format_pool/format_pool.c |    1 +
 lib/format_text/import_vsn1.c |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/lib/format1/format1.c b/lib/format1/format1.c
index c8f9519..aa1483a 100644
--- a/lib/format1/format1.c
+++ b/lib/format1/format1.c
@@ -132,6 +132,7 @@ static struct volume_group *_build_vg(struct format_instance *fid,
 	dm_list_init(&vg->pvs);
 	dm_list_init(&vg->lvs);
 	dm_list_init(&vg->tags);
+	dm_list_init(&vg->removed_pvs);
 
 	if (!_check_vgs(pvs))
 		goto_bad;
diff --git a/lib/format_pool/format_pool.c b/lib/format_pool/format_pool.c
index 3f31bba..6f7e4b4 100644
--- a/lib/format_pool/format_pool.c
+++ b/lib/format_pool/format_pool.c
@@ -124,6 +124,7 @@ static struct volume_group *_build_vg_from_pds(struct format_instance
 	dm_list_init(&vg->pvs);
 	dm_list_init(&vg->lvs);
 	dm_list_init(&vg->tags);
+	dm_list_init(&vg->removed_pvs);
 
 	if (!import_pool_vg(vg, smem, pds))
 		return_NULL;
diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index 629310a..3c41675 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -753,6 +753,7 @@ static struct volume_group *_read_vg(struct format_instance *fid,
 
 	dm_list_init(&vg->lvs);
 	dm_list_init(&vg->tags);
+	dm_list_init(&vg->removed_pvs);
 
 	/* Optional tags */
 	if ((cn = find_config_node(vgn, "tags")) &&
-- 
1.6.2.5




More information about the lvm-devel mailing list