diff mbox

[8/9] vmstate: be able to store/save a pci device from a pointer

Message ID 282320e67ec7a7bb98f4cab7e8ef536186eda425.1299756608.git.quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela March 10, 2011, 11:33 a.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/hw.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/hw/hw.h b/hw/hw.h
index 9df1c2c..4e09f18 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -629,6 +629,14 @@  extern const VMStateDescription vmstate_pci_device;
     .offset     = vmstate_offset_value(_state, _field, PCIDevice),   \
 }

+#define VMSTATE_PCI_DEVICE_POINTER(_field, _state) {                 \
+    .name       = (stringify(_field)),                               \
+    .size       = sizeof(PCIDevice),                                 \
+    .vmsd       = &vmstate_pci_device,                               \
+    .flags      = VMS_STRUCT|VMS_POINTER,                            \
+    .offset     = vmstate_offset_pointer(_state, _field, PCIDevice), \
+}
+
 extern const VMStateDescription vmstate_pcie_device;

 #define VMSTATE_PCIE_DEVICE(_field, _state) {                        \