provide name based nbd connects
authorWim Muskee <wimmuskee@gmail.com>
Sat, 17 Mar 2012 11:33:55 +0000 (12:33 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 21 Mar 2012 12:06:49 +0000 (13:06 +0100)
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

index e20b4e4..0e7dd9b 100755 (executable)
@@ -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