mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 14:54:19 +01:00
Support x-pci-vendor-id and x-pci-device-id pass to qemu
since some vendor id like 1ded can not be identified by virtio-pci driver, so upper level need to pass a specified vendor id to qemu. the upper level will change unavailable id and pass it to qemu. Signed-off-by: Ace-Tang <aceapril@126.com>
This commit is contained in:
12
qemu/qemu.go
12
qemu/qemu.go
@@ -901,6 +901,12 @@ type VFIODevice struct {
|
||||
|
||||
// DevNo identifies the ccw devices for s390x architecture
|
||||
DevNo string
|
||||
|
||||
// VendorID specifies vendor id
|
||||
VendorID string
|
||||
|
||||
// DeviceID specifies device id
|
||||
DeviceID string
|
||||
}
|
||||
|
||||
// Valid returns true if the VFIODevice structure is valid and complete.
|
||||
@@ -917,6 +923,12 @@ func (vfioDev VFIODevice) QemuParams(config *Config) []string {
|
||||
|
||||
deviceParams = append(deviceParams, fmt.Sprintf("%s,host=%s", driver, vfioDev.BDF))
|
||||
if isVirtioPCI[driver] {
|
||||
if vfioDev.VendorID != "" {
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",x-pci-vendor-id=%s", vfioDev.VendorID))
|
||||
}
|
||||
if vfioDev.DeviceID != "" {
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",x-pci-device-id=%s", vfioDev.DeviceID))
|
||||
}
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",romfile=%s", vfioDev.ROMFile))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user