From dcda3cdb7dcfc2190253fdc87dd34e10ec22b384 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Wed, 25 Feb 2009 05:07:07 +0000 Subject: Simplified handling of mounting the image sources via newly introduced function fsmount, see r2639. git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2640 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/vmware/XX_vmware.sh | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'os-plugins/plugins/vmware/XX_vmware.sh') diff --git a/os-plugins/plugins/vmware/XX_vmware.sh b/os-plugins/plugins/vmware/XX_vmware.sh index 4dab751c..f3e059b7 100644 --- a/os-plugins/plugins/vmware/XX_vmware.sh +++ b/os-plugins/plugins/vmware/XX_vmware.sh @@ -152,31 +152,13 @@ $(ipcalc -m $vmip/$vmpx|sed s/.*=//) {" \ vmimgserv=$(uri_token ${vmware_imagesrc} server) vmimgpath="$(uri_token ${vmware_imagesrc} path)" fi - if [ -n "${vmimgserv}" ] ; then - testmkd /mnt/var/lib/virt/vmware - case "${vmimgprot}" in - *nbd) - # TODO: to be filled in ... - ;; - lbdev) - # we expect the stuff on toplevel directory, filesystem type should be - # autodetected here ... (vmimgserv is blockdev here) - vmbdev=/dev/${vmimgserv} - waitfor ${vmbdev} 20000 - echo -e "ext2\nreiserfs\nvfat\nxfs" >/etc/filesystems - mount -o ro ${vmbdev} /mnt/var/lib/virt/vmware || \ - error "$scfg_evmlm" nonfatal - ;; - *) - # we expect nfs mounts here ... - for proto in tcp udp fail; do - [ $proto = "fail" ] && { error "$scfg_nfs" nonfatal; - noimg=yes; break;} - mount -n -t nfs -o ro,nolock,$proto ${vmimgserv}:${vmimgpath} \ - /mnt/var/lib/virt/vmware && break - done - ;; - esac + if [ -n "${vmimgserv}" -a -n ${vmimgpath} -a -n ${vmimgprot} ] ; then + mnttarget=/mnt/var/lib/virt/vmware + # mount the vmware image source readonly (ro) + fsmount ${vmimgprot} ${vmimgserv} ${vmimgpath} ${mnttarget} ro + else + [ $DEBUGLEVEL -gt 1 ] && error " * Incomplete information in variable \ +${vmware_imagesrc}." nonfatal fi ############################################################################# -- cgit v1.2.3-55-g7522