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

Commit 100dbc5

Browse files
authored
Merge pull request #425 from bergwolf/time
grpc: add SetGuestDateTime API
2 parents 718f0dc + 31c6b6e commit 100dbc5

File tree

6 files changed

+436
-429
lines changed

6 files changed

+436
-429
lines changed

grpc.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,3 +1442,10 @@ func (a *agentGRPC) getAgentDetails(ctx context.Context) *pb.AgentDetails {
14421442

14431443
return &details
14441444
}
1445+
1446+
func (a *agentGRPC) SetGuestDateTime(ctx context.Context, req *pb.SetGuestDateTimeRequest) (*gpb.Empty, error) {
1447+
if err := syscall.Settimeofday(&syscall.Timeval{Sec: req.Sec, Usec: req.Usec}); err != nil {
1448+
return nil, grpcStatus.Errorf(codes.Internal, "Could not set guest time: %v", err)
1449+
}
1450+
return &gpb.Empty{}, nil
1451+
}

0 commit comments

Comments
 (0)