should pass &assigned_dev->dev to ipf_map_irq in while loop, the parameter PCIDevice *d is useless. And rename assign_dev_update_irq to assigned_dev_update_irqs() because it updates irq on all assigned devices. Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx> --- qemu/hw/device-assignment.c | 4 ++-- qemu/hw/device-assignment.h | 2 +- qemu/hw/pci.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index 3fa8053..5003611 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device-assignment.c @@ -488,7 +488,7 @@ static uint32_t calc_assigned_dev_id(uint8_t bus, uint8_t devfn) /* The pci config space got updated. Check if irq numbers have changed * for our devices */ -void assigned_dev_update_irq(PCIDevice *d) +void assigned_dev_update_irqs() { AssignedDevInfo *adev; @@ -502,7 +502,7 @@ void assigned_dev_update_irq(PCIDevice *d) irq = piix_get_irq(irq); #ifdef TARGET_IA64 - irq = ipf_map_irq(d, irq); + irq = ipf_map_irq(&assigned_dev->dev, irq); #endif if (irq != assigned_dev->girq) { diff --git a/qemu/hw/device-assignment.h b/qemu/hw/device-assignment.h index 8b3b105..f216bb0 100644 --- a/qemu/hw/device-assignment.h +++ b/qemu/hw/device-assignment.h @@ -99,7 +99,7 @@ PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus); AssignedDevInfo *add_assigned_device(const char *arg); void add_assigned_devices(PCIBus *bus, const char **devices, int n_devices); ram_addr_t assigned_dev_load_option_roms(ram_addr_t rom_base_offset); -void assigned_dev_update_irq(PCIDevice *d); +void assigned_dev_update_irqs(void); #define MAX_DEV_ASSIGN_CMDLINE 8 diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index a6d57e5..e207c7c 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -484,7 +484,7 @@ void pci_default_write_config(PCIDevice *d, if (kvm_enabled() && qemu_kvm_irqchip_in_kernel() && address >= PIIX_CONFIG_IRQ_ROUTE && address < PIIX_CONFIG_IRQ_ROUTE + 4) - assigned_dev_update_irq(d); + assigned_dev_update_irqs(); #endif /* USE_KVM_DEVICE_ASSIGNMENT */ end = address + len; -- 1.6.0.4
Attachment:
0001-kvm-qemu-remove-the-useless-parameter.patch
Description: 0001-kvm-qemu-remove-the-useless-parameter.patch