Skip to content
  • Avi Kivity's avatar
    Fix qapi code generation wrt parallel build · 8d3bc517
    Avi Kivity authored
    
    
    Make's multiple output syntax
    
      x.c x.h: x.template
           gen < x.template
    
    actually invokes the command once for x.c and once for x.h (with differing $@
    in each invocation).  During a parallel build, the two commands may be invoked
    in parallel; this opens up a race, where the second invocation trashes a file
    supposedly produced during the first, and now in use by a dependent command.
    
    The various qapi code generators are susceptible to this; fix by making them
    generate just one file per invocation.
    
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    8d3bc517