]> git.ozlabs.org Git - petitboot/commit
discover/pxe-parser: Parse only the first config v1.2.6
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 23 Sep 2016 03:06:48 +0000 (13:06 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 11 Oct 2016 04:10:41 +0000 (15:10 +1100)
commit9f29eb2eff09d7bf74905b1fef8eaf4f7934219e
tree7c755698c3f306f83cb85f4637315b19fede5591
parenta8b4e044d505e9bdcc28ab0dfa5e3315542f0e67
discover/pxe-parser: Parse only the first config

Commit 2163af5 "discover/pxe-parser: Retrieve configs asynchronously"
added asynchronous loading of remote pxe filenames, but made an
unintended change in behaviour to the PXE parser. Previously the parser
would try a list of possible filenames, and parse the first one it
found. However the above commit spawns an asynchronous job for every
filename, and parses any that can be retrieved. It is a common
configuration to have a machine-specific config and a 'fallback' default
config, and the change means we could erroneously retrieve and parse
both configs.

Update the PXE parser so that asynchronous jobs are spawned
sequentially. That is, spawn a job for the first filename and if not
successful spawn another job for the next filename, and so on. Once a
remote config is successfully retrieved, parse it and stop.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
(cherry picked from commit f64638f5a4f159297a74df9329afc6e73acf6d6b)
discover/pxe-parser.c