ACC SHELL
/**
* File:
* lvm_lv_lib.ycp
*
* Module:
*
* Summary: lib for lvm-configs logical volume management
*
* Authors:
* mike <mike@suse.de>
*
* $Id: lvm_lv_lib.ycp 57106 2009-05-08 12:26:51Z aschnell $
*
*
*----------------------------------------------------
* IMPORTANT: when you read this code notice:
*
* vg = volume group
* vgs = volume groups
*
* pv = physical volume
* pvs = physical volumes
*
* lv = logical volume
* lvs = logical volumes
*----------------------------------------------------
*
*/
{
textdomain "storage";
import "Storage";
import "Popup";
include "partitioning/lvm_lib.ycp";
include "partitioning/lvm_pv_lib.ycp";
define void popupText( integer stripe )
{
string txt = _("A logical volume with the requested size could
not be created.
");
if( stripe > 1 )
txt = txt + _("Try reducing the stripe count of the volume.");
Popup::Error( txt );
}
define boolean addLogicalVolume( map Lv, string current_vg )
``{
boolean ret=true;
if( !Storage::CreateLvmLv( current_vg, Lv["name"]:"", Lv["size_k"]:0,
Lv["stripes"]:1 ))
{
popupText( Lv["stripes"]:1 );
ret = false;
}
else
{
ret = Storage::ChangeVolumeProperties( Lv );
if( Lv["stripes"]:1>1 && Lv["stripesize"]:0>0 )
ret = Storage::ChangeLvStripeSize( current_vg, Lv["name"]:"",
Lv["stripesize"]:0 ) && ret;
}
return( ret );
};
////////////////////////////////////////////////////////////////////////////////
// Get all existing lv names of a volume group
list<string> get_lv_names(map<string, map> target_map, string vg_name)
{
list<map> parts = target_map["/dev/" + vg_name, "partitions"]:[];
list<string> ret = maplist(map part, parts, { return part["name"]:""; });
return ret;
};
}
ACC SHELL 2018