veyron2/services/mgmt/node,veyron/services/mgmt/node,veyron/tools/mgmt: rename node->device, cl 3 of N (go/vissue/496)

Rename files and packages.

Change-Id: I29199a97c2ca6d6eb721e0d9fe41a71044e52579
diff --git a/services/mgmt/node/config.vdl b/services/mgmt/device/config.vdl
similarity index 89%
rename from services/mgmt/node/config.vdl
rename to services/mgmt/device/config.vdl
index 71ab83a..67813d1 100644
--- a/services/mgmt/node/config.vdl
+++ b/services/mgmt/device/config.vdl
@@ -1,4 +1,4 @@
-package node
+package device
 
 // Config is an RPC API to the config service.
 type Config interface {
diff --git a/services/mgmt/node/config.vdl.go b/services/mgmt/device/config.vdl.go
similarity index 98%
rename from services/mgmt/node/config.vdl.go
rename to services/mgmt/device/config.vdl.go
index 42bb189..6fbd08a 100644
--- a/services/mgmt/node/config.vdl.go
+++ b/services/mgmt/device/config.vdl.go
@@ -1,7 +1,7 @@
 // This file was auto-generated by the veyron vdl tool.
 // Source: config.vdl
 
-package node
+package device
 
 import (
 	// The non-user imports are prefixed with "__" to prevent collisions.
@@ -141,7 +141,7 @@
 // descConfig hides the desc to keep godoc clean.
 var descConfig = __ipc.InterfaceDesc{
 	Name:    "Config",
-	PkgPath: "veyron.io/veyron/veyron/services/mgmt/node",
+	PkgPath: "veyron.io/veyron/veyron/services/mgmt/device",
 	Doc:     "// Config is an RPC API to the config service.",
 	Methods: []__ipc.MethodDesc{
 		{
diff --git a/services/mgmt/node/config/config.go b/services/mgmt/device/config/config.go
similarity index 100%
rename from services/mgmt/node/config/config.go
rename to services/mgmt/device/config/config.go
diff --git a/services/mgmt/node/config/config_test.go b/services/mgmt/device/config/config_test.go
similarity index 98%
rename from services/mgmt/node/config/config_test.go
rename to services/mgmt/device/config/config_test.go
index 5735b87..d053126 100644
--- a/services/mgmt/node/config/config_test.go
+++ b/services/mgmt/device/config/config_test.go
@@ -7,7 +7,7 @@
 	"strings"
 	"testing"
 
-	"veyron.io/veyron/veyron/services/mgmt/node/config"
+	"veyron.io/veyron/veyron/services/mgmt/device/config"
 
 	"veyron.io/veyron/veyron2/services/mgmt/application"
 )
diff --git a/services/mgmt/node/config/const.go b/services/mgmt/device/config/const.go
similarity index 100%
rename from services/mgmt/node/config/const.go
rename to services/mgmt/device/config/const.go
diff --git a/services/mgmt/node/noded/main.go b/services/mgmt/device/deviced/main.go
similarity index 95%
rename from services/mgmt/node/noded/main.go
rename to services/mgmt/device/deviced/main.go
index 624299c..1397a24 100644
--- a/services/mgmt/node/noded/main.go
+++ b/services/mgmt/device/deviced/main.go
@@ -10,8 +10,8 @@
 
 	"veyron.io/veyron/veyron/lib/signals"
 	"veyron.io/veyron/veyron/profiles/roaming"
-	"veyron.io/veyron/veyron/services/mgmt/node/config"
-	"veyron.io/veyron/veyron/services/mgmt/node/impl"
+	"veyron.io/veyron/veyron/services/mgmt/device/config"
+	"veyron.io/veyron/veyron/services/mgmt/device/impl"
 )
 
 var (
diff --git a/services/mgmt/node/doc.go b/services/mgmt/device/doc.go
similarity index 91%
rename from services/mgmt/node/doc.go
rename to services/mgmt/device/doc.go
index 82a4271..5d6b478 100644
--- a/services/mgmt/node/doc.go
+++ b/services/mgmt/device/doc.go
@@ -1,4 +1,4 @@
-// Package node contains the implementation for the veyron2/mgmt/node APIs.
+// Package device contains the implementation for the veyron2/mgmt/device APIs.
 //
 // The device manager is a server that is expected to run on every
 // Veyron-enabled device, and it handles both device management and management
@@ -31,5 +31,5 @@
 // The config subpackage encapsulates the configuration settings that form the
 // device manager service's 'contract' with its environment.
 //
-// The noded subpackage contains the main driver.
-package node
+// The deviced subpackage contains the main driver.
+package device
diff --git a/services/mgmt/node/impl/app_service.go b/services/mgmt/device/impl/app_service.go
similarity index 99%
rename from services/mgmt/node/impl/app_service.go
rename to services/mgmt/device/impl/app_service.go
index ca99029..99312df 100644
--- a/services/mgmt/node/impl/app_service.go
+++ b/services/mgmt/device/impl/app_service.go
@@ -144,9 +144,9 @@
 	vsecurity "veyron.io/veyron/veyron/security"
 	"veyron.io/veyron/veyron/security/agent"
 	"veyron.io/veyron/veyron/security/agent/keymgr"
+	iconfig "veyron.io/veyron/veyron/services/mgmt/device/config"
 	libbinary "veyron.io/veyron/veyron/services/mgmt/lib/binary"
 	libpackages "veyron.io/veyron/veyron/services/mgmt/lib/packages"
-	iconfig "veyron.io/veyron/veyron/services/mgmt/node/config"
 )
 
 // instanceInfo holds state about a running instance.
diff --git a/services/mgmt/node/impl/app_state.go b/services/mgmt/device/impl/app_state.go
similarity index 100%
rename from services/mgmt/node/impl/app_state.go
rename to services/mgmt/device/impl/app_state.go
diff --git a/services/mgmt/node/impl/app_state_test.go b/services/mgmt/device/impl/app_state_test.go
similarity index 100%
rename from services/mgmt/node/impl/app_state_test.go
rename to services/mgmt/device/impl/app_state_test.go
diff --git a/services/mgmt/node/impl/args_darwin_test.go b/services/mgmt/device/impl/args_darwin_test.go
similarity index 100%
rename from services/mgmt/node/impl/args_darwin_test.go
rename to services/mgmt/device/impl/args_darwin_test.go
diff --git a/services/mgmt/node/impl/args_linux_test.go b/services/mgmt/device/impl/args_linux_test.go
similarity index 100%
rename from services/mgmt/node/impl/args_linux_test.go
rename to services/mgmt/device/impl/args_linux_test.go
diff --git a/services/mgmt/node/impl/associate_instance_test.go b/services/mgmt/device/impl/associate_instance_test.go
similarity index 100%
rename from services/mgmt/node/impl/associate_instance_test.go
rename to services/mgmt/device/impl/associate_instance_test.go
diff --git a/services/mgmt/node/impl/association_instance.go b/services/mgmt/device/impl/association_instance.go
similarity index 100%
rename from services/mgmt/node/impl/association_instance.go
rename to services/mgmt/device/impl/association_instance.go
diff --git a/services/mgmt/node/impl/association_state.go b/services/mgmt/device/impl/association_state.go
similarity index 91%
rename from services/mgmt/node/impl/association_state.go
rename to services/mgmt/device/impl/association_state.go
index 9abed47..95412d4 100644
--- a/services/mgmt/node/impl/association_state.go
+++ b/services/mgmt/device/impl/association_state.go
@@ -6,7 +6,7 @@
 	"path/filepath"
 	"sync"
 
-	"veyron.io/veyron/veyron2/services/mgmt/node"
+	"veyron.io/veyron/veyron2/services/mgmt/device"
 	"veyron.io/veyron/veyron2/verror2"
 )
 
@@ -20,7 +20,7 @@
 
 	// AllBlessingSystemAssociations returns all of the current Blessing to system
 	// account associations.
-	AllBlessingSystemAssociations() ([]node.Association, error)
+	AllBlessingSystemAssociations() ([]device.Association, error)
 
 	// AssociateSystemAccountForBlessings associates the provided systenName with each
 	// provided blessing.
@@ -51,13 +51,13 @@
 	return systemName, present
 }
 
-func (u *association) AllBlessingSystemAssociations() ([]node.Association, error) {
+func (u *association) AllBlessingSystemAssociations() ([]device.Association, error) {
 	u.Lock()
 	defer u.Unlock()
-	assocs := make([]node.Association, 0)
+	assocs := make([]device.Association, 0)
 
 	for k, v := range u.data {
-		assocs = append(assocs, node.Association{k, v})
+		assocs = append(assocs, device.Association{k, v})
 	}
 	return assocs, nil
 }
diff --git a/services/mgmt/node/impl/association_state_test.go b/services/mgmt/device/impl/association_state_test.go
similarity index 94%
rename from services/mgmt/node/impl/association_state_test.go
rename to services/mgmt/device/impl/association_state_test.go
index 2d715f1..49054ba 100644
--- a/services/mgmt/node/impl/association_state_test.go
+++ b/services/mgmt/device/impl/association_state_test.go
@@ -7,8 +7,8 @@
 	"path"
 	"testing"
 
-	"veyron.io/veyron/veyron/services/mgmt/node/impl"
-	"veyron.io/veyron/veyron2/services/mgmt/node"
+	"veyron.io/veyron/veyron/services/mgmt/device/impl"
+	"veyron.io/veyron/veyron2/services/mgmt/device"
 )
 
 // TestAssociationPersistance verifies correct operation of association
@@ -35,7 +35,7 @@
 		t.Fatalf("AllBlessingSystemAssociations failed: %v", err)
 	}
 
-	compareAssociations(t, got1, []node.Association{
+	compareAssociations(t, got1, []device.Association{
 		{
 			"alice",
 			"alice_account",
@@ -84,7 +84,7 @@
 	if err != nil {
 		t.Fatalf("AllBlessingSystemAssociations failed: %v", err)
 	}
-	compareAssociations(t, got1, []node.Association{
+	compareAssociations(t, got1, []device.Association{
 		{
 			"alice",
 			"alice_account",
@@ -100,7 +100,7 @@
 	if err != nil {
 		t.Fatalf("AllBlessingSystemAssociations failed: %v", err)
 	}
-	compareAssociations(t, got1, []node.Association{
+	compareAssociations(t, got1, []device.Association{
 		{
 			"alice",
 			"alice_other_account",
diff --git a/services/mgmt/node/impl/callback.go b/services/mgmt/device/impl/callback.go
similarity index 90%
rename from services/mgmt/node/impl/callback.go
rename to services/mgmt/device/impl/callback.go
index 4c93d5c..d7e7c90 100644
--- a/services/mgmt/node/impl/callback.go
+++ b/services/mgmt/device/impl/callback.go
@@ -6,7 +6,7 @@
 	"veyron.io/veyron/veyron2/vlog"
 
 	"veyron.io/veyron/veyron/lib/exec"
-	"veyron.io/veyron/veyron/services/mgmt/node"
+	"veyron.io/veyron/veyron/services/mgmt/device"
 )
 
 // InvokeCallback provides the parent device manager with the given name (which
@@ -21,7 +21,7 @@
 			// Device manager was not started by self-update, return silently.
 			return
 		}
-		nmClient := node.ConfigClient(callbackName)
+		nmClient := device.ConfigClient(callbackName)
 		ctx, cancel := ctx.WithTimeout(ipcContextTimeout)
 		defer cancel()
 		if err := nmClient.Set(ctx, mgmt.ChildNameConfigKey, name); err != nil {
diff --git a/services/mgmt/node/impl/config_service.go b/services/mgmt/device/impl/config_service.go
similarity index 100%
rename from services/mgmt/node/impl/config_service.go
rename to services/mgmt/device/impl/config_service.go
diff --git a/services/mgmt/node/impl/node_installer.go b/services/mgmt/device/impl/device_installer.go
similarity index 97%
rename from services/mgmt/node/impl/node_installer.go
rename to services/mgmt/device/impl/device_installer.go
index c8060c9..b296c4b 100644
--- a/services/mgmt/node/impl/node_installer.go
+++ b/services/mgmt/device/impl/device_installer.go
@@ -11,7 +11,7 @@
 	"veyron.io/veyron/veyron2/vlog"
 
 	// For VeyronEnvironment, see TODO.
-	"veyron.io/veyron/veyron/services/mgmt/node/config"
+	"veyron.io/veyron/veyron/services/mgmt/device/config"
 )
 
 // InstallFrom takes a veyron object name denoting an application service where
diff --git a/services/mgmt/node/impl/node_service.go b/services/mgmt/device/impl/device_service.go
similarity index 96%
rename from services/mgmt/node/impl/node_service.go
rename to services/mgmt/device/impl/device_service.go
index 7c38b70..b31ceae 100644
--- a/services/mgmt/node/impl/node_service.go
+++ b/services/mgmt/device/impl/device_service.go
@@ -45,14 +45,14 @@
 	"veyron.io/veyron/veyron2/naming"
 	"veyron.io/veyron/veyron2/services/mgmt/application"
 	"veyron.io/veyron/veyron2/services/mgmt/binary"
-	"veyron.io/veyron/veyron2/services/mgmt/node"
+	"veyron.io/veyron/veyron2/services/mgmt/device"
 	"veyron.io/veyron/veyron2/services/security/access"
 	"veyron.io/veyron/veyron2/verror2"
 	"veyron.io/veyron/veyron2/vlog"
 
 	vexec "veyron.io/veyron/veyron/lib/exec"
 	"veyron.io/veyron/veyron/lib/netstate"
-	"veyron.io/veyron/veyron/services/mgmt/node/config"
+	"veyron.io/veyron/veyron/services/mgmt/device/config"
 	"veyron.io/veyron/veyron/services/mgmt/profile"
 )
 
@@ -103,8 +103,8 @@
 	return i.disp.claimDeviceManager(call.LocalPrincipal(), blessings.ForContext(call), blessings)
 }
 
-func (*deviceService) Describe(ipc.ServerContext) (node.Description, error) {
-	empty := node.Description{}
+func (*deviceService) Describe(ipc.ServerContext) (device.Description, error) {
+	empty := device.Description{}
 	deviceProfile, err := computeDeviceProfile()
 	if err != nil {
 		return empty, err
@@ -240,7 +240,7 @@
 	}
 	// Check that invoking Revert() succeeds.
 	childName = naming.Join(childName, "nm")
-	nmClient := node.DeviceClient(childName)
+	nmClient := device.DeviceClient(childName)
 	linkOld, pathOld, err := i.getCurrentFileInfo()
 	if err != nil {
 		return verror2.Make(ErrOperationFailed, ctx)
@@ -274,7 +274,7 @@
 	return nil
 }
 
-// TODO(caprita): Move this to util.go since node_installer is also using it now.
+// TODO(caprita): Move this to util.go since device_installer is also using it now.
 
 func generateScript(workspace string, configSettings []string, envelope *application.Envelope) error {
 	// TODO(caprita): Remove this snippet of code, it doesn't seem to serve
@@ -477,7 +477,7 @@
 	}
 }
 
-func (i *deviceService) ListAssociations(call ipc.ServerContext) (associations []node.Association, err error) {
+func (i *deviceService) ListAssociations(call ipc.ServerContext) (associations []device.Association, err error) {
 	// Temporary code. Dump this.
 	vlog.VI(2).Infof("ListAssociations given blessings: %v\n", call.RemoteBlessings().ForContext(call))
 
diff --git a/services/mgmt/node/impl/dispatcher.go b/services/mgmt/device/impl/dispatcher.go
similarity index 97%
rename from services/mgmt/node/impl/dispatcher.go
rename to services/mgmt/device/impl/dispatcher.go
index db4e942..2dc4e30 100644
--- a/services/mgmt/node/impl/dispatcher.go
+++ b/services/mgmt/device/impl/dispatcher.go
@@ -16,14 +16,14 @@
 	"veyron.io/veyron/veyron/security/agent/keymgr"
 	vflag "veyron.io/veyron/veyron/security/flag"
 	"veyron.io/veyron/veyron/security/serialization"
+	idevice "veyron.io/veyron/veyron/services/mgmt/device"
+	"veyron.io/veyron/veyron/services/mgmt/device/config"
 	logsimpl "veyron.io/veyron/veyron/services/mgmt/logreader/impl"
-	inode "veyron.io/veyron/veyron/services/mgmt/node"
-	"veyron.io/veyron/veyron/services/mgmt/node/config"
 
 	"veyron.io/veyron/veyron2/ipc"
 	"veyron.io/veyron/veyron2/naming"
 	"veyron.io/veyron/veyron2/security"
-	"veyron.io/veyron/veyron2/services/mgmt/node"
+	"veyron.io/veyron/veyron2/services/mgmt/device"
 	"veyron.io/veyron/veyron2/services/mgmt/pprof"
 	"veyron.io/veyron/veyron2/services/mgmt/stats"
 	"veyron.io/veyron/veyron2/services/security/access"
@@ -73,7 +73,7 @@
 	deviceSuffix = "nm"
 	configSuffix = "cfg"
 
-	pkgPath = "veyron.io/veyron/veyron/services/mgmt/node/impl"
+	pkgPath = "veyron.io/veyron/veyron/services/mgmt/device/impl"
 )
 
 var (
@@ -356,7 +356,7 @@
 	// prefix.
 	switch components[0] {
 	case deviceSuffix:
-		receiver := node.DeviceServer(&deviceService{
+		receiver := device.DeviceServer(&deviceService{
 			callback: d.internal.callback,
 			updating: d.internal.updating,
 			config:   d.config,
@@ -407,7 +407,7 @@
 		if err != nil {
 			return nil, nil, err
 		}
-		receiver := node.ApplicationServer(&appService{
+		receiver := device.ApplicationServer(&appService{
 			callback:      d.internal.callback,
 			config:        d.config,
 			suffix:        components[1:],
@@ -425,7 +425,7 @@
 		if len(components) != 2 {
 			return nil, nil, verror2.Make(ErrInvalidSuffix, nil)
 		}
-		receiver := inode.ConfigServer(&configService{
+		receiver := idevice.ConfigServer(&configService{
 			callback: d.internal.callback,
 			suffix:   components[1],
 		})
diff --git a/services/mgmt/node/impl/impl_helper_test.go b/services/mgmt/device/impl/impl_helper_test.go
similarity index 95%
rename from services/mgmt/node/impl/impl_helper_test.go
rename to services/mgmt/device/impl/impl_helper_test.go
index 1eaaeda..34b8e9b 100644
--- a/services/mgmt/node/impl/impl_helper_test.go
+++ b/services/mgmt/device/impl/impl_helper_test.go
@@ -9,7 +9,7 @@
 	"path"
 	"testing"
 
-	"veyron.io/veyron/veyron/services/mgmt/node/impl"
+	"veyron.io/veyron/veyron/services/mgmt/device/impl"
 )
 
 func TestBaseCleanupDir(t *testing.T) {
diff --git a/services/mgmt/node/impl/impl_test.go b/services/mgmt/device/impl/impl_test.go
similarity index 97%
rename from services/mgmt/node/impl/impl_test.go
rename to services/mgmt/device/impl/impl_test.go
index b3387c2..d1f8fe0 100644
--- a/services/mgmt/node/impl/impl_test.go
+++ b/services/mgmt/device/impl/impl_test.go
@@ -34,8 +34,8 @@
 	"veyron.io/veyron/veyron2/rt"
 	"veyron.io/veyron/veyron2/security"
 	"veyron.io/veyron/veyron2/services/mgmt/application"
+	"veyron.io/veyron/veyron2/services/mgmt/device"
 	"veyron.io/veyron/veyron2/services/mgmt/logreader"
-	"veyron.io/veyron/veyron2/services/mgmt/node"
 	"veyron.io/veyron/veyron2/services/mgmt/pprof"
 	"veyron.io/veyron/veyron2/services/mgmt/stats"
 	"veyron.io/veyron/veyron2/services/security/access"
@@ -49,9 +49,9 @@
 	"veyron.io/veyron/veyron/lib/testutil"
 	tsecurity "veyron.io/veyron/veyron/lib/testutil/security"
 	binaryimpl "veyron.io/veyron/veyron/services/mgmt/binary/impl"
+	"veyron.io/veyron/veyron/services/mgmt/device/config"
+	"veyron.io/veyron/veyron/services/mgmt/device/impl"
 	libbinary "veyron.io/veyron/veyron/services/mgmt/lib/binary"
-	"veyron.io/veyron/veyron/services/mgmt/node/config"
-	"veyron.io/veyron/veyron/services/mgmt/node/impl"
 	suidhelper "veyron.io/veyron/veyron/services/mgmt/suidhelper/impl"
 )
 
@@ -282,10 +282,10 @@
 // TODO(rjkroege): generateDeviceManagerScript and generateSuidHelperScript have
 // code similarity that might benefit from refactoring.
 // generateDeviceManagerScript is very similar in behavior to generateScript in
-// node_invoker.go.  However, we chose to re-implement it here for two reasons:
-// (1) avoid making generateScript public; and (2) how the test choses to invoke
-// the device manager subprocess the first time should be independent of how
-// device manager implementation sets up its updated versions.
+// device_invoker.go.  However, we chose to re-implement it here for two
+// reasons: (1) avoid making generateScript public; and (2) how the test choses
+// to invoke the device manager subprocess the first time should be independent
+// of how device manager implementation sets up its updated versions.
 func generateDeviceManagerScript(t *testing.T, root string, args, env []string) string {
 	env = impl.VeyronEnvironment(env)
 	output := "#!/bin/bash\n"
@@ -737,7 +737,7 @@
 
 func tryInstall(ctx context.T) error {
 	appsName := "nm//apps"
-	stub := node.ApplicationClient(appsName)
+	stub := device.ApplicationClient(appsName)
 	if _, err := stub.Install(ctx, mockApplicationRepoName); err != nil {
 		return fmt.Errorf("Install failed: %v", err)
 	}
@@ -807,7 +807,7 @@
 
 	*envelope = envelopeFromShell(sh, nil, appCmd, "google naps", "trapp")
 
-	deviceStub := node.DeviceClient("nm//nm")
+	deviceStub := device.DeviceClient("nm//nm")
 	selfRT := globalRT
 	otherRT := newRuntime(t)
 	defer otherRT.Cleanup()
@@ -895,7 +895,7 @@
 	// Create an envelope for an app.
 	*envelope = envelopeFromShell(sh, nil, appCmd, "google naps")
 
-	deviceStub := node.DeviceClient("nm//nm")
+	deviceStub := device.DeviceClient("nm//nm")
 	acl, etag, err := deviceStub.GetACL(selfRT.NewContext())
 	if err != nil {
 		t.Fatalf("GetACL failed:%v", err)
@@ -1230,7 +1230,7 @@
 	}
 }
 
-func listAndVerifyAssociations(t *testing.T, stub node.DeviceClientMethods, run veyron2.Runtime, expected []node.Association) {
+func listAndVerifyAssociations(t *testing.T, stub device.DeviceClientMethods, run veyron2.Runtime, expected []device.Association) {
 	assocs, err := stub.ListAssociations(run.NewContext())
 	if err != nil {
 		t.Fatalf("ListAssociations failed %v", err)
@@ -1271,7 +1271,7 @@
 	pid := readPID(t, nms)
 	defer syscall.Kill(pid, syscall.SIGINT)
 
-	deviceStub := node.DeviceClient("nm//nm")
+	deviceStub := device.DeviceClient("nm//nm")
 
 	// Attempt to list associations on the device manager without having
 	// claimed it.
@@ -1285,13 +1285,13 @@
 	}
 
 	vlog.VI(2).Info("Verify that associations start out empty.")
-	listAndVerifyAssociations(t, deviceStub, selfRT, []node.Association(nil))
+	listAndVerifyAssociations(t, deviceStub, selfRT, []device.Association(nil))
 
 	if err := deviceStub.AssociateAccount(selfRT.NewContext(), []string{"root/self", "root/other"}, "alice_system_account"); err != nil {
 		t.Fatalf("ListAssociations failed %v", err)
 	}
 	vlog.VI(2).Info("Added association should appear.")
-	listAndVerifyAssociations(t, deviceStub, selfRT, []node.Association{
+	listAndVerifyAssociations(t, deviceStub, selfRT, []device.Association{
 		{
 			"root/self",
 			"alice_system_account",
@@ -1306,7 +1306,7 @@
 		t.Fatalf("AssociateAccount failed %v", err)
 	}
 	vlog.VI(2).Info("Change the associations and the change should appear.")
-	listAndVerifyAssociations(t, deviceStub, selfRT, []node.Association{
+	listAndVerifyAssociations(t, deviceStub, selfRT, []device.Association{
 		{
 			"root/self",
 			"alice_other_account",
@@ -1321,7 +1321,7 @@
 		t.Fatalf("AssociateAccount failed %v", err)
 	}
 	vlog.VI(2).Info("Verify that we can remove an association.")
-	listAndVerifyAssociations(t, deviceStub, selfRT, []node.Association{
+	listAndVerifyAssociations(t, deviceStub, selfRT, []device.Association{
 		{
 			"root/self",
 			"alice_other_account",
@@ -1379,7 +1379,7 @@
 	pid := readPID(t, nms)
 	defer syscall.Kill(pid, syscall.SIGINT)
 
-	deviceStub := node.DeviceClient("nm//nm")
+	deviceStub := device.DeviceClient("nm//nm")
 
 	// Create the local server that the app uses to tell us which system
 	// name the device manager wished to run it as.
diff --git a/services/mgmt/node/impl/mock_repo_test.go b/services/mgmt/device/impl/mock_repo_test.go
similarity index 98%
rename from services/mgmt/node/impl/mock_repo_test.go
rename to services/mgmt/device/impl/mock_repo_test.go
index d55e2c9..0c34ddc 100644
--- a/services/mgmt/node/impl/mock_repo_test.go
+++ b/services/mgmt/device/impl/mock_repo_test.go
@@ -81,7 +81,7 @@
 // BINARY REPOSITORY INTERFACE IMPLEMENTATION
 
 // TODO(toddw): Move the errors from dispatcher.go into a common location.
-const pkgPath = "veyron.io/veyron/veyron/services/mgmt/node/impl"
+const pkgPath = "veyron.io/veyron/veyron/services/mgmt/device/impl"
 
 var ErrOperationFailed = verror2.Register(pkgPath+".OperationFailed", verror2.NoRetry, "")
 
diff --git a/services/mgmt/node/impl/only_for_test.go b/services/mgmt/device/impl/only_for_test.go
similarity index 100%
rename from services/mgmt/node/impl/only_for_test.go
rename to services/mgmt/device/impl/only_for_test.go
diff --git a/services/mgmt/node/impl/profile.go b/services/mgmt/device/impl/profile.go
similarity index 97%
rename from services/mgmt/node/impl/profile.go
rename to services/mgmt/device/impl/profile.go
index 7df74ba..caccde2 100644
--- a/services/mgmt/node/impl/profile.go
+++ b/services/mgmt/device/impl/profile.go
@@ -10,7 +10,7 @@
 	"veyron.io/veyron/veyron/services/mgmt/profile"
 
 	"veyron.io/veyron/veyron2/services/mgmt/build"
-	"veyron.io/veyron/veyron2/services/mgmt/node"
+	"veyron.io/veyron/veyron2/services/mgmt/device"
 )
 
 // computeDeviceProfile generates a description of the runtime
@@ -166,8 +166,8 @@
 // matchProfiles inputs a profile that describes the host device and a
 // set of publicly known profiles and outputs a device description that
 // identifies the publicly known profiles supported by the host device.
-func matchProfiles(p *profile.Specification, known []profile.Specification) node.Description {
-	result := node.Description{Profiles: make(map[string]struct{})}
+func matchProfiles(p *profile.Specification, known []profile.Specification) device.Description {
+	result := device.Description{Profiles: make(map[string]struct{})}
 loop:
 	for _, profile := range known {
 		if profile.Format != p.Format {
diff --git a/services/mgmt/node/impl/proxy_invoker.go b/services/mgmt/device/impl/proxy_invoker.go
similarity index 100%
rename from services/mgmt/node/impl/proxy_invoker.go
rename to services/mgmt/device/impl/proxy_invoker.go
diff --git a/services/mgmt/node/impl/proxy_invoker_test.go b/services/mgmt/device/impl/proxy_invoker_test.go
similarity index 100%
rename from services/mgmt/node/impl/proxy_invoker_test.go
rename to services/mgmt/device/impl/proxy_invoker_test.go
diff --git a/services/mgmt/node/impl/util.go b/services/mgmt/device/impl/util.go
similarity index 100%
rename from services/mgmt/node/impl/util.go
rename to services/mgmt/device/impl/util.go
diff --git a/services/mgmt/node/impl/util_test.go b/services/mgmt/device/impl/util_test.go
similarity index 96%
rename from services/mgmt/node/impl/util_test.go
rename to services/mgmt/device/impl/util_test.go
index cda76b6..e4d9c7e 100644
--- a/services/mgmt/node/impl/util_test.go
+++ b/services/mgmt/device/impl/util_test.go
@@ -16,7 +16,7 @@
 	"veyron.io/veyron/veyron2/ipc"
 	"veyron.io/veyron/veyron2/naming"
 	"veyron.io/veyron/veyron2/security"
-	"veyron.io/veyron/veyron2/services/mgmt/node"
+	"veyron.io/veyron/veyron2/services/mgmt/device"
 	"veyron.io/veyron/veyron2/verror"
 	"veyron.io/veyron/veyron2/verror2"
 	"veyron.io/veyron/veyron2/vlog"
@@ -27,7 +27,7 @@
 	"veyron.io/veyron/veyron/lib/modules/core"
 	tsecurity "veyron.io/veyron/veyron/lib/testutil/security"
 	"veyron.io/veyron/veyron/profiles/static"
-	"veyron.io/veyron/veyron/services/mgmt/node/impl"
+	"veyron.io/veyron/veyron/services/mgmt/device/impl"
 	"veyron.io/veyron/veyron2/services/mgmt/application"
 )
 
@@ -203,9 +203,9 @@
 // The following set of functions are convenience wrappers around Update and
 // Revert for device manager.
 
-func deviceStub(name string) node.DeviceClientMethods {
+func deviceStub(name string) device.DeviceClientMethods {
 	deviceName := naming.Join(name, "nm")
-	return node.DeviceClient(deviceName)
+	return device.DeviceClient(deviceName)
 }
 
 func updateDeviceExpectError(t *testing.T, name string, errID verror.ID) {
@@ -243,10 +243,10 @@
 	}
 }
 
-func appStub(nameComponents ...string) node.ApplicationClientMethods {
+func appStub(nameComponents ...string) device.ApplicationClientMethods {
 	appsName := "nm//apps"
 	appName := naming.Join(append([]string{appsName}, nameComponents...)...)
-	return node.ApplicationClient(appName)
+	return device.ApplicationClient(appName)
 }
 
 func installApp(t *testing.T, opt ...veyron2.Runtime) string {
@@ -351,13 +351,13 @@
 }
 
 // Code to make Association lists sortable.
-type byIdentity []node.Association
+type byIdentity []device.Association
 
 func (a byIdentity) Len() int           { return len(a) }
 func (a byIdentity) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
 func (a byIdentity) Less(i, j int) bool { return a[i].IdentityName < a[j].IdentityName }
 
-func compareAssociations(t *testing.T, got, expected []node.Association) {
+func compareAssociations(t *testing.T, got, expected []device.Association) {
 	sort.Sort(byIdentity(got))
 	sort.Sort(byIdentity(expected))
 	if !reflect.DeepEqual(got, expected) {