mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-22 05:28:25 +00:00
Add missing bus parameter for a CharDevice
When creating a CharDevice, we need to add a "bus" parameter so that it can match the serial pci device previously created. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
parent
2aa5f5a3c0
commit
30cf11632c
6
qemu.go
6
qemu.go
@ -263,6 +263,9 @@ type CharDevice struct {
|
||||
// Driver is the qemu device driver
|
||||
Driver DeviceDriver
|
||||
|
||||
// Bus is the serial bus associated to this device.
|
||||
Bus string
|
||||
|
||||
// DeviceID is the user defined device ID.
|
||||
DeviceID string
|
||||
|
||||
@ -287,6 +290,9 @@ func (cdev CharDevice) QemuParams(config *Config) []string {
|
||||
var qemuParams []string
|
||||
|
||||
deviceParams = append(deviceParams, fmt.Sprintf("%s", cdev.Driver))
|
||||
if cdev.Bus != "" {
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",bus=%s", cdev.Bus))
|
||||
}
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",chardev=%s", cdev.ID))
|
||||
deviceParams = append(deviceParams, fmt.Sprintf(",id=%s", cdev.DeviceID))
|
||||
if cdev.Name != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user