From patchwork Fri Oct 16 13:41:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RfC,v3,05/10] qdev/net: common nic property bits Date: Fri, 16 Oct 2009 03:41:58 -0000 From: Gerd Hoffmann X-Patchwork-Id: 36223 Message-Id: <1255700523-15270-6-git-send-email-kraxel@redhat.com> To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- net.h | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) 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 *);