On Tue, Mar 16, 2010 at 03:58:57PM +0000, Richard W.M. Jones wrote:
On Tue, Mar 16, 2010 at 03:54:05PM +0000, Daniel P. Berrange wrote:
> Actually this won't work either because of this 2nd requirement from GType
>
> 1. All class structures must contain as first member a GTypeClass structure.
> 2. All instance structures must contain as first member a GTypeInstance structure.
I guess we could put some padding at the beginning of the real
guestfs_h structure. It shouldn't break the ABI because no callers
should be looking inside the guestfs_h structure.
The current _GTypeInstance just contains a single pointer, so 8 bytes
of padding ought to do it ...
This is a bit trickier than it looks.
GObject needs to know the size of the structure, and obviously we
don't expose this. If we expose it through a libguestfs API call,
then there seems to be the danger that GObject could try to move /
duplicate the structure. That would break libguestfs because we
maintain a list of pointers to open handles internally.
I think I'll leave this for now.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw