From patchwork Thu Oct 22 18:50:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/3] vmstate: Add VMSTATE_MACADDR for the new type From: Juan Quintela X-Patchwork-Id: 36738 Message-Id: To: qemu-devel@nongnu.org Date: Thu, 22 Oct 2009 20:50:06 +0200 Signed-off-by: Juan Quintela --- hw/hw.h | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/hw.h b/hw/hw.h index 428a52d..eb5c639 100644 --- a/hw/hw.h +++ b/hw/hw.h @@ -522,6 +522,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