On Fri, Jun 27, 2014 at 04:55:33PM +0200, Maros Zatko wrote:
Hi everyone,
lately I've been getting familiar with library and working on slight
re-layering of the library. It's about having locking layer in public API and
tracing one layer below that (let's call it __t_ layer. I'm not very good at
making up names, so this is temporary:) ). Then making sure that all generated
public stuff call __t_ layer and all other internal stuff doesn't use public
API since it would deadlock otherwise.
Now the problem - an example:
Generator creates guestfs_copy_device_to_device_argv, but not
guestfs_copy_device_to_device_argv version.
Is there a typo in this sentence?
The generator makes:
- guestfs_copy_device_to_device in src/actions-variants.c
- guestfs_copy_device_to_device_va in src/actions-variants.c
- guestfs_copy_device_to_device_argv in src/actions-1.c
guestfs_copy_device_to_device
--> calls guestfs_copy_device_to_device_argv
guestfs_copy_device_to_device_va
--> calls guestfs_copy_device_to_device_argv
The "real" public API here is guestfs_copy_device_to_device_argv, and
I think that's where the locking should go.
If there is some code in libguestfs which recursively calls
guestfs_copy_device_to_device now (there happens not to be), I think
it should be changed to call _guestfs_unlocked_copy_device_to_device,
or whatever we're calling the internal unlocked version.
Other issue:
generated declaration for guestfs__internal_test in guestfs-internal-actions.h
looks like this:
extern int guestfs__internal_test (guestfs_h *g, const char *str,
const char *optstr, char *const *strlist, int b, int integer,
int64_t integer64, const char *filein, const char *fileout,
const char *bufferin, size_t bufferin_size, ...);
In my copy it is declared as:
extern int guestfs__internal_test (guestfs_h *g, const char *str, const char *optstr, char
*const *strlist, int b, int integer, int64_t integer64, const char *filein, const char
*fileout, const char *bufferin, size_t bufferin_size, const struct
guestfs_internal_test_argv *optargs);
so that would be correct I think.
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v