diff --git a/internal/server/instance/drivers/driver_qemu.go b/internal/server/instance/drivers/driver_qemu.go index 5fbeffec2fc..24885f8b34d 100644 --- a/internal/server/instance/drivers/driver_qemu.go +++ b/internal/server/instance/drivers/driver_qemu.go @@ -4765,7 +4765,7 @@ func (d *qemu) addGPUDevConfig(cfg *[]cfgSection, bus *qemuBus, gpuConfig []devi } func (d *qemu) addUSBDeviceConfig(usbDev deviceConfig.USBDeviceItem) (monitorHook, error) { - device := map[string]any{ + qemuDev := map[string]any{ "id": fmt.Sprintf("%s%s", qemuDeviceIDPrefix, usbDev.DeviceName), "driver": "usb-host", "bus": "qemu_usb.0", @@ -4782,18 +4782,18 @@ func (d *qemu) addUSBDeviceConfig(usbDev deviceConfig.USBDeviceItem) (monitorHoo defer func() { _ = f.Close() }() - info, err := m.SendFileWithFDSet(device["id"].(string), f, false) + info, err := m.SendFileWithFDSet(qemuDev["id"].(string), f, false) if err != nil { return fmt.Errorf("Failed to send file descriptor: %w", err) } revert.Add(func() { - _ = m.RemoveFDFromFDSet(device["id"].(string)) + _ = m.RemoveFDFromFDSet(qemuDev["id"].(string)) }) - device["hostdevice"] = fmt.Sprintf("/dev/fdset/%d", info.ID) + qemuDev["hostdevice"] = fmt.Sprintf("/dev/fdset/%d", info.ID) - err = m.AddDevice(device) + err = m.AddDevice(qemuDev) if err != nil { return fmt.Errorf("Failed to add device: %w", err) } @@ -9134,7 +9134,7 @@ func (d *qemu) setCPUs(monitor *qmp.Monitor, count int) error { devID := fmt.Sprintf("cpu%d%d%d", cpu.Props.SocketID, cpu.Props.CoreID, cpu.Props.ThreadID) - dev := map[string]any{ + qemuDev := map[string]any{ "id": devID, "driver": cpu.Type, "core-id": cpu.Props.CoreID, @@ -9142,11 +9142,11 @@ func (d *qemu) setCPUs(monitor *qmp.Monitor, count int) error { // No such thing as sockets and threads on s390x. if d.architecture != osarch.ARCH_64BIT_S390_BIG_ENDIAN { - dev["socket-id"] = cpu.Props.SocketID - dev["thread-id"] = cpu.Props.ThreadID + qemuDev["socket-id"] = cpu.Props.SocketID + qemuDev["thread-id"] = cpu.Props.ThreadID } - err := monitor.AddDevice(dev) + err := monitor.AddDevice(qemuDev) if err != nil { return fmt.Errorf("Failed to add device: %w", err) }