From d59ba98314e02be939938f682fd67cd68bbb3b68 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Mon, 26 Sep 2022 09:23:11 +0200 Subject: 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 --- vm/proxyapp/proxyrpc/proxyrpc.go | 99 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 vm/proxyapp/proxyrpc/proxyrpc.go (limited to 'vm/proxyapp/proxyrpc') 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 +} -- cgit mrf-deployment