
Daniel P. Berrange wrote:
If you loook at src/qemu_conf.c, you'll find a nice method called qemudExtractVersionInfo, which runs 'qemu -help' and checks for certain interesting command line arguments :-)
That problem does seem to be crying for some type of structured interface to avoid subtle breakage should someone modify the output of "--help". I'm sure I'm preaching to the choir here. So it now adapts for the cases of old syntax and "writethrough" as well as new syntax and "on" since qemu will otherwise balk at those cache flag / version combinations.
One note about the enums - rather than adding old style CACHEON CACHE_OFF options to the main enum in domain_conf, just create a second enum in the qemu_conf.c file for recording the mapping of virDomainDiskCache values to old style QEMU arguments values.. As we are adapting in both directions I left the single enum representing the entire option list to simplify things. Updated patch is attached.
-john -- john.cooper@redhat.com