Skip to content

Commit

Permalink
Add TPM device to the VM inventory
Browse files Browse the repository at this point in the history
Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Nov 27, 2023
1 parent d70b67d commit c5137ff
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/provider/container/ovirt/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ func (r *VMAdapter) Event() []int {
// List the collection.
func (r *VMAdapter) List(ctx *Context) (itr fb.Iterator, err error) {
vmList := VMList{}
err = ctx.client.list("vms", &vmList, r.follow())
err = ctx.client.list("vms", &vmList, r.follow(), libweb.Param{Key: "all_content", Value: "true"})
if err != nil {
return
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/provider/container/ovirt/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ type VM struct {
USB struct {
Enabled string `json:"enabled"`
} `json:"usb"`
TPM string `json:"tpm_enabled"`
Timezone struct {
Name string `json:"name"`
} `json:"time_zone"`
Expand Down Expand Up @@ -361,6 +362,7 @@ func (r *VM) ApplyTo(m *model.VM) {
m.StorageErrorResumeBehaviour = r.StorageErrorResumeBehaviour
m.HaEnabled = r.bool(r.HA.Enabled)
m.IOThreads = r.int16(r.IO.Threads)
m.TpmEnabled = r.bool(r.TPM)
r.addCpuAffinity(m)
r.addNICs(m)
r.addDiskAttachment(m)
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/provider/model/ovirt/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ type VM struct {
Concerns []Concern `sql:"" eq:"-"`
Guest Guest `sql:""`
OSType string `sql:""`
TpmEnabled bool `sql:""`
}

// Determine if current revision has been validated.
Expand Down
2 changes: 2 additions & 0 deletions pkg/controller/provider/web/ovirt/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ type VM struct {
Snapshots []Snapshot `json:"snapshots"`
Guest Guest `json:"guest"`
OSType string `json:"osType"`
TpmEnabled bool `json:"tpmEnabled"`
}

type VNIC = model.NIC
Expand Down Expand Up @@ -303,6 +304,7 @@ func (r *VM) With(m *model.VM) {
r.Snapshots = m.Snapshots
r.Guest = m.Guest
r.OSType = m.OSType
r.TpmEnabled = m.TpmEnabled
}

// Build self link (URI).
Expand Down

0 comments on commit c5137ff

Please sign in to comment.