diff mbox

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

Message ID 1255700523-15270-6-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

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

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 *);