This repository has been archived by the owner on May 12, 2021. It is now read-only.
/
sandbox.go
61 lines (45 loc) · 1.62 KB
/
sandbox.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) 2016 Intel Corporation
// Copyright (c) 2019 Huawei Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package persistapi
// ============= sandbox level resources =============
// AgentState save agent state data
type AgentState struct {
// Pid of proxy process
ProxyPid int
// URL to connect to agent
URL string
}
// SandboxState contains state information of sandbox
// nolint: maligned
type SandboxState struct {
// PersistVersion of persist data format, can be used for keeping compatibility later
PersistVersion uint
// State is sandbox running status
State string
// GuestMemoryBlockSizeMB is the size of memory block of guestos
GuestMemoryBlockSizeMB uint32
// GuestMemoryHotplugProbe determines whether guest kernel supports memory hotplug probe interface
GuestMemoryHotplugProbe bool
// SandboxContainer specifies which container is used to start the sandbox/vm
SandboxContainer string
// CgroupPath is the cgroup hierarchy where sandbox's processes
// including the hypervisor are placed.
// FIXME: sandbox can reuse "SandboxContainer"'s CgroupPath so we can remove this field.
CgroupPath string
// CgroupPath is the cgroup hierarchy where sandbox's processes
// including the hypervisor are placed.
CgroupPaths map[string]string
// Devices plugged to sandbox(hypervisor)
Devices []DeviceState
// HypervisorState saves hypervisor specific data
HypervisorState HypervisorState
// AgentState saves state data of agent
AgentState AgentState
// Network saves network configuration of sandbox
Network NetworkInfo
// Config saves config information of sandbox
Config SandboxConfig
}