aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2012-10-02 13:22:14 -0600
committerMichael S. Tsirkin <mst@redhat.com>2012-10-29 17:59:06 +0200
commit2b199f9318ec698dfced65f5d4ad9729f166e37c (patch)
treee0ccd5b97c462a9e10d5d75683e8ba16365b601f /hw
parent39b9bc626a436837f0068cb600aaf91c0e8aa937 (diff)
downloadqemu-2b199f9318ec698dfced65f5d4ad9729f166e37c.zip
qemu-2b199f9318ec698dfced65f5d4ad9729f166e37c.tar.gz
qemu-2b199f9318ec698dfced65f5d4ad9729f166e37c.tar.bz2
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 <alex.williamson@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/kvm/pci-assign.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/kvm/pci-assign.c b/hw/kvm/pci-assign.c
index ab01205..e80dad0 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");