Patchwork [08/58] vmstate: be able to store/save a pci device from a pointer

login
register
mail settings
Submitter Juan Quintela
Date Feb. 24, 2011, 5:57 p.m.
Message ID <cf1dd44ceabdfbdeed3b0edc2244376ea80edee5.1298569508.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/84435/
State New
Headers show

Comments

Juan Quintela - Feb. 24, 2011, 5:57 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/hw.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/hw.h b/hw/hw.h
index 0dfc053..f874dd0 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -609,6 +609,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) {                        \