Re: [PATCH 5/7] util: Add ADD_ARG_RETURN_ON_ERROR

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

 



[snip]

> > +#define ADD_ARG_RETURN_ON_ERROR(rule, str) \
> > +    do { \
> > +        if (VIR_RESIZE_N(rule->args, \
> > +                         rule->argsAlloc, \
> > +                         rule->argsLen, 1) < 0) \
> > +            return; \
> > + \
> > +        rule->args[rule->argsLen++] = g_strdup(str); \
> > +    } while (0)
>
> IMHO this is missing the benefit of using glib since VIR_RESIZE_N
> will never fail now. We should get rid of "ADD_ARG" entirely, and
> just put a g_realloc() call directly in the place it is needed
> without any macros. Likewise for the next patch.

Cool, I really missed that.
I'll submit a v2, soon.

Best Regards,
-- 
Fabiano Fidêncio.


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux