Merge pull request #663 from dgibson/machinne

runtime: Fix typo in hotplugVFIODevice()
This commit is contained in:
Christophe de Dinechin 2020-09-04 09:58:34 +02:00 committed by GitHub
commit 6e54767344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1273,13 +1273,13 @@ func (q *qemu) hotplugVFIODevice(device *config.VFIODev, op operation) (err erro
} }
devID := device.ID devID := device.ID
machinneType := q.hypervisorConfig().HypervisorMachineType machineType := q.hypervisorConfig().HypervisorMachineType
if op == addDevice { if op == addDevice {
buf, _ := json.Marshal(device) buf, _ := json.Marshal(device)
q.Logger().WithFields(logrus.Fields{ q.Logger().WithFields(logrus.Fields{
"machine-type": machinneType, "machine-type": machineType,
"hotplug-vfio-on-root-bus": q.state.HotplugVFIOOnRootBus, "hotplug-vfio-on-root-bus": q.state.HotplugVFIOOnRootBus,
"pcie-root-port": q.state.PCIeRootPort, "pcie-root-port": q.state.PCIeRootPort,
"device-info": string(buf), "device-info": string(buf),
@ -1291,7 +1291,7 @@ func (q *qemu) hotplugVFIODevice(device *config.VFIODev, op operation) (err erro
if q.state.HotplugVFIOOnRootBus { if q.state.HotplugVFIOOnRootBus {
// In case MachineType is q35, a PCIe device is hotplugged on a PCIe Root Port. // In case MachineType is q35, a PCIe device is hotplugged on a PCIe Root Port.
switch machinneType { switch machineType {
case QemuQ35: case QemuQ35:
if device.IsPCIe && q.state.PCIeRootPort <= 0 { if device.IsPCIe && q.state.PCIeRootPort <= 0 {
q.Logger().WithField("dev-id", device.ID).Warn("VFIO device is a PCIe device. It's recommended to add the PCIe Root Port by setting the pcie_root_port parameter in the configuration for q35") q.Logger().WithField("dev-id", device.ID).Warn("VFIO device is a PCIe device. It's recommended to add the PCIe Root Port by setting the pcie_root_port parameter in the configuration for q35")