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

Commit

Permalink
agent: add interface memHotplugByProbe for memory hotplug
Browse files Browse the repository at this point in the history
In order to support memory hotplug by probe interface, we need to
notify guest kernel about hot-added momery event by echoing related addresses
into /sys/devices/system/memory/probe.

Fixes: #442

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
  • Loading branch information
Pennyzct committed Jan 22, 2019
1 parent 50c8c9e commit ea398ec
Show file tree
Hide file tree
Showing 3 changed files with 404 additions and 171 deletions.
10 changes: 10 additions & 0 deletions grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,16 @@ func (a *agentGRPC) GetGuestDetails(ctx context.Context, req *pb.GuestDetailsReq
return &details, nil
}

func (a *agentGRPC) MemHotplugByProbe(ctx context.Context, req *pb.MemHotplugByProbeRequest) (*gpb.Empty, error) {
for _, addr := range req.MemHotplugProbeAddr {
if err := ioutil.WriteFile(sysfsMemoryHotplugProbePath, []byte(fmt.Sprintf("0x%x", addr)), 0600); err != nil {
return emptyResp, err
}
}

return emptyResp, nil
}

func (a *agentGRPC) haveSeccomp() bool {
if seccompSupport == "yes" && seccomp.IsEnabled() {
return true
Expand Down
Loading

0 comments on commit ea398ec

Please sign in to comment.