mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-10 00:23:54 +00:00
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>
31 lines
747 B
Go
31 lines
747 B
Go
// Copyright (c) 2018 HyperHQ Inc.
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package virtcontainers
|
|
|
|
import (
|
|
"context"
|
|
|
|
pb "github.com/kata-containers/runtime/protocols/cache"
|
|
)
|
|
|
|
// Factory controls how a new VM is created.
|
|
type Factory interface {
|
|
// Config returns base factory config.
|
|
Config() VMConfig
|
|
|
|
// GetVMStatus returns the status of the paused VM created by the base factory.
|
|
GetVMStatus() []*pb.GrpcVMStatus
|
|
|
|
// GetVM gets a new VM from the factory.
|
|
GetVM(ctx context.Context, config VMConfig) (*VM, error)
|
|
|
|
// GetBaseVM returns a paused VM created by the base factory.
|
|
GetBaseVM(ctx context.Context, config VMConfig) (*VM, error)
|
|
|
|
// CloseFactory closes and cleans up the factory.
|
|
CloseFactory(ctx context.Context)
|
|
}
|