aboutsummaryrefslogtreecommitdiffstats
path: root/hw/hw.h
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-10-22 20:50:06 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:51 -0500
commit9e77fcd0274fcb5859f4e8acf91d40b2f967fcc4 (patch)
treecf01c6bfd8d02f2d6efafe51642c8e1a76d6aa90 /hw/hw.h
parent76507c754831bc6c01cc010255b992c7c9b57742 (diff)
vmstate: Add VMSTATE_MACADDR for the new type
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 f3b5160a4..15c93f84a 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -500,6 +500,18 @@ extern const VMStateDescription vmstate_i2c_slave;
.offset = vmstate_offset_value(_state, _field, i2c_slave), \
}
+#define vmstate_offset_macaddr(_state, _field) \
+ vmstate_offset_array(_state, _field.a, uint8_t, \
+ sizeof(typeof_field(_state, _field)))
+
+#define VMSTATE_MACADDR(_field, _state) { \
+ .name = (stringify(_field)), \
+ .size = sizeof(MACAddr), \
+ .info = &vmstate_info_uint8, \
+ .flags = VMS_BUFFER, \
+ .offset = vmstate_offset_macaddr(_state, _field), \
+}
+
/* _f : field name
_f_n : num of elements field_name
_n : num of elements