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:
Sebastien Boeuf 2016-10-21 08:53:23 -07:00
parent 2aa5f5a3c0
commit 30cf11632c

View File

@ -263,6 +263,9 @@ type CharDevice struct {
// Driver is the qemu device driver // Driver is the qemu device driver
Driver DeviceDriver Driver DeviceDriver
// Bus is the serial bus associated to this device.
Bus string
// DeviceID is the user defined device ID. // DeviceID is the user defined device ID.
DeviceID string DeviceID string
@ -287,6 +290,9 @@ func (cdev CharDevice) QemuParams(config *Config) []string {
var qemuParams []string var qemuParams []string
deviceParams = append(deviceParams, fmt.Sprintf("%s", cdev.Driver)) 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(",chardev=%s", cdev.ID))
deviceParams = append(deviceParams, fmt.Sprintf(",id=%s", cdev.DeviceID)) deviceParams = append(deviceParams, fmt.Sprintf(",id=%s", cdev.DeviceID))
if cdev.Name != "" { if cdev.Name != "" {