From: Avi Kivity <a...@redhat.com>

Signed-off-by: Avi Kivity <a...@redhat.com>

diff --git a/hw/msix.c b/hw/msix.c
index 4ab6da6..754531f 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;
 
--
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

Reply via email to