veyron.go.core: Make context.T a concrete type.
Change-Id: I1f4ce09c8a302214e13da6939a20dbf625d31511
MultiPart: 1/6
diff --git a/services/mgmt/debug/dispatcher_test.go b/services/mgmt/debug/dispatcher_test.go
index d138978..2f93483 100644
--- a/services/mgmt/debug/dispatcher_test.go
+++ b/services/mgmt/debug/dispatcher_test.go
@@ -56,7 +56,7 @@
}
defer runtime.Cleanup()
- tracedContext := func() context.T {
+ tracedContext := func() *context.T {
ctx := runtime.NewContext()
vtrace.FromContext(ctx).Trace().ForceCollect()
return ctx
diff --git a/services/mgmt/device/config.vdl.go b/services/mgmt/device/config.vdl.go
index 2fd44cd..b8eb6fd 100644
--- a/services/mgmt/device/config.vdl.go
+++ b/services/mgmt/device/config.vdl.go
@@ -23,7 +23,7 @@
// Config is an RPC API to the config service.
type ConfigClientMethods interface {
// Set sets the value for key.
- Set(ctx __context.T, key string, value string, opts ...__ipc.CallOpt) error
+ Set(ctx *__context.T, key string, value string, opts ...__ipc.CallOpt) error
}
// ConfigClientStub adds universal methods to ConfigClientMethods.
@@ -48,14 +48,14 @@
client __ipc.Client
}
-func (c implConfigClientStub) c(ctx __context.T) __ipc.Client {
+func (c implConfigClientStub) c(ctx *__context.T) __ipc.Client {
if c.client != nil {
return c.client
}
return __veyron2.RuntimeFromContext(ctx).Client()
}
-func (c implConfigClientStub) Set(ctx __context.T, i0 string, i1 string, opts ...__ipc.CallOpt) (err error) {
+func (c implConfigClientStub) Set(ctx *__context.T, i0 string, i1 string, opts ...__ipc.CallOpt) (err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Set", []interface{}{i0, i1}, opts...); err != nil {
return
@@ -66,7 +66,7 @@
return
}
-func (c implConfigClientStub) Signature(ctx __context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) {
+func (c implConfigClientStub) Signature(ctx *__context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil {
return
diff --git a/services/mgmt/device/impl/app_service.go b/services/mgmt/device/impl/app_service.go
index bde4143..740c859 100644
--- a/services/mgmt/device/impl/app_service.go
+++ b/services/mgmt/device/impl/app_service.go
@@ -310,7 +310,7 @@
return nil
}
-func fetchAppEnvelope(ctx context.T, origin string) (*application.Envelope, error) {
+func fetchAppEnvelope(ctx *context.T, origin string) (*application.Envelope, error) {
envelope, err := fetchEnvelope(ctx, origin)
if err != nil {
return nil, err
@@ -324,7 +324,7 @@
}
// newVersion sets up the directory for a new application version.
-func newVersion(ctx context.T, installationDir string, envelope *application.Envelope, oldVersionDir string) (string, error) {
+func newVersion(ctx *context.T, installationDir string, envelope *application.Envelope, oldVersionDir string) (string, error) {
versionDir := filepath.Join(installationDir, generateVersionDirName())
if err := mkdir(versionDir); err != nil {
return "", verror2.Make(ErrOperationFailed, nil)
@@ -455,7 +455,7 @@
}
// setupPrincipal sets up the instance's principal, with the right blessings.
-func setupPrincipal(ctx context.T, instanceDir, versionDir string, call ipc.ServerContext, securityAgent *securityAgentState, info *instanceInfo) error {
+func setupPrincipal(ctx *context.T, instanceDir, versionDir string, call ipc.ServerContext, securityAgent *securityAgentState, info *instanceInfo) error {
var p security.Principal
if securityAgent != nil {
// TODO(caprita): Part of the cleanup upon destroying an
@@ -938,7 +938,7 @@
return i.run(veyron2.RuntimeFromContext(call.Context()).Namespace().Roots(), instanceDir, systemName)
}
-func stopAppRemotely(ctx context.T, appVON string) error {
+func stopAppRemotely(ctx *context.T, appVON string) error {
appStub := appcycle.AppCycleClient(appVON)
ctx, cancel := ctx.WithTimeout(ipcContextTimeout)
defer cancel()
@@ -962,7 +962,7 @@
return nil
}
-func stop(ctx context.T, instanceDir string) error {
+func stop(ctx *context.T, instanceDir string) error {
info, err := loadInstanceInfo(instanceDir)
if err != nil {
return err
diff --git a/services/mgmt/device/impl/callback.go b/services/mgmt/device/impl/callback.go
index c1ed6a6..174aec5 100644
--- a/services/mgmt/device/impl/callback.go
+++ b/services/mgmt/device/impl/callback.go
@@ -11,7 +11,7 @@
// InvokeCallback provides the parent device manager with the given name (which
// is expected to be this device manager's object name).
-func InvokeCallback(ctx context.T, name string) {
+func InvokeCallback(ctx *context.T, name string) {
handle, err := exec.GetChildHandle()
switch err {
case nil:
diff --git a/services/mgmt/device/impl/device_service.go b/services/mgmt/device/impl/device_service.go
index 22eabf8..08e9e86 100644
--- a/services/mgmt/device/impl/device_service.go
+++ b/services/mgmt/device/impl/device_service.go
@@ -152,7 +152,7 @@
return link, scriptPath, nil
}
-func (s *deviceService) revertDeviceManager(ctx context.T) error {
+func (s *deviceService) revertDeviceManager(ctx *context.T) error {
if err := updateLink(s.config.Previous, s.config.CurrentLink); err != nil {
return err
}
@@ -177,7 +177,7 @@
// TODO(cnicolaou): would this be better implemented using the modules
// framework now that it exists?
-func (s *deviceService) testDeviceManager(ctx context.T, workspace string, envelope *application.Envelope) error {
+func (s *deviceService) testDeviceManager(ctx *context.T, workspace string, envelope *application.Envelope) error {
path := filepath.Join(workspace, "deviced.sh")
cmd := exec.Command(path)
@@ -299,7 +299,7 @@
return nil
}
-func (s *deviceService) updateDeviceManager(ctx context.T) error {
+func (s *deviceService) updateDeviceManager(ctx *context.T) error {
if len(s.config.Origin) == 0 {
return verror2.Make(ErrUpdateNoOp, ctx)
}
diff --git a/services/mgmt/device/impl/impl_test.go b/services/mgmt/device/impl/impl_test.go
index 995b964..1113c34 100644
--- a/services/mgmt/device/impl/impl_test.go
+++ b/services/mgmt/device/impl/impl_test.go
@@ -757,7 +757,7 @@
return runtime
}
-func tryInstall(ctx context.T) error {
+func tryInstall(ctx *context.T) error {
appsName := "dm//apps"
stub := device.ApplicationClient(appsName)
if _, err := stub.Install(ctx, mockApplicationRepoName); err != nil {
diff --git a/services/mgmt/device/impl/util.go b/services/mgmt/device/impl/util.go
index 8a83af4..fd2d7f3 100644
--- a/services/mgmt/device/impl/util.go
+++ b/services/mgmt/device/impl/util.go
@@ -23,7 +23,7 @@
ipcContextTimeout = time.Minute
)
-func downloadBinary(ctx context.T, workspace, fileName, name string) error {
+func downloadBinary(ctx *context.T, workspace, fileName, name string) error {
data, _, err := binary.Download(ctx, name)
if err != nil {
vlog.Errorf("Download(%v) failed: %v", name, err)
@@ -37,7 +37,7 @@
return nil
}
-func fetchEnvelope(ctx context.T, origin string) (*application.Envelope, error) {
+func fetchEnvelope(ctx *context.T, origin string) (*application.Envelope, error) {
stub := repository.ApplicationClient(origin)
// TODO(jsimsa): Include logic that computes the set of supported
// profiles.
diff --git a/services/mgmt/lib/binary/impl.go b/services/mgmt/lib/binary/impl.go
index 6171670..ea7f6ec 100644
--- a/services/mgmt/lib/binary/impl.go
+++ b/services/mgmt/lib/binary/impl.go
@@ -35,7 +35,7 @@
subpartSize = 1 << 12
)
-func Delete(ctx context.T, name string) error {
+func Delete(ctx *context.T, name string) error {
ctx, cancel := ctx.WithTimeout(time.Minute)
defer cancel()
if err := repository.BinaryClient(name).Delete(ctx); err != nil {
@@ -51,7 +51,7 @@
offset int64
}
-func downloadPartAttempt(ctx context.T, w io.WriteSeeker, client repository.BinaryClientStub, ip *indexedPart) bool {
+func downloadPartAttempt(ctx *context.T, w io.WriteSeeker, client repository.BinaryClientStub, ip *indexedPart) bool {
ctx, cancel := ctx.WithCancel()
defer cancel()
@@ -95,7 +95,7 @@
return true
}
-func downloadPart(ctx context.T, w io.WriteSeeker, client repository.BinaryClientStub, ip *indexedPart) bool {
+func downloadPart(ctx *context.T, w io.WriteSeeker, client repository.BinaryClientStub, ip *indexedPart) bool {
for i := 0; i < nAttempts; i++ {
if downloadPartAttempt(ctx, w, client, ip) {
return true
@@ -104,7 +104,7 @@
return false
}
-func download(ctx context.T, w io.WriteSeeker, von string) (repository.MediaInfo, error) {
+func download(ctx *context.T, w io.WriteSeeker, von string) (repository.MediaInfo, error) {
client := repository.BinaryClient(von)
parts, mediaInfo, err := client.Stat(ctx)
if err != nil {
@@ -127,7 +127,7 @@
return mediaInfo, nil
}
-func Download(ctx context.T, von string) ([]byte, repository.MediaInfo, error) {
+func Download(ctx *context.T, von string) ([]byte, repository.MediaInfo, error) {
dir, prefix := "", ""
file, err := ioutil.TempFile(dir, prefix)
if err != nil {
@@ -150,7 +150,7 @@
return bytes, mediaInfo, nil
}
-func DownloadToFile(ctx context.T, von, path string) error {
+func DownloadToFile(ctx *context.T, von, path string) error {
dir, prefix := "", ""
file, err := ioutil.TempFile(dir, prefix)
if err != nil {
@@ -192,7 +192,7 @@
return nil
}
-func DownloadURL(ctx context.T, von string) (string, int64, error) {
+func DownloadURL(ctx *context.T, von string) (string, int64, error) {
ctx, cancel := ctx.WithTimeout(time.Minute)
defer cancel()
url, ttl, err := repository.BinaryClient(von).DownloadURL(ctx)
@@ -203,7 +203,7 @@
return url, ttl, nil
}
-func uploadPartAttempt(ctx context.T, r io.ReadSeeker, client repository.BinaryClientStub, part int, size int64) (bool, error) {
+func uploadPartAttempt(ctx *context.T, r io.ReadSeeker, client repository.BinaryClientStub, part int, size int64) (bool, error) {
ctx, cancel := ctx.WithCancel()
defer cancel()
@@ -274,7 +274,7 @@
return true, nil
}
-func uploadPart(ctx context.T, r io.ReadSeeker, client repository.BinaryClientStub, part int, size int64) error {
+func uploadPart(ctx *context.T, r io.ReadSeeker, client repository.BinaryClientStub, part int, size int64) error {
for i := 0; i < nAttempts; i++ {
if success, err := uploadPartAttempt(ctx, r, client, part, size); success || err != nil {
return err
@@ -283,7 +283,7 @@
return verror.Make(errOperationFailed, ctx)
}
-func upload(ctx context.T, r io.ReadSeeker, mediaInfo repository.MediaInfo, von string) error {
+func upload(ctx *context.T, r io.ReadSeeker, mediaInfo repository.MediaInfo, von string) error {
client := repository.BinaryClient(von)
offset, whence := int64(0), 2
size, err := r.Seek(offset, whence)
@@ -304,14 +304,14 @@
return nil
}
-func Upload(ctx context.T, von string, data []byte, mediaInfo repository.MediaInfo) error {
+func Upload(ctx *context.T, von string, data []byte, mediaInfo repository.MediaInfo) error {
buffer := bytes.NewReader(data)
ctx, cancel := ctx.WithTimeout(time.Minute)
defer cancel()
return upload(ctx, buffer, mediaInfo, von)
}
-func UploadFromFile(ctx context.T, von, path string) error {
+func UploadFromFile(ctx *context.T, von, path string) error {
file, err := os.Open(path)
defer file.Close()
if err != nil {
@@ -324,7 +324,7 @@
return upload(ctx, file, mediaInfo, von)
}
-func UploadFromDir(ctx context.T, von, sourceDir string) error {
+func UploadFromDir(ctx *context.T, von, sourceDir string) error {
dir, err := ioutil.TempDir("", "create-package-")
if err != nil {
return err
diff --git a/services/mgmt/repository/repository.vdl.go b/services/mgmt/repository/repository.vdl.go
index 8ded95a..2f10e48 100644
--- a/services/mgmt/repository/repository.vdl.go
+++ b/services/mgmt/repository/repository.vdl.go
@@ -48,7 +48,7 @@
// Put adds the given tuple of application version (specified
// through the object name suffix) and application envelope to all
// of the given application profiles.
- Put(ctx __context.T, Profiles []string, Envelope application.Envelope, opts ...__ipc.CallOpt) error
+ Put(ctx *__context.T, Profiles []string, Envelope application.Envelope, opts ...__ipc.CallOpt) error
// Remove removes the application envelope for the given profile
// name and application version (specified through the object name
// suffix). If no version is specified as part of the suffix, the
@@ -56,7 +56,7 @@
//
// TODO(jsimsa): Add support for using "*" to specify all profiles
// when Matt implements Globing (or Ken implements querying).
- Remove(ctx __context.T, Profile string, opts ...__ipc.CallOpt) error
+ Remove(ctx *__context.T, Profile string, opts ...__ipc.CallOpt) error
}
// ApplicationClientStub adds universal methods to ApplicationClientMethods.
@@ -83,14 +83,14 @@
repository.ApplicationClientStub
}
-func (c implApplicationClientStub) c(ctx __context.T) __ipc.Client {
+func (c implApplicationClientStub) c(ctx *__context.T) __ipc.Client {
if c.client != nil {
return c.client
}
return __veyron2.RuntimeFromContext(ctx).Client()
}
-func (c implApplicationClientStub) Put(ctx __context.T, i0 []string, i1 application.Envelope, opts ...__ipc.CallOpt) (err error) {
+func (c implApplicationClientStub) Put(ctx *__context.T, i0 []string, i1 application.Envelope, opts ...__ipc.CallOpt) (err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Put", []interface{}{i0, i1}, opts...); err != nil {
return
@@ -101,7 +101,7 @@
return
}
-func (c implApplicationClientStub) Remove(ctx __context.T, i0 string, opts ...__ipc.CallOpt) (err error) {
+func (c implApplicationClientStub) Remove(ctx *__context.T, i0 string, opts ...__ipc.CallOpt) (err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Remove", []interface{}{i0}, opts...); err != nil {
return
@@ -112,7 +112,7 @@
return
}
-func (c implApplicationClientStub) Signature(ctx __context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) {
+func (c implApplicationClientStub) Signature(ctx *__context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil {
return
@@ -352,13 +352,13 @@
repository.ProfileClientMethods
// Specification returns the profile specification for the profile
// identified through the object name suffix.
- Specification(__context.T, ...__ipc.CallOpt) (profile.Specification, error)
+ Specification(*__context.T, ...__ipc.CallOpt) (profile.Specification, error)
// Put sets the profile specification for the profile identified
// through the object name suffix.
- Put(ctx __context.T, Specification profile.Specification, opts ...__ipc.CallOpt) error
+ Put(ctx *__context.T, Specification profile.Specification, opts ...__ipc.CallOpt) error
// Remove removes the profile specification for the profile
// identified through the object name suffix.
- Remove(__context.T, ...__ipc.CallOpt) error
+ Remove(*__context.T, ...__ipc.CallOpt) error
}
// ProfileClientStub adds universal methods to ProfileClientMethods.
@@ -385,14 +385,14 @@
repository.ProfileClientStub
}
-func (c implProfileClientStub) c(ctx __context.T) __ipc.Client {
+func (c implProfileClientStub) c(ctx *__context.T) __ipc.Client {
if c.client != nil {
return c.client
}
return __veyron2.RuntimeFromContext(ctx).Client()
}
-func (c implProfileClientStub) Specification(ctx __context.T, opts ...__ipc.CallOpt) (o0 profile.Specification, err error) {
+func (c implProfileClientStub) Specification(ctx *__context.T, opts ...__ipc.CallOpt) (o0 profile.Specification, err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Specification", nil, opts...); err != nil {
return
@@ -403,7 +403,7 @@
return
}
-func (c implProfileClientStub) Put(ctx __context.T, i0 profile.Specification, opts ...__ipc.CallOpt) (err error) {
+func (c implProfileClientStub) Put(ctx *__context.T, i0 profile.Specification, opts ...__ipc.CallOpt) (err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Put", []interface{}{i0}, opts...); err != nil {
return
@@ -414,7 +414,7 @@
return
}
-func (c implProfileClientStub) Remove(ctx __context.T, opts ...__ipc.CallOpt) (err error) {
+func (c implProfileClientStub) Remove(ctx *__context.T, opts ...__ipc.CallOpt) (err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Remove", nil, opts...); err != nil {
return
@@ -425,7 +425,7 @@
return
}
-func (c implProfileClientStub) Signature(ctx __context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) {
+func (c implProfileClientStub) Signature(ctx *__context.T, opts ...__ipc.CallOpt) (o0 __ipc.ServiceSignature, err error) {
var call __ipc.Call
if call, err = c.c(ctx).StartCall(ctx, c.name, "Signature", nil, opts...); err != nil {
return