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

Commit dbdc0b0

Browse files
committed
agent: add interface memHotplugByProbe for memory hotplug via probe interface
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>
1 parent 601e2f9 commit dbdc0b0

File tree

3 files changed

+404
-171
lines changed

3 files changed

+404
-171
lines changed

grpc.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,16 @@ func (a *agentGRPC) GetGuestDetails(ctx context.Context, req *pb.GuestDetailsReq
14301430
return &details, nil
14311431
}
14321432

1433+
func (a *agentGRPC) MemHotplugByProbe(ctx context.Context, req *pb.MemHotplugByProbeRequest) (*gpb.Empty, error) {
1434+
for _, addr := range req.MemHotplugProbeAddr {
1435+
if err := ioutil.WriteFile(sysfsMemoryHotplugProbePath, []byte(fmt.Sprintf("0x%x", addr)), 0600); err != nil {
1436+
return emptyResp, err
1437+
}
1438+
}
1439+
1440+
return emptyResp, nil
1441+
}
1442+
14331443
func (a *agentGRPC) haveSeccomp() bool {
14341444
if seccompSupport == "yes" && seccomp.IsEnabled() {
14351445
return true

0 commit comments

Comments
 (0)