aboutsummaryrefslogtreecommitdiff
path: root/hw/pci/msix.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-05-07 15:16:58 +0200
committerGerd Hoffmann <kraxel@redhat.com>2013-06-03 11:37:44 +0200
commit340b50c759d6b4ef33e514c40afcc799c0d7df7a (patch)
treec3226aa187cc3aa473cb69afa4fb8d4035c49901 /hw/pci/msix.c
parent45ec267160307ce2ca7494d942589ba222b29479 (diff)
pci: add VMSTATE_MSIX
Using a trick cut+pasted from vmstate_scsi_device to wind up msix_save and msix_load. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci/msix.c')
-rw-r--r--hw/pci/msix.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index e231a0dc4b..6da75ec693 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -569,3 +569,36 @@ void msix_unset_vector_notifiers(PCIDevice *dev)
dev->msix_vector_release_notifier = NULL;
dev->msix_vector_poll_notifier = NULL;
}
+
+static void put_msix_state(QEMUFile *f, void *pv, size_t size)
+{
+ msix_save(pv, f);
+}
+
+static int get_msix_state(QEMUFile *f, void *pv, size_t size)
+{
+ msix_load(pv, f);
+ return 0;
+}
+
+static VMStateInfo vmstate_info_msix = {
+ .name = "msix state",
+ .get = get_msix_state,
+ .put = put_msix_state,
+};
+
+const VMStateDescription vmstate_msix = {
+ .name = "msix",
+ .fields = (VMStateField[]) {
+ {
+ .name = "msix",
+ .version_id = 0,
+ .field_exists = NULL,
+ .size = 0, /* ouch */
+ .info = &vmstate_info_msix,
+ .flags = VMS_SINGLE,
+ .offset = 0,
+ },
+ VMSTATE_END_OF_LIST()
+ }
+};