Skip to content

RFC dm_report attribute handling and liblvm vg attributes

Dave Wysochanski lvm-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest12 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12Add dm_report_output_attributes() API to dm_report framework.libdm/.exported_symbols libdm/libdevmapper.h libdm/libdm-report.c+113 -30 replies
2/12Add system_dir to create_toolcontext().daemons/clvmd/lvm-functions.c lib/commands/toolcontext.c lib/commands/toolcontext.h +1 more+8 -40 replies
3/12Add lvm_create, lvm_destroy, lvm_reload_config() APIs.lib/Makefile.in lib/lvm2.c lib/lvm2.h +1 more+98 -250 replies
4/12Move vg_t, lv_t, and pv_t from metadata-exported.h into lvm2.hlib/lvm2.h lib/metadata/metadata-exported.h+10 -71 reply
5/12Add lvm_pv_name, lvm_vg_name, and lvm_lv_name accessors.lib/lvm2.h lib/metadata/metadata.c+22 -01 reply
6/12Add lvm_vg_open().lib/lvm2.h lib/metadata/metadata.c+16 -00 replies
7/12Add lvm_vg_close().lib/lvm2.h lib/metadata/metadata.c+12 -00 replies
8/12Add lvm_errno(), lvm_strerror, lvm_vg_mode.lib/lvm2.c lib/lvm2.h lib/metadata/metadata-exported.h +1 more+100 -392 replies
9/12Update lvm_vg_open() to read and store the list of vg attributes.lib/lvm2.c lib/metadata/metadata-exported.h+47 -10 replies
10/12Add lvm_vg_get_attr_list() and lvm_vg_get_attr().lib/lvm2.h lib/report/report.c+37 -10 replies
11/12Add lvm_vgname_from_vgid() and lvm_get_vgids()lib/lvm2.c lib/lvm2.h+16 -10 replies
12/12Add test code.test/api/test.c+235 -90 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/12] dm_report attribute handling and liblvm vg attributes

The purpose of this patchset is to get feedback on one approach to handling attributes in liblvm. The most important patches are:
1/12: Adds dm_report_output_attribute() function and related structures. 9/12: Updates vg_open to store vg attributes in the handle. This allows us to use the report memory safely (we free it in vg_close(). 10/12: Add lvm_vg_get_attr_list() and lvm_vg_get_attr().

What is missing in the patch is the mode (read/write) of the attribute. I have not thought extensively about this but one option is as follows. Add a 'mode' or 'is_writable' field to the dm structure, and set it to 'readonly' for all attributes output by dm_report_output_attribute(). Then in vg_open(), depending on the mode and capabilities of the current release of liblvm code, we can gradually change various attributes to writeable.

This patchset should build fine but with some warnings. Attribute code was exercised with test code in last patch.