diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-05-05 13:05:32 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-05-05 13:05:32 -0500 |
commit | 3964f535c35c08470ac69bd553282af500bc8bb0 (patch) | |
tree | ba83992b5bcfda451371174ce3e8be1496c70c73 /hw/msi.c | |
parent | a69fb35079f682f99dd4d077b76232763d832d42 (diff) | |
parent | 5300f1a5487f67f0bde8ee1081b799108668cb1d (diff) | |
download | qemu-3964f535c35c08470ac69bd553282af500bc8bb0.tar.gz qemu-3964f535c35c08470ac69bd553282af500bc8bb0.tar.bz2 qemu-3964f535c35c08470ac69bd553282af500bc8bb0.zip |
Merge remote-tracking branch 'mst/for_anthony' into staging
Diffstat (limited to 'hw/msi.c')
-rw-r--r-- | hw/msi.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -164,9 +164,17 @@ int msi_init(struct PCIDevice *dev, uint8_t offset, void msi_uninit(struct PCIDevice *dev) { - uint16_t flags = pci_get_word(dev->config + msi_flags_off(dev)); - uint8_t cap_size = msi_cap_sizeof(flags); + uint16_t flags; + uint8_t cap_size; + + if (!(dev->cap_present & QEMU_PCI_CAP_MSI)) { + return; + } + flags = pci_get_word(dev->config + msi_flags_off(dev)); + cap_size = msi_cap_sizeof(flags); pci_del_capability(dev, PCI_CAP_ID_MSIX, cap_size); + dev->cap_present &= ~QEMU_PCI_CAP_MSI; + MSI_DEV_PRINTF(dev, "uninit\n"); } |