| 30 | import java.util.UUID; |
| 31 | |
| 32 | @Entity |
| 33 | @Table(name = "gpu_device") |
| 34 | public class GpuDeviceVO implements GpuDevice { |
| 35 | |
| 36 | @Id |
| 37 | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| 38 | @Column(name = "id") |
| 39 | private long id; |
| 40 | |
| 41 | @Column(name = "uuid") |
| 42 | private String uuid; |
| 43 | |
| 44 | @Column(name = "card_id") |
| 45 | private long cardId; |
| 46 | |
| 47 | @Column(name = "vgpu_profile_id") |
| 48 | private long vgpuProfileId; |
| 49 | |
| 50 | @Column(name = "bus_address") |
| 51 | private String busAddress; |
| 52 | |
| 53 | @Column(name = "host_id") |
| 54 | private long hostId; |
| 55 | |
| 56 | @Column(name = "vm_id") |
| 57 | private Long vmId; |
| 58 | |
| 59 | @Column(name = "type") |
| 60 | @Enumerated(value = EnumType.STRING) |
| 61 | private DeviceType type = DeviceType.PCI; |
| 62 | |
| 63 | @Column(name = "state") |
| 64 | @Enumerated(value = EnumType.STRING) |
| 65 | private State state = State.Free; |
| 66 | |
| 67 | @Column(name = "managed_state") |
| 68 | @Enumerated(value = EnumType.STRING) |
| 69 | private ManagedState managedState = ManagedState.Managed; |
| 70 | |
| 71 | @Column(name = "parent_gpu_device_id") |
| 72 | private Long parentGpuDeviceId; |
| 73 | |
| 74 | @Column(name = "numa_node") |
| 75 | private String numaNode; |
| 76 | |
| 77 | @Column(name = "pci_root") |
| 78 | private String pciRoot; |
| 79 | |
| 80 | public GpuDeviceVO() { |
| 81 | this.uuid = UUID.randomUUID().toString(); |
| 82 | } |
| 83 | |
| 84 | public GpuDeviceVO(long cardId, long vgpuProfileId, String busAddress, long hostId, Long parentGpuDeviceId, |
| 85 | String numaNode, String pciRoot) { |
| 86 | this.uuid = UUID.randomUUID().toString(); |
| 87 | this.cardId = cardId; |
| 88 | this.vgpuProfileId = vgpuProfileId; |
| 89 | this.busAddress = busAddress; |
nothing calls this directly
no outgoing calls
no test coverage detected