Skip to content

Commit

Permalink
update libyavirt (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyang0 committed May 25, 2023
1 parent 7decc13 commit 450b15f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/projectcalico/api v0.0.0-20230222223746-44aa60c2201f
github.com/projectcalico/calico v1.11.0-cni-plugin.0.20230510161715-15d193738928
github.com/projecteru2/core v0.0.0-20230512041401-f4113e25d62c
github.com/projecteru2/libyavirt v0.0.0-20230517062159-0c31f81550f3
github.com/projecteru2/libyavirt v0.0.0-20230524090109-0faf050e0f3b
github.com/prometheus/client_golang v1.15.0
github.com/robfig/cron/v3 v3.0.1
github.com/sirupsen/logrus v1.9.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ github.com/projecteru2/core v0.0.0-20230512041401-f4113e25d62c h1:ovxsd205M4RZfA
github.com/projecteru2/core v0.0.0-20230512041401-f4113e25d62c/go.mod h1:zpMzjZ0hohaoB2jLsbhBsJ0KQlL10WVORpj5/BKqTtw=
github.com/projecteru2/libyavirt v0.0.0-20230517062159-0c31f81550f3 h1:pjNFOoEalyROX9YfdxFXaNg4liZV/RASfhaVqJ4EnBQ=
github.com/projecteru2/libyavirt v0.0.0-20230517062159-0c31f81550f3/go.mod h1:N41KaKmqbailweGs4x/mt2H0O0Y7MizObZQ+igLdzpw=
github.com/projecteru2/libyavirt v0.0.0-20230524090109-0faf050e0f3b h1:mXvbNYdr2uh2mhk5HdiBBSc9DhaR2RuulURaXhJaP2I=
github.com/projecteru2/libyavirt v0.0.0-20230524090109-0faf050e0f3b/go.mod h1:N41KaKmqbailweGs4x/mt2H0O0Y7MizObZQ+igLdzpw=
github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM=
github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
Expand Down
9 changes: 5 additions & 4 deletions internal/server/grpc/grpc_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ func (y *GRPCYavirtd) GetInfo(_ context.Context, _ *pb.Empty) (*pb.InfoMessage,
log.Infof("[grpcserver] get host info")
info := y.service.Info()
return &pb.InfoMessage{
Id: info.ID,
Cpu: int64(info.CPU),
Memory: info.Mem,
Storage: info.Storage,
Id: info.ID,
Cpu: int64(info.CPU),
Memory: info.Mem,
Storage: info.Storage,
Resources: info.Resources,
}, nil
}

Expand Down
9 changes: 5 additions & 4 deletions internal/server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ func (svc *Service) Ping() map[string]string {
// Info .
func (svc *Service) Info() types.HostInfo {
return types.HostInfo{
ID: fmt.Sprintf("%d", svc.Host.ID),
CPU: svc.Host.CPU,
Mem: svc.Host.Memory,
Storage: svc.Host.Storage,
ID: fmt.Sprintf("%d", svc.Host.ID),
CPU: svc.Host.CPU,
Mem: svc.Host.Memory,
Storage: svc.Host.Storage,
Resources: map[string][]byte{},
}
}

Expand Down

0 comments on commit 450b15f

Please sign in to comment.