[Libvir] Exporting calls just to libvirtd

Richard W.M. Jones rjones at redhat.com
Tue Jul 31 14:32:17 UTC 2007


With the two patches[1][2] I recently posted, the remote driver has 
started to make calls more directly into the drivers.  Calls like 
driver->domainMigratePrepare in [2] are exposed to the remote driver, 
but shouldn't be exported for public use.

However because libvirtd links to regular libvirt.so, the calls actually 
do need to be exported, so we export them as __virDomainMigratePrepare 
(etc) with the double underscore and exclusion from <libvirt.h> 
indicating that users of the published libvirt API should not call them.

It seems we could avoid exporting them entirely with one of these methods:

(a) Link libvirtd to the static libvirt.a.

-- Probably violates a load of distro policy and removes some supposed 
benefits of dynamic linking.

(b) Build a separate shared library with a different dynamic symbol table.

-- Also removes one benefit of dynamic linking, because the two 
libraries are different despite having the same code in them.

Any ideas if some advanced feature of ELF offers a way out here?

Rich.

[1]https://www.redhat.com/archives/libvir-list/2007-July/msg00444.html
[2]https://www.redhat.com/archives/libvir-list/2007-July/msg00357.html

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070731/01570cc3/attachment-0001.bin>


More information about the libvir-list mailing list