-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Well done! #2
Comments
Thanks! It's fairly functional right now, and the best thing you could do it try to use it and see if there are any pain points with the way the API currently works, and as a sanity check to identify any possible bugs. A few things in particular that stand out to me:
|
Ok cool so there's a lot of places I can lend a hand. I also thought about creating some code to allow this to invoke qemu with various parameters. |
Huh, now that would be an interesting project if we could parse QEMU's |
Wow what in the heck file format is this |
I have no idea to be honest. It certainly looks structured enough to be usable for us to parse, but I'm not really sure how that file turns into an option parser in qemu itself. |
I wonder if something like peg could be useful here. |
Hm, see qemuopts. Maybe the .hx file is only for generating texinfo documentation? Though it's probably better than trying to parse the C structs strewn throughout the codebase. As for peg, maybe, it's probably just up to personal preference/comfort whether to use something like it or nom. |
The blocks seem to be defined by |
Hm yeah, it does look mostly freeform texinfo, so it's hard to say whether it's strict/structured enough to be parsed without fuzzing in some places... The real structured data is indeed scattered in the C source files >< |
For what it's worth, QEMU itself has wanted to refactor its option parsing and documentation very badly for a very long time, but the subsystems in QEMU are so diverse as to be almost entirely fractured; so any sweeping changes to the options management wind up requiring a lot of specific knowledge of arcane modules to bring about fully. Not to mention that we did not have a real deprecation policy until quite recently; and we have many existing legacy users who rely on some commands that are actually quite difficult to support. It's not something I get to spend much of my time on, but better documentation for QEMU and as a result a more mechanical, data-driven schema for the QEMU command-line that ties into the QAPI schema is on my mind, but it's a huge project. KVM Forum 2019 is coming up and it will for sure be on my list of things to talk about to see if we can't come up with some plans to modernize our documentation and interface specifications. |
Two years later: I spend a LOT of time on this now. We are actively refactoring our command line parsing and marching towards a version of QEMU that can be configured entirely through QMP, at which point the desire for parsing command line options in this library will be moot. I happen to know that elmarco has also been experimenting with generating QAPI types directly into rust using our in-tree QAPI generator (Python). Perhaps there is some synchronicity possible there. |
This is fantastic! I've been struggling with how to get this working on and off for a long time now: https://github.com/cholcombe973/parse_qapi and https://github.com/cholcombe973/qemu-rust. I started tinkering with it again yesterday but realized today you'd already done it. Is there anywhere I can help on this?
The text was updated successfully, but these errors were encountered: