From 639f49b60cc399d753409734b011359fb71d8f7d Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Thu, 10 Mar 2011 12:33:55 +0100 Subject: [PATCH] vmstate: be able to store/save a pci device from a pointer Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- hw/hw.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/hw.h b/hw/hw.h index 9df1c2c714..4e09f18e12 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) { \