On 6 May 2018 at 14:39, David Gibson <da...@gibson.dropbear.id.au> wrote: > Well, I'm biased of course, but I think we'd be better off just > ditching the wrapper. In its present form it is so limited as to not > really add any value. If it was rewritten to do something useful > (e.g. handling reallocations), I think it would be even better if > done as an extension to libfdt itself so it can benefit everyone, not > just qemu.
Well, some of it is working around infelicities in libfdt's API (like all the getprop/setprop functions taking an offset value rather than a node name), but yes, it would be better to fix the libfdt API if possible. > Although, that said, I'll re-iterate that I think qemu's fdt > manipulation is now sufficiently complex that it would be better off > using a "live" (dynamically allocated & pointer based) tree > representation that we just flatten immediately before loading it into > the guest. This sounds to me like something that should be handled by libfdt. I don't particularly care what libfdt's internal representation of the data structure is, I just want to be able to (a) hand it an fdt read in from a file (b) call various functions to modify the data structure and then (c) write the resulting thing out to an fdt in guest memory. Whether libfdt prefers to do that by modifying the flat representation or by converting into a dynamically allocated unflattened tree and back again is something I'd rather leave to it as an implementation detail. thanks -- PMM