mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-05-09 05:30:05 +00:00
arm-autonomy/xenguest-manager: remove double arguments checking
This patch brings following changes to xenguest_volume_init() function:
(*) removes doubled arguments validation,
(*) adds missing check_private() call,
(*) inherits diskdevice and volumename values,
as first and second function arguments.
Issue-Id: SCM-1520
Change-Id: Id01a326c2db5db1fcaae9237f887e97ea208d6ff
Signed-off-by: Kamil Dziezyk <kamil.dziezyk@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
@@ -113,28 +113,32 @@ check_size() {
|
||||
|
||||
function xenguest_volume_init()
|
||||
{
|
||||
# Return:
|
||||
# Inputs:
|
||||
# $1 - diskdevice
|
||||
# $2 - volumename
|
||||
#
|
||||
# Outputs:
|
||||
# 0 - success
|
||||
# 1 - failure
|
||||
|
||||
check_private
|
||||
|
||||
local diskdevice
|
||||
local volumename
|
||||
|
||||
if [ -z "${DISK_DEVICE}" ]; then
|
||||
# By default guest is using disk defined inside xenguest-manager.conf
|
||||
diskdevice="${XENGUEST_VOLUME_DEVICE}"
|
||||
volumename="${XENGUEST_VOLUME_NAME}"
|
||||
else
|
||||
# If guest configuration contains custom disk setting,
|
||||
# overwrite default one
|
||||
diskdevice="${DISK_DEVICE}"
|
||||
volumename="vg-xen-$(basename ${diskdevice})"
|
||||
fi
|
||||
diskdevice="${1}"
|
||||
volumename="${2}"
|
||||
|
||||
if [ -z "${diskdevice}" -o ! -b "${diskdevice}" ]; then
|
||||
echo "${PREF} Invalid volume device in configuration: ${diskdevice}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -z "${volumename}" ]; then
|
||||
echo "${PREF} Invalid volume name in configuration: ${volumename}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
pvs "${diskdevice}" > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
# Check if there is no filesystem in the block device
|
||||
@@ -229,7 +233,7 @@ function xenguest_disk_init()
|
||||
echo "${PREF} Create ${guestname} disk."
|
||||
|
||||
# Init our volume
|
||||
xenguest_volume_init ${guestname}
|
||||
xenguest_volume_init "${diskdevice}" "${volumename}"
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user