aboutsummaryrefslogtreecommitdiff
path: root/hw/msix.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-07-01 12:15:06 +0300
committerAvi Kivity <avi@redhat.com>2009-07-01 12:15:06 +0300
commite347f89a3d4773dfc22d8874c9906453d54768c7 (patch)
tree14db25c2f2089038c1c37b2911cd4df62af97229 /hw/msix.c
parentTemporarily disable msix support on kvm with irqchip (diff)
downloadqemu-kvm-e347f89a3d4773dfc22d8874c9906453d54768c7.tar.gz
qemu-kvm-e347f89a3d4773dfc22d8874c9906453d54768c7.tar.bz2
qemu-kvm-e347f89a3d4773dfc22d8874c9906453d54768c7.zip
Disable msix save/load if msix is not supported
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/msix.c')
-rw-r--r--hw/msix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/msix.c b/hw/msix.c
index 4ab6da680..754531f72 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -286,6 +286,10 @@ void msix_save(PCIDevice *dev, QEMUFile *f)
{
unsigned nentries = (pci_get_word(dev->config + PCI_MSIX_FLAGS) &
PCI_MSIX_FLAGS_QSIZE) + 1;
+
+ if (!msix_supported)
+ return;
+
qemu_put_buffer(f, dev->msix_table_page, nentries * MSIX_ENTRY_SIZE);
qemu_put_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING,
(nentries + 7) / 8);
@@ -296,6 +300,9 @@ void msix_load(PCIDevice *dev, QEMUFile *f)
{
unsigned n = dev->msix_entries_nr;
+ if (!msix_supported)
+ return;
+
if (!dev->cap_present & QEMU_PCI_CAP_MSIX)
return;