aboutsummaryrefslogtreecommitdiff
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)
downloadqemu-9e77fcd0274fcb5859f4e8acf91d40b2f967fcc4.zip
qemu-9e77fcd0274fcb5859f4e8acf91d40b2f967fcc4.tar.gz
qemu-9e77fcd0274fcb5859f4e8acf91d40b2f967fcc4.tar.bz2
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 f3b5160..15c93f8 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