… is easy. You only need to write about 60 lines of code for each new function. Here’s how.
- Add the function to the generator [about 10 lines of code per new function].
- Add the implementation (in C) to the daemon [about 50 lines of code per new function].
- Build as normal, debug, rinse, repeat until it’s working.
- Send the patch to fedora-virt mailing list.
This example shows the generator for 4 new functions: set_e2label, get_e2label, set_e2uuid and get_e2uuid. It’s useful to go and have a look at the other commands in that file to see how the parameter types, return type and tests work.
This example shows the implementation in the daemon of these commands. Again it’s useful to compare this with the functions available in the header files in the daemon, and other implementations.
When you run
src/generator.ml from the top level directory, it must not print any errors or warnings. The generator will generate thousands of lines of code for your short function definition. It basically writes the language bindings, RPC protocol, manual pages etc for you. You can see an example of the generated code here. Lucky we don’t have to write that lot …