Adds the concept of a PCI device. A PCI device always belongs to a single VM host and may be bound to a single VM.
19 lines
274 B
Ruby
19 lines
274 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative "../model"
|
|
|
|
class PciDevice < Sequel::Model
|
|
include ResourceMethods
|
|
|
|
many_to_one :vm_host
|
|
many_to_one :vm
|
|
|
|
def self.ubid_type
|
|
UBID::TYPE_ETC
|
|
end
|
|
|
|
def is_gpu
|
|
["0300", "0302"].include? device_class
|
|
end
|
|
end
|