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

Commit

Permalink
grpc: add SetGuestDateTime API
Browse files Browse the repository at this point in the history
So that the runtime can set guest time when needed.

Fixes: #422

Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf committed Dec 4, 2018
1 parent 07a0832 commit 31c6b6e
Show file tree
Hide file tree
Showing 6 changed files with 436 additions and 429 deletions.
7 changes: 7 additions & 0 deletions grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,3 +1399,10 @@ func (a *agentGRPC) getAgentDetails(ctx context.Context) *pb.AgentDetails {

return &details
}

func (a *agentGRPC) SetGuestDateTime(ctx context.Context, req *pb.SetGuestDateTimeRequest) (*gpb.Empty, error) {
if err := syscall.Settimeofday(&syscall.Timeval{Sec: req.Sec, Usec: req.Usec}); err != nil {
return nil, grpcStatus.Errorf(codes.Internal, "Could not set guest time: %v", err)
}
return &gpb.Empty{}, nil
}
Loading

0 comments on commit 31c6b6e

Please sign in to comment.