use soft mount for secondary storage

This commit is contained in:
anthony 2011-12-21 20:31:40 -08:00
parent b2f8c4bb2b
commit c00d663df2
4 changed files with 7 additions and 7 deletions

View File

@ -48,7 +48,7 @@ if [ $? -ne 0 ]; then
exit 0
fi
mount -o tcp,ro $mountpoint $localmp
mount -o tcp,soft,ro,timeo=133,retrans=1 $mountpoint $localmp
if [ $? -ne 0 ]; then
echo "6#can't mount $mountpoint to $localmp"
exit 0

View File

@ -56,7 +56,7 @@ if [ $? -ne 0 ]; then
exit 0
fi
mount -o tcp $mountpoint $localmp
mount -o tcp,soft,timeo=133,retrans=1 $mountpoint $localmp
if [ $? -ne 0 ]; then
echo "6#can't mount $mountpoint to $localmp"
exit 0

View File

@ -6,7 +6,7 @@
usage() {
printf "Usage: %s [vhd file in secondary storage] [template directory in secondary storage] \n" $(basename $0)
}
options='tcp,soft,timeo=133,retrans=1'
cleanup()
{
if [ ! -z $snapshotdir ]; then
@ -47,7 +47,7 @@ if [ $? -ne 0 ]; then
exit 0
fi
mount -o tcp $snapshoturl $snapshotdir
mount -o $options $snapshoturl $snapshotdir
if [ $? -ne 0 ]; then
rmdir $snapshotdir
echo "5#can not mount $snapshoturl to $snapshotdir"
@ -63,7 +63,7 @@ if [ $? -ne 0 ]; then
exit 0
fi
mount -o tcp $templateurl $templatedir
mount -o $options $templateurl $templatedir
if [ $? -ne 0 ]; then
rmdir $templatedir
templatedir=""

View File

@ -284,9 +284,9 @@ def makedirs(path):
def mount(remoteDir, localDir):
makedirs(localDir)
options = "soft,tcp,timeo=133,retrans=1"
try:
cmd = ['mount', '-o', 'tcp', remoteDir, localDir]
cmd = ['mount', '-o', options, remoteDir, localDir]
txt = util.pread2(cmd)
except:
txt = ''