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 exit 0
fi fi
mount -o tcp,ro $mountpoint $localmp mount -o tcp,soft,ro,timeo=133,retrans=1 $mountpoint $localmp
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "6#can't mount $mountpoint to $localmp" echo "6#can't mount $mountpoint to $localmp"
exit 0 exit 0

View File

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

View File

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

View File

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