Skip to content

: Implement lvm_vg_create() and 4 required vg_set*() APIs

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/7Update vg_change_pesize() to contain all validity checks.lib/metadata/metadata.c tools/vgchange.c+32 -250 replies
2/7Remove unused 'cmd' from vg_change_pesize().lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/vgchange.c+3 -50 replies
3/7Rename vg_change_pesize to vg_set_extent_size and use vg_t.lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/vgchange.c+3 -30 replies
4/7Add vg_set_max_lv() liblvm function and move vgchange logic inside.lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/vgchange.c+31 -230 replies
5/7Add vg_set_max_pv() liblvm function and move vgchange logic inside.lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/vgchange.c+30 -230 replies
6/7Add vg_set_alloc() liblvm function and move vgchange logic inside.lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/vgchange.c+21 -131 reply
7/7Add lvm_vg_create() - vg constructor API for new volume groups.lib/metadata/metadata-exported.h lib/metadata/metadata.c tools/vgcreate.c +1 more+75 -504 replies
7/7Add lvm_vg_create() - vg constructor API for new volume groups.+0 -00 replies

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]: Implement lvm_vg_create() and 4 required vg_set*() APIs

The following 7 patches implement the beginning of lvm_vg_create() liblvm API. This API will create a VG with default parameters and return a vg_t. Later, if any parameters of the VG need set, they are done with a separate 'set' call. This is the approach that was discussed for liblvm, and required some refactoring of the code, including vgcreate and vgsplit. The reason for the refactoring of vgcreate and vgsplit is that the existing vg_create() constructor did not take this approach, but rather took input parameters such as extent_size, max_pv, max_lv, etc. Thus, to implement what was decided, I had to pull out all the validity checks into a separate 'set' function.

In addition, lvm_vg_create() now takes the place of vg_lock_newname() in both vgcreate and vgsplit. I believe that down the road we may not have to export vg_lock_newname() but can use lvm_vg_create() for the existence check, and as a complement to the vg_read() APIs. The only remaining use of vg_lock_newname() is in vgrename, and this use can be hidden inside a vgrename API.

Note that in a few cases, for the 'set' functions, the return codes have been modified slightly. The cases are things like EINVALID_CMD_LINE becomes ECMD_FAILED, and setting the same value returning SUCCESS or FAILURE (this was inconsistent in the code - sometimes it was an error, sometimes it was success - I made it always a success).

Passes the testsuite, and should apply cleanly on:
commit ea47a922568e19202ac365b5eb00bf55b4b6d8a2

Author: Dave Wysochanski <[email protected]>
Date:   Mon Jul 6 21:42:25 2009 -0400

Fix compile warning in lvmcmdline.c - use C99 PRIu64 for uint64_t.