mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 14:32:33 +00:00
clh: add 'APIsocket' to persist HypervisorState
The 'apiSocket' member in the CloudHypervisorState struct needs to be kept across different executions of kata-runtime with persist HypervisorState, so that kata-runtime can talk with the same running cloud-hypervisor through HTTP/REST API calls. Fixes: #2506 Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
83eef430bd
commit
63c7ac5bbe
@ -435,12 +435,14 @@ func (clh *cloudHypervisor) save() (s persistapi.HypervisorState) {
|
|||||||
s.Pid = clh.state.PID
|
s.Pid = clh.state.PID
|
||||||
s.Type = string(ClhHypervisor)
|
s.Type = string(ClhHypervisor)
|
||||||
s.VirtiofsdPid = clh.state.VirtiofsdPID
|
s.VirtiofsdPid = clh.state.VirtiofsdPID
|
||||||
|
s.APISocket = clh.state.apiSocket
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (clh *cloudHypervisor) load(s persistapi.HypervisorState) {
|
func (clh *cloudHypervisor) load(s persistapi.HypervisorState) {
|
||||||
clh.state.PID = s.Pid
|
clh.state.PID = s.Pid
|
||||||
clh.state.VirtiofsdPID = s.VirtiofsdPid
|
clh.state.VirtiofsdPID = s.VirtiofsdPid
|
||||||
|
clh.state.apiSocket = s.APISocket
|
||||||
}
|
}
|
||||||
|
|
||||||
func (clh *cloudHypervisor) check() error {
|
func (clh *cloudHypervisor) check() error {
|
||||||
|
@ -42,4 +42,7 @@ type HypervisorState struct {
|
|||||||
VirtiofsdPid int
|
VirtiofsdPid int
|
||||||
HotplugVFIOOnRootBus bool
|
HotplugVFIOOnRootBus bool
|
||||||
PCIeRootPort int
|
PCIeRootPort int
|
||||||
|
|
||||||
|
// clh sepcific: refer to 'virtcontainers/clh.go:CloudHypervisorState'
|
||||||
|
APISocket string
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user