On Fri, Jun 26, 2009 at 12:21:01PM +0300, Avi Kivity wrote:
On 06/25/2009 10:11 PM, Luiz Capitulino wrote:
Yes, having a library was suggested by Amit some months ago. The
problem is that it has various issues wrt maintainability.
For example, libvirt is able to run two instances of different
versions of qemu at the same time. How to handle this if you
update libmonitor.so?
The sane way is to *NOT* break ABI of libmonitor.so, and not change
the wire protocol in a non backwards compatible way. This is entirely
doable, it just the maintainer of libmonitor/qemu to decide that ABI
stability is important. So if you find an existing API / command
needs to gain an extra argument, you don't change the existing API,
you add a new one. Or ideally design the API upfront so that it
can be extended without breaking back compatability.
You could use dlopen(). The problem with a library is that it assumes
everyone is still trapped in C, which is not the case.
dlopen() of a different libmonitor.so for every version of QEMU is just
crazy, whether C or not. Maintain ABI& protocol back compatability
with new releases and avoid the issue in the first place.