[PATCH 2/3] virdnsmasq: Lookup DNSMASQ in PATH

Andrea Bolognani abologna at redhat.com
Mon Jan 10 17:41:00 UTC 2022


On Mon, Jan 10, 2022 at 04:44:55PM +0100, Michal Privoznik wrote:
> While it's true that our virCommand subsystem is happy with
> non-absolute paths, the dnsmasq capability code is not. For
> instance, it does call stat() over the binary to learn its mtime
> (and thus decide whether capabilities need to be fetched again or
> not).
>
> Therefore, when constructing the capabilities structure look up
> the binary path. If DNSMASQ already contains an absolute path
> then it is returned (and virFindFileInPath() is a NOP).

Saying that virFindFileInPath() is a NOP is not quite correct: if you
pass an absolute path, it will return a copy. So I'd rewrite the
above as

  If DNSMASQ already contains an absolute path then
  virFindFileInPath() will simply return a copy.

Reviewed-by: Andrea Bolognani <abologna at redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list