Skip to content

Add vg/lv tag addition/deletion to lvm2app

Dave Wysochanski lvm-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Refactor _vgchange_tag() to vg_change_tag() library function.lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/vgchange.c+26 -180 replies
2/7Refactor vgcreate to call new vg_change_tag() function.tools/vgcreate.c+1 -90 replies
3/7Refactor lvchange_tag() to call lv_change_tag() library function.lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/lvchange.c+27 -180 replies
4/7Add _tag_copy() to allocate memory and copy a tag in {lv|vg}_change_tag()lib/metadata/metadata.c+20 -21 reply
5/7Add lvm_vg_get_tags(), lvm_vg_add_tag(), and lvm_vg_remove_tag().liblvm/.exported_symbols liblvm/lvm2app.h liblvm/lvm_vg.c+105 -20 replies
6/7Add lvm_lv_get_tags(), lvm_lv_add_tag(), and lvm_lv_remove_tag().liblvm/.exported_symbols liblvm/lvm2app.h liblvm/lvm_lv.c+107 -00 replies
7/7Update lvm2app interactive unit test for vg/lv tags.test/api/test.c+99 -61 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] Add vg/lv tag addition/deletion to lvm2app

This patchset adds lv/vg tag addition/deletion to lvm2app. pv tags will be handled later when the pv refactoring patches are done. Partially fixes rhbz 562909.

Patchset is fairly straightforward. When adding a tag, we need to copy the tag memory before adding it to the list (see patch #4). The copy could be placed inside lvm2app or in the internal library. I chose the internal library to minmize code in lvm2app. Another finer point is what to return when the 'get_tags' lvm2app function is called but there's no tags - a NULL pointer or an empty list. For now I've chosen a NULL pointer to avoid allocation of memory. There is some inconsistency here in lvm2app but the behavior is documented in the header for all functions that return lists.