From: Alex Williamson <alex.william...@hp.com> Use 'r' for the return value since gsi is unsigned.
Signed-off-by: Alex Williamson <alex.william...@hp.com> Signed-off-by: Avi Kivity <a...@redhat.com> diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 0a5f850..853307b 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -776,11 +776,12 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev, unsigned int ctrl_pos) assigned_dev->entry->u.msi.data = *(uint16_t *)(pci_dev->config + pci_dev->cap.start + PCI_MSI_DATA_32); assigned_dev->entry->type = KVM_IRQ_ROUTING_MSI; - assigned_dev->entry->gsi = kvm_get_irq_route_gsi(kvm_context); - if (assigned_dev->entry->gsi < 0) { + r = kvm_get_irq_route_gsi(kvm_context); + if (r < 0) { perror("assigned_dev_update_msi: kvm_get_irq_route_gsi"); return; } + assigned_dev->entry->gsi = r; kvm_add_routing_entry(kvm_context, assigned_dev->entry); if (kvm_commit_irq_routes(kvm_context) < 0) { -- To unsubscribe from this list: send the line "unsubscribe kvm-commits" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html