Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
clh: add 'APIsocket' to persist HypervisorState
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
likebreath committed Mar 4, 2020
1 parent 83eef43 commit 63c7ac5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,14 @@ func (clh *cloudHypervisor) save() (s persistapi.HypervisorState) {
s.Pid = clh.state.PID
s.Type = string(ClhHypervisor)
s.VirtiofsdPid = clh.state.VirtiofsdPID
s.APISocket = clh.state.apiSocket
return
}

func (clh *cloudHypervisor) load(s persistapi.HypervisorState) {
clh.state.PID = s.Pid
clh.state.VirtiofsdPID = s.VirtiofsdPid
clh.state.apiSocket = s.APISocket
}

func (clh *cloudHypervisor) check() error {
Expand Down
3 changes: 3 additions & 0 deletions virtcontainers/persist/api/hypervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ type HypervisorState struct {
VirtiofsdPid int
HotplugVFIOOnRootBus bool
PCIeRootPort int

// clh sepcific: refer to 'virtcontainers/clh.go:CloudHypervisorState'
APISocket string
}

0 comments on commit 63c7ac5

Please sign in to comment.