OSDN Git Service

qemu/msi: clean used vectors state on load
authorMichael S. Tsirkin <mst@redhat.com>
Sun, 5 Jul 2009 12:58:44 +0000 (15:58 +0300)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 10 Jul 2009 18:44:30 +0000 (13:44 -0500)
Clean up msix vector usage state on load. Since guest might have control
over it through the device, the device will have to load this state from
file.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/msix.c

index e130857..47e0140 100644 (file)
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -302,6 +302,7 @@ void msix_load(PCIDevice *dev, QEMUFile *f)
         return;
     }
 
+    msix_free_irq_entries(dev);
     qemu_get_buffer(f, dev->msix_table_page, n * MSIX_ENTRY_SIZE);
     qemu_get_buffer(f, dev->msix_table_page + MSIX_PAGE_PENDING, (n + 7) / 8);
 }