Re: [libvirt] [PATCHv2 2/4] Add wrapper macros around nla_nest*/nla_put* to make code more readable

2018-09-06 Thread Shi Lei
On 2018-09-06 at 21:27, Erik Skultety wrote: >... > >> > >> >> +    if (dummy && nla_put(msg, attrtype, datalen, data) < 0) { \ >> >> +    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \ >> >> +   _("nla_put error [" #attrtype "]")); \ >> >> +    return -1; \ >> >> +   

Re: [libvirt] [PATCHv2 2/4] Add wrapper macros around nla_nest*/nla_put* to make code more readable

2018-09-06 Thread Erik Skultety
... > > > >> +    if (dummy && nla_put(msg, attrtype, datalen, data) < 0) { \ > >> +    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \ > >> +   _("nla_put error [" #attrtype "]")); \ > >> +    return -1; \ > >> +    } \ > >> +} while(0) > >> + > >> +# define

Re: [libvirt] [PATCHv2 2/4] Add wrapper macros around nla_nest*/nla_put* to make code more readable

2018-09-06 Thread Shi Lei
On 2018-09-05 at 23:01, Erik Skultety wrote: >On Wed, Sep 05, 2018 at 04:36:28PM +0800, Shi Lei wrote: >> This patch adds wrapper macros around nla_nest*/nla_put* which apply to >> virNetlinkNewLink and virNetDevSetVfConfig and >> virNetDevVPortProfileOpSetLink. >> >> Signed-off-by: Shi Lei >>

Re: [libvirt] [PATCHv2 2/4] Add wrapper macros around nla_nest*/nla_put* to make code more readable

2018-09-05 Thread Erik Skultety
On Wed, Sep 05, 2018 at 04:36:28PM +0800, Shi Lei wrote: > This patch adds wrapper macros around nla_nest*/nla_put* which apply to > virNetlinkNewLink and virNetDevSetVfConfig and virNetDevVPortProfileOpSetLink. > > Signed-off-by: Shi Lei > --- > src/util/virnetdev.c | 54

[libvirt] [PATCHv2 2/4] Add wrapper macros around nla_nest*/nla_put* to make code more readable

2018-09-05 Thread Shi Lei
This patch adds wrapper macros around nla_nest*/nla_put* which apply to virNetlinkNewLink and virNetDevSetVfConfig and virNetDevVPortProfileOpSetLink. Signed-off-by: Shi Lei --- src/util/virnetdev.c | 54 ++ src/util/virnetdevvportprofile.c | 117