Patchwork [RfC,v3,05/10] qdev/net: common nic property bits

login
register
mail settings
Submitter Gerd Hoffmann
Date Oct. 16, 2009, 1:41 p.m.
Message ID <1255700523-15270-6-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/36223/
State New
Headers show

Comments

Gerd Hoffmann - Oct. 16, 2009, 1:41 p.m.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 net.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

Patch

diff --git a/net.h b/net.h
index 6a24f55..77720af 100644
--- a/net.h
+++ b/net.h
@@ -11,6 +11,19 @@  struct MACAddr {
     uint8_t a[6];
 };
 
+/* qdev nic properties */
+
+typedef struct NICConf {
+    MACAddr macaddr;
+    VLANState *vlan;
+    VLANClientState *peer;
+} NICConf;
+
+#define DEFINE_NIC_PROPERTIES(_state, _conf)                            \
+    DEFINE_PROP_MACADDR("mac",   _state, _conf.macaddr),                \
+    DEFINE_PROP_VLAN("vlan",     _state, _conf.vlan),                   \
+    DEFINE_PROP_NETDEV("netdev", _state, _conf.peer)
+
 /* VLANs support */
 
 typedef int (NetCanReceive)(VLANClientState *);