aboutsummaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-08-20 19:42:39 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 20:30:22 -0500
commit73534f2f682f2957fabb25e3890481098cc5dcee (patch)
tree16dc4aa473ce9f024409689a77e3ff775a8f6c66 /hw/hw.h
parentf16c4abfadf9ae63bd22fb793484912542be0da7 (diff)
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 <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r--hw/hw.h12
1 files changed, 12 insertions, 0 deletions
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