Files
kata-containers/virtcontainers/factory/base/base.go
Hui Zhu ace81155a4 factory: Make factory status can show status of VMCache server
This commit adds a new gRPC function Status to CacheService.  VMCache
server will reply the status of VMCache server.
Factory destroy will call gRPC Status to get the status of VMCache
server and output it when VMCache is enabled.

Fixes: #1395

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-04-10 11:03:14 +08:00

33 lines
987 B
Go

// Copyright (c) 2018 HyperHQ Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
package base
import (
"context"
pb "github.com/kata-containers/runtime/protocols/cache"
vc "github.com/kata-containers/runtime/virtcontainers"
)
// FactoryBase is vm factory's internal base factory interfaces.
// The difference between FactoryBase and Factory is that the Factory
// also handles vm config validation/comparison and possible CPU/memory
// hotplugs. It's better to do it at the factory level instead of doing
// the same work in each of the factory implementations.
type FactoryBase interface {
// Config returns base factory config.
Config() vc.VMConfig
// GetVMStatus returns the status of the paused VM created by the base factory.
GetVMStatus() []*pb.GrpcVMStatus
// GetBaseVM returns a paused VM created by the base factory.
GetBaseVM(ctx context.Context, config vc.VMConfig) (*vc.VM, error)
// CloseFactory closes the base factory.
CloseFactory(ctx context.Context)
}