]> git.ozlabs.org Git - petitboot/commit
discover/pxe-parser: Parse only the first config v1.3.1
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 03:39:42 +0000 (14:39 +1100)
commitf64638f5a4f159297a74df9329afc6e73acf6d6b
treea4041d21cafe4e3621612ec976f436eb1996809d
parentde2f990a98718d15bff074b9ae65f2eb92a2f938
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>
discover/pxe-parser.c