From 73534f2f682f2957fabb25e3890481098cc5dcee Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Thu, 20 Aug 2009 19:42:39 +0200 Subject: Port PCIDevice state to VMState This uses a variant of buffer, with extra checks. Also uses the new support for cheking that a read value is less or equal than a field. Signed-off-by: Juan Quintela Signed-off-by: Anthony Liguori --- hw/hw.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'hw/hw.h') diff --git a/hw/hw.h b/hw/hw.h index f7b0a14793..73f2f43281 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -402,6 +402,18 @@ extern const VMStateInfo vmstate_info_buffer; + type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \ } +extern const VMStateDescription vmstate_pci_device; + +#define VMSTATE_PCI_DEVICE(_field, _state) { \ + .name = (stringify(_field)), \ + .version_id = 2, \ + .size = sizeof(PCIDevice), \ + .vmsd = &vmstate_pci_device, \ + .flags = VMS_STRUCT, \ + .offset = offsetof(_state, _field) \ + + type_check(PCIDevice,typeof_field(_state, _field)) \ +} + /* _f : field name _f_n : num of elements field_name _n : num of elements -- cgit v1.2.3