Libvirt and the camera print technique
RedHat’s Libvirt project is very interesting. It has the capability to produce a tool that can target all the popular VM technologies, presenting a single interface that lets users manage their VMs. Of late I have been trying to add OpenVZ support into Libvirt. It is a project of, I would say, medium complexity. Most of the work involves studying the OpenVZ userland utilities and re-coding it in Libvirt. The reason I can’t use code from OpenVZ utilities directly is that those are licensed under the GPL, while LibVirt is LGPL. AFAIK, that should not be done.
I wrote a mail to the OpenVZ maintainers, but these things take time to decide. Or there may be no release at all, since SWSoft, the company that sponsors OpenVZ development, actually sells an improved version with tools called Virtuozzo. If they make the code available under the LGPL, that would mean that commercial , non-open source software is free to link with it and utilize its services.
The approach I used in EasyVZ is simple. The OpenVZ utilities are very scripting friendly with a very regular text output format. So, I used Python to read the output, parse it and used it. This technique I call camera print technique. It comes from this:
You get legal, original DVDs from the market, or you can also get poor quality, shoddy DVDs that are theatre -> handycam -> DVD copies. Well, you can hear the audience laughing when there is a good joke or you can see someone go out to take a piss or a smoke when the director gets uncreative. These illegal copies are said to be shattering the life of many producers, especially with movies riding on crores of rupees.
Executing an external binary and parsing its output is an easy way to avoid GPL-LGPL issues, but there is a cost performance-wise and also resource-wise. The camera print technique has helped me though, and it seems to come in handy once more with Libvirt. I have no clue if the maintainers will be interested in horrible code like this, but only time will tell.
