services/mounttable/btmtd: Add --name flag

The --name flag specifies where this mounttable should mount itself.

Change-Id: I6c7b5a86e4165f3f8ee2634153318eb9cd780d10
diff --git a/services/mounttable/btmtd/doc.go b/services/mounttable/btmtd/doc.go
index 3882d49..a746e59 100644
--- a/services/mounttable/btmtd/doc.go
+++ b/services/mounttable/btmtd/doc.go
@@ -25,6 +25,8 @@
    If true, use an in-memory bigtable server (for testing only)
  -key-file=
    The file that contains the Google Cloud JSON credentials to use
+ -name=
+   If provided, causes the mount table to mount itself under this name.
  -permissions-file=
    The file that contains the initial node permissions.
  -project=
diff --git a/services/mounttable/btmtd/main.go b/services/mounttable/btmtd/main.go
index 2e5676a..b70cbbf 100644
--- a/services/mounttable/btmtd/main.go
+++ b/services/mounttable/btmtd/main.go
@@ -60,6 +60,7 @@
 	inMemoryTestFlag bool
 
 	permissionsFileFlag string
+	mountNameFlag       string
 )
 
 func main() {
@@ -71,6 +72,7 @@
 	cmdRoot.Flags.StringVar(&tableFlag, "table", "mounttable", "The name of the table to use")
 	cmdRoot.Flags.BoolVar(&inMemoryTestFlag, "in-memory-test", false, "If true, use an in-memory bigtable server (for testing only)")
 	cmdRoot.Flags.StringVar(&permissionsFileFlag, "permissions-file", "", "The file that contains the initial node permissions.")
+	cmdRoot.Flags.StringVar(&mountNameFlag, "name", "", "If provided, causes the mount table to mount itself under this name.")
 
 	cmdline.HideGlobalFlagsExcept()
 	cmdline.Main(cmdRoot)
@@ -126,7 +128,7 @@
 	}
 	acl := globalPerms["Admin"]
 	disp := internal.NewDispatcher(bt, &acl)
-	ctx, server, err := v23.WithNewDispatchingServer(ctx, "", disp, options.ServesMountTable(true))
+	ctx, server, err := v23.WithNewDispatchingServer(ctx, mountNameFlag, disp, options.ServesMountTable(true))
 	if err != nil {
 		return err
 	}