aboutsummaryrefslogtreecommitdiffstats
path: root/vm/proxyapp/proxyrpc
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2022-09-26 09:23:11 +0200
committerGitHub <noreply@github.com>2022-09-26 09:23:11 +0200
commitd59ba98314e02be939938f682fd67cd68bbb3b68 (patch)
tree27a44d1d8315577110c0c9e09fb825a386b6255b /vm/proxyapp/proxyrpc
parent0042f2b4c00ce1ceeaa44a0147909fe3a6f86c5c (diff)
vm: add the proxyapp support (#3269)
* vm: add pool.Close() support * vm: add proxyapp client implementation * vm/proxyapp: autogenerate mocks * vm/proxyapp: add proxyapp tests * pkg/mgrconfig: add proxyapp type tests
Diffstat (limited to 'vm/proxyapp/proxyrpc')
-rw-r--r--vm/proxyapp/proxyrpc/proxyrpc.go99
1 files changed, 99 insertions, 0 deletions
diff --git a/vm/proxyapp/proxyrpc/proxyrpc.go b/vm/proxyapp/proxyrpc/proxyrpc.go
new file mode 100644
index 000000000..9e5cfdd24
--- /dev/null
+++ b/vm/proxyapp/proxyrpc/proxyrpc.go
@@ -0,0 +1,99 @@
+// Copyright 2022 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+package proxyrpc
+
+// ProxyAppInterface is the interface you need to implement.
+type ProxyAppInterface interface {
+ CreatePool(in CreatePoolParams, out *CreatePoolResult) error
+ CreateInstance(in CreateInstanceParams, out *CreateInstanceResult) error
+ Diagnose(in DiagnoseParams, out *DiagnoseReply) error
+ Copy(in CopyParams, out *CopyResult) error
+ Forward(in ForwardParams, out *ForwardResult) error
+ RunStart(in RunStartParams, out *RunStartReply) error
+ RunStop(in RunStopParams, out *RunStopReply) error
+ RunReadProgress(in RunReadProgressParams, out *RunReadProgressReply) error
+ Close(in CloseParams, out *CloseReply) error
+}
+
+type CreatePoolParams struct {
+ Debug bool
+ Param string
+}
+
+type CreatePoolResult struct {
+ Count int // signal the created pool size
+}
+
+type CreateInstanceParams struct {
+ Workdir string
+ Index int
+}
+
+type CreateInstanceResult struct {
+ ID string // allocated instance id
+}
+
+type CopyParams struct {
+ ID string
+ HostSrc string
+}
+
+type CopyResult struct {
+ VMFileName string
+}
+
+type ForwardParams struct {
+ ID string
+ Port int
+}
+
+type ForwardResult struct {
+ ManagerAddress string
+}
+
+type RunStartParams struct {
+ ID string
+ Command string
+}
+
+type RunStartReply struct {
+ RunID string
+}
+
+type RunStopParams struct {
+ ID string
+ RunID string
+}
+
+type RunStopReply struct {
+}
+
+type RunReadProgressParams struct {
+ ID string
+ RunID string
+}
+
+type RunReadProgressReply struct {
+ StdoutChunk string
+ StderrChunk string
+ ConsoleOutChunk string
+ Error string
+ Finished bool
+}
+
+type CloseParams struct {
+ ID string
+}
+
+type CloseReply struct {
+}
+
+type DiagnoseParams struct {
+ ID string
+ ReasonTitle string
+}
+
+type DiagnoseReply struct {
+ Diagnosis string
+}