@@ -20,7 +20,8 @@
_dmerror_init()
{
- local dm_backing_dev=$SCRATCH_DEV
+ local dm_backing_dev=${1:-$SCRATCH_DEV}
+ DMERROR_MNT=${2:-$SCRATCH_MNT}
$DMSETUP_PROG remove error-test > /dev/null 2>&1
@@ -38,7 +39,7 @@ _dmerror_init()
_dmerror_mount_options()
{
- echo `_common_dev_mount_options $*` $DMERROR_DEV $SCRATCH_MNT
+ echo `_common_dev_mount_options $*` $DMERROR_DEV $DMERROR_MNT
}
_dmerror_mount()
@@ -48,12 +49,12 @@ _dmerror_mount()
_dmerror_unmount()
{
- umount $SCRATCH_MNT
+ umount $DMERROR_MNT
}
_dmerror_cleanup()
{
- $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+ $UMOUNT_PROG $DMERROR_MNT > /dev/null 2>&1
$DMSETUP_PROG remove error-test > /dev/null 2>&1
}
Currently dmerror code takes use of SCRATCH_DEV and SCRATCH_MNT as the backend device and mount point, and there's no way to change them. Now teach _dmerror_init to accept first argument as backend device and second argument as the alternative mount point, this can be useful when SCRATCH_DEV and/or SCRATCH_MNT is not suitable for the test. Signed-off-by: Eryu Guan <eguan@redhat.com> --- common/dmerror | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)