VMOD havoc generating patch

Dridi Boukelmoune dridi at varni.sh
Mon Feb 4 19:26:08 UTC 2019


On Mon, Jan 28, 2019 at 1:55 PM Poul-Henning Kamp <phk at phk.freebsd.dk> wrote:
>
> Ticket 2810 is about the names generated by vmodtool and vcc, and
> while there is a good intellectual argument for getting it right,
> I am a little bit worried about how much havoc that causes.
>
> This is a WIP patch headed in that direction, and I would like to
> hear input from VMOD writers.
>
> Ideally with this stuff finished, VMOD writers can version their
> vmods using $Prefix and you will then be able to import multiple
> different versions of the same VMOD in the same VCL.  Not sure that
> is a good thing to do, but it proves that the name-space issue is
> solved.
>
> See the changes to the in-tree vmods for how this will look for you.

I waited until my weekly CI against master would choke on this change,
and it's very easy to support both before and after if your baseline
is 6.0, which is more than fine since 4.1 only has a couple months to
live:

    #include "vcc_$VMOD_if.h"

    /* Varnish < 6.2 compat */
    #ifndef VPFX
     #define VPFX(a) vmod_ ## a
     #define VARGS(a) vmod_ ## a ## _arg
     #define VENUM(a) vmod_enum_ ## a
    #endif

I didn't try on a vmod with a $Prefix stanza, but I'm sure it can be
helped if that snippet is not enough.

Dridi


More information about the varnish-dev mailing list