qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 3/3] net.h: Add description fields for qdev


From: Amit Shah
Subject: Re: [Qemu-devel] [RFC PATCH 3/3] net.h: Add description fields for qdev properites
Date: Fri, 28 May 2010 18:29:52 +0530
User-agent: Mutt/1.5.20 (2009-12-10)

On (Fri) May 28 2010 [14:50:46], Markus Armbruster wrote:
> Amit Shah <address@hidden> writes:
> 
> > Signed-off-by: Amit Shah <address@hidden>
> > ---
> >  net.h |   13 ++++++++++---
> >  1 files changed, 10 insertions(+), 3 deletions(-)
> >
> > diff --git a/net.h b/net.h
> > index 0e9cc5d..8ad439a 100644
> > --- a/net.h
> > +++ b/net.h
> > @@ -20,10 +20,17 @@ typedef struct NICConf {
> >      VLANClientState *peer;
> >  } NICConf;
> >  
> > +#define PROP_NET_MACADDR_DESC                   \
> > +    "The MAC address for the NIC"
> > +#define PROP_NET_VLAN_DESC                      \
> > +    "The VLAN to associate the NIC with"
> > +#define PROP_NET_NETDEV_DESC                    \
> > +    "The peer net device to associate with this virtual NIC"
> > +
> >  #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, "")
> > +    DEFINE_PROP_MACADDR("mac",   _state, _conf.macaddr, 
> > PROP_NET_MACADDR_DESC),\
> > +    DEFINE_PROP_VLAN("vlan",     _state, _conf.vlan, PROP_NET_VLAN_DESC),  
> >    \
> > +    DEFINE_PROP_NETDEV("netdev", _state, _conf.peer, PROP_NET_NETDEV_DESC)
> >  
> >  /* VLANs support */
> 
> Why the macros?

Just seems cleaner; big strings can become an eyesore in such places.
What do you think?

                Amit



reply via email to

[Prev in Thread] Current Thread [Next in Thread]