From b7b062ba795521433ecd82fa4f214084d17f1ffa Mon Sep 17 00:00:00 2001 From: Wim Muskee Date: Sat, 17 Mar 2012 12:33:55 +0100 Subject: [PATCH] provide name based nbd connects Because nbd-server also provides name-based exports instead of port-based ones, make it possible to connect to those. --- modules.d/95nbd/nbdroot.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules.d/95nbd/nbdroot.sh b/modules.d/95nbd/nbdroot.sh index e20b4e4..0e7dd9b 100755 --- a/modules.d/95nbd/nbdroot.sh +++ b/modules.d/95nbd/nbdroot.sh @@ -30,6 +30,11 @@ nbdfstype=${root%%:*}; root=${root#*:} nbdflags=${root%%:*} nbdopts=${root#*:} +# If nbdport not an integer, then assume name based import +if [[ $nbdport != [0-9]* ]]; then + nbdport="-N $nbdport" +fi + if [ "$nbdopts" = "$nbdflags" ]; then unset nbdopts fi