mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-27 01:57:55 +03:00
Add lvm_vg_remove_lv liblvm function.
Add a very simple version of lvm_vg_remove_lv. Since we currently can only create linear LVs, this simple remove function is adequate. We must refactor lvremove_single a bit. Author: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
c4510327d4
commit
7e3141512a
@ -30,3 +30,4 @@ lvm_vg_list_lvs
|
||||
lvm_list_vg_names
|
||||
lvm_list_vg_ids
|
||||
lvm_vg_create_lv_linear
|
||||
lvm_vg_remove_lv
|
||||
|
11
liblvm/lvm.h
11
liblvm/lvm.h
@ -116,6 +116,17 @@ int lvm_reload_config(lvm_t libh);
|
||||
*/
|
||||
lv_t *lvm_vg_create_lv_linear(vg_t *vg, const char *name, uint64_t size);
|
||||
|
||||
/**
|
||||
* Remove a logical volume from a volume group.
|
||||
* This API commits the change to disk and does _not_ require calling
|
||||
* lvm_vg_write.
|
||||
* Currently only removing linear LVs are possible.
|
||||
*
|
||||
* FIXME: This API should probably not commit to disk but require calling
|
||||
* lvm_vg_write.
|
||||
*/
|
||||
int lvm_vg_remove_lv(lv_t *lv);
|
||||
|
||||
/**
|
||||
* Return stored error no describing last LVM API error.
|
||||
*
|
||||
|
@ -96,3 +96,9 @@ lv_t *lvm_vg_create_lv_linear(vg_t *vg, const char *name, uint64_t size)
|
||||
return lvl->lv;
|
||||
}
|
||||
|
||||
int lvm_vg_remove_lv(lv_t *lv)
|
||||
{
|
||||
if (!lv || !lv->vg || vg_read_error(lv->vg))
|
||||
return 0;
|
||||
return lv_remove_single(lv->vg->cmd, lv, DONT_PROMPT);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user