Revision 9a3e12c8

b/hw/msix.c
284 284

  
285 285
void msix_save(PCIDevice *dev, QEMUFile *f)
286 286
{
287
    unsigned nentries = (pci_get_word(dev->config + PCI_MSIX_FLAGS) &
288
                         PCI_MSIX_FLAGS_QSIZE) + 1;
289
    qemu_put_buffer(f, dev->msix_table_page, nentries * MSIX_ENTRY_SIZE);
290
    qemu_put_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING,
291
                    (nentries + 7) / 8);
287
    unsigned n = dev->msix_entries_nr;
288

  
289
    if (!dev->cap_present & QEMU_PCI_CAP_MSIX)
290
        return;
291

  
292
    qemu_put_buffer(f, dev->msix_table_page, n * MSIX_ENTRY_SIZE);
293
    qemu_put_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING, (n + 7) / 8);
292 294
}
293 295

  
294 296
/* Should be called after restoring the config space. */

Also available in: Unified diff