Hi, > We build a "configuration" struct in QAPI, and extend from there. > > (2) We offer "--config myconfig.yaml" as an option for specifying > options.
Yes. > This precludes the use of *any* traditional command line flags. Hmm. Given that the transition effort will probably take a while I think it makes sense to allow mixing config file and cmd line switches, if it is only for testing the config file parsing and processing. Maybe have a (temporary) -x-config for that? We already have qapi schema for -blockdev + -display + -audiodev + -chardev, creating a configuration struct which supports these shouldn't be that much effort. Then move over QemuOpts one by one. The most tricky part here probably is -device support. > (4) Just scrap the existing config file system entirely. It was never > finished and does not help solve the existing problem that we do not > have a schema for our configuration syntax. Yep. Zero reason to keep that once everything transitioned to qapi. > - We WOULD need a new YAML parsing layer in QEMU, generated by QAPI. > Supporting two deserialization layers could lead to strange > discrepancies between the two formats at runtime. So, admittedly, using > JSON would be *even easier*, as we could re-use the same parsers already > battle-tested in QEMU. We could get *MAXIMUM* code re-use this way. Well, we can support multiple formats, much like openshift accepts both json and yaml. json is pretty much there already, so we could start with that and add yaml later on. Possibly even the ini-style syntax accepted by -readconfig today, although I'm not sure there is much benefit in that. > - We will break compatibility with our existing CLI. People will not be > happy about this, especially, perhaps, embedded board and TCG developers > who use fairly minimal command lines regularly. Once config file support is complete enough we should be able to offload backward compatibility command line parsing to some script which transforms the cli into a config file. Which is probably better than trying to add -writeconfig to qemu as we don't have to do the string processing in C then. cheers, Gerd