aboutsummaryrefslogtreecommitdiff
path: root/net.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-01-13 17:07:20 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-13 10:20:51 -0600
commit701a8f76aa5243d90a71935982c20c06d8e83b80 (patch)
tree0cd413bfa739326cb70b251d3ed2b698d0debb41 /net.h
parent49d4d9b63ebb0d487e80d3d85a75d8256d313df9 (diff)
vmstate: extract declarations out of hw/hw.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.h')
-rw-r--r--net.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/net.h b/net.h
index c6b41905af..eab089d577 100644
--- a/net.h
+++ b/net.h
@@ -6,6 +6,7 @@
#include "qdict.h"
#include "qemu-option.h"
#include "net/queue.h"
+#include "vmstate.h"
struct MACAddr {
uint8_t a[6];
@@ -178,4 +179,16 @@ void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd);
int net_handle_fd_param(Monitor *mon, const char *param);
+#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_buffer, \
+ .flags = VMS_BUFFER, \
+ .offset = vmstate_offset_macaddr(_state, _field), \
+}
+
#endif