diff options
author | Petr Rockai <prockai@redhat.com> | 2010-11-17 22:26:42 +0000 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2010-11-17 22:26:42 +0000 |
commit | dd5b5fb7949a5951aae0ec6c5c5252bda118863b (patch) | |
tree | 2e8d0595caeeba8f41a4f92ab98f0168a470916f /tools/reporter.c | |
parent | f6531a5f00fb27b8082d72674620d0163a26b454 (diff) | |
download | lvm2-dd5b5fb7949a5951aae0ec6c5c5252bda118863b.tar.gz lvm2-dd5b5fb7949a5951aae0ec6c5c5252bda118863b.tar.xz lvm2-dd5b5fb7949a5951aae0ec6c5c5252bda118863b.zip |
The _free_vg that is created as a placeholder when reporting segments in pvs
was lacking the (vgmem) pool. We now create that pool. There is at least one
more such VG (_dummy_vg) which is pool-less. I am not sure what is the right
way to go about this, but this is currently necessary to fix a segfault
introduced by using vgmem in the reporter in Dave's lvseg lvm2app patches.
Signed-off-by: Petr Rockai <prockai@redhat.com>
Diffstat (limited to 'tools/reporter.c')
-rw-r--r-- | tools/reporter.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/reporter.c b/tools/reporter.c index f39d23f8..40d3c9aa 100644 --- a/tools/reporter.c +++ b/tools/reporter.c @@ -64,6 +64,9 @@ static int _pvsegs_sub_single(struct cmd_context *cmd, .name = (char *)"", }; + if (!(_free_vg.vgmem = dm_pool_create("_free_vg", 10240))) + return ECMD_FAILED; + struct logical_volume _free_logical_volume = { .vg = vg ?: &_free_vg, .name = (char *) "", @@ -103,10 +106,11 @@ static int _pvsegs_sub_single(struct cmd_context *cmd, if (!report_object(handle, vg, seg ? seg->lv : &_free_logical_volume, pvseg->pv, seg ? : &_free_lv_segment, pvseg)) { - stack; ret = ECMD_FAILED; + goto_out; } - + out: + dm_pool_destroy(_free_vg.vgmem); return ret; } |