Files
kata-containers/virtcontainers/mock_hypervisor.go
Peng Tao ce288652d5 virtcontainers: remove sandboxConfig.VMConfig
We can just use hyprvisor config to specify the memory size
of a guest. There is no need to maintain the extra place just
for memory size.

Fixes: #692

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-09-06 14:15:56 +08:00

81 lines
1.5 KiB
Go

// Copyright (c) 2016 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import "context"
type mockHypervisor struct {
vCPUs uint32
}
func (m *mockHypervisor) init(ctx context.Context, id string, hypervisorConfig *HypervisorConfig, storage resourceStorage) error {
err := hypervisorConfig.valid()
if err != nil {
return err
}
return nil
}
func (m *mockHypervisor) capabilities() capabilities {
return capabilities{}
}
func (m *mockHypervisor) createSandbox() error {
return nil
}
func (m *mockHypervisor) startSandbox() error {
return nil
}
func (m *mockHypervisor) waitSandbox(timeout int) error {
return nil
}
func (m *mockHypervisor) stopSandbox() error {
return nil
}
func (m *mockHypervisor) pauseSandbox() error {
return nil
}
func (m *mockHypervisor) resumeSandbox() error {
return nil
}
func (m *mockHypervisor) saveSandbox() error {
return nil
}
func (m *mockHypervisor) addDevice(devInfo interface{}, devType deviceType) error {
return nil
}
func (m *mockHypervisor) hotplugAddDevice(devInfo interface{}, devType deviceType) (interface{}, error) {
switch devType {
case cpuDev:
return m.vCPUs, nil
}
return nil, nil
}
func (m *mockHypervisor) hotplugRemoveDevice(devInfo interface{}, devType deviceType) (interface{}, error) {
switch devType {
case cpuDev:
return m.vCPUs, nil
}
return nil, nil
}
func (m *mockHypervisor) getSandboxConsole(sandboxID string) (string, error) {
return "", nil
}
func (m *mockHypervisor) disconnect() {
}