Add PermittedHostDevices type to support a new kubevirt-host-device-plugin-config configmap
PermittedHostDevices will include PciHostDevice and MediatedHostDevice
@@ -1462,6 +1462,7 @@ type KubeVirtConfiguration struct {
SMBIOSConfig *SMBiosConfiguration `json:"smbios,omitempty"`
SupportedGuestAgentVersions []string `json:"supportedGuestAgentVersions,omitempty"`
MemBalloonStatsPeriod *uint32 `json:"memBalloonStatsPeriod,omitempty"`
+ PermittedHostDevices *PermittedHostDevices `json:"permittedHostDevices,omitempty"`
}
// ---
@@ -1499,6 +1500,29 @@ type DeveloperConfiguration struct {
CPUAllocationRatio int `json:"cpuAllocationRatio,omitempty"`
}
+// PermittedHostDevices holds inforamtion about devices allowed for passthrough
+// +k8s:openapi-gen=true
+type PermittedHostDevices struct {
+ PciHostDevices []PciHostDevice `json:"pciDevices,omitempty"`
+ MediatedDevices []MediatedHostDevice `json:"mdevs,omitempty"`
+}
+
+// PciHostDevice represents a host PCI device allowed for passthrough
+// +k8s:openapi-gen=true
+type PciHostDevice struct {
+ Selector string `json:"pciVendorSelector"`
+ ResourceName string `json:"resourceName"`
+ ExternalResourceProvider bool `json:"externalResourceProvider,omitempty"`
+}
+
+// MediatedHostDevice represents a host mediated device allowed for passthrough
+// +k8s:openapi-gen=true
+type MediatedHostDevice struct {
+ Selector string `json:"mdevNameSelector"`
+ ResourceName string `json:"resourceName"`
+ ExternalResourceProvider bool `json:"externalResourceProvider,omitempty"`
+}
+
// NetworkConfiguration holds network options
// +k8s:openapi-gen=true
type NetworkConfiguration struct {
