Skip to content

Commit

Permalink
agent: acquire memory hotplug probe info via GetGuestDetails
Browse files Browse the repository at this point in the history
In order to support memory hotplug via probe interface in kata-runtime,
firstly, we need to verify whether guest kernel is capable of that.

Fixes: kata-containers#1149

Signed-off-by: Penny Zheng <[email protected]>
  • Loading branch information
Pennyzct committed Mar 13, 2019
1 parent ffbae64 commit 2b37247
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion virtcontainers/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,8 @@ func createAssets(ctx context.Context, sandboxConfig *SandboxConfig) error {

func (s *Sandbox) getAndStoreGuestDetails() error {
guestDetailRes, err := s.agent.getGuestDetails(&grpc.GuestDetailsRequest{
MemBlockSize: true,
MemBlockSize: true,
MemHotplugProbe: true,
})
if err != nil {
return err
Expand All @@ -412,6 +413,7 @@ func (s *Sandbox) getAndStoreGuestDetails() error {
if guestDetailRes.AgentDetails != nil {
s.seccompSupported = guestDetailRes.AgentDetails.SupportsSeccomp
}
s.state.GuestMemoryHotplugProbe = guestDetailRes.SupportMemHotplugProbe

if err = s.store.Store(store.State, s.state); err != nil {
return err
Expand Down
3 changes: 3 additions & 0 deletions virtcontainers/types/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ type State struct {
// GuestMemoryBlockSizeMB is the size of memory block of guestos
GuestMemoryBlockSizeMB uint32 `json:"guestMemoryBlockSize"`

// GuestMemoryHotplugProbe determines whether guest kernel supports memory hotplug probe interface
GuestMemoryHotplugProbe bool `json:"guestMemoryHotplugProbe"`

// CgroupPath is the cgroup hierarchy where sandbox's processes
// including the hypervisor are placed.
CgroupPath string `json:"cgroupPath,omitempty"`
Expand Down

0 comments on commit 2b37247

Please sign in to comment.