From: Alex Williamson Date: Tue, 2 Oct 2012 19:22:14 +0000 (-0600) Subject: pci-assign: Use msi_get_message() X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~900^2~59^2~1437^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b199f9318ec698dfced65f5d4ad9729f166e37c;p=sdk%2Femulator%2Fqemu.git pci-assign: Use msi_get_message() pci-assign only uses a subset of the flexibility msi_get_message() provides, but it's still worthwhile to use it. Signed-off-by: Alex Williamson Signed-off-by: Michael S. Tsirkin --- diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c index ab01205666..e80dad009c 100644 --- a/hw/kvm/pci-assign.c +++ b/hw/kvm/pci-assign.c @@ -996,12 +996,9 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev) } if (ctrl_byte & PCI_MSI_FLAGS_ENABLE) { - uint8_t *pos = pci_dev->config + pci_dev->msi_cap; - MSIMessage msg; + MSIMessage msg = msi_get_message(pci_dev, 0); int virq; - msg.address = pci_get_long(pos + PCI_MSI_ADDRESS_LO); - msg.data = pci_get_word(pos + PCI_MSI_DATA_32); virq = kvm_irqchip_add_msi_route(kvm_state, msg); if (virq < 0) { perror("assigned_dev_update_msi: kvm_irqchip_add_msi_route");