vmstate: be able to store/save a pci device from a pointer
authorJuan Quintela <quintela@redhat.com>
Thu, 10 Mar 2011 11:33:55 +0000 (12:33 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 10 Mar 2011 22:12:26 +0000 (16:12 -0600)
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/hw.h

diff --git a/hw/hw.h b/hw/hw.h
index 9df1c2c7142821234915392cd03d1bea245af357..4e09f18e1214bfc7177a22ef71fab5197d20afc2 100644 (file)
--- 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) {                        \